|
1 /* |
|
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Handles the launching of silent installation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include "iaupdatersilentlauncher.h" |
|
21 #include "SWInstDefs.h" |
|
22 #include "iaupdaterdefs.h" |
|
23 #include "iaupdatedebug.h" |
|
24 |
|
25 // ======== LOCAL FUNCTIONS ======== |
|
26 |
|
27 // ======== MEMBER FUNCTIONS ======== |
|
28 |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CIAUpdaterSilentLauncher::CIAUpdaterSilentLauncher |
|
32 // C++ default constructor |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 CIAUpdaterSilentLauncher::CIAUpdaterSilentLauncher( RFs& aFs ): iFs( aFs ) |
|
36 { |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CIAUpdaterSilentLauncher::ConstructL |
|
41 // Symbian 2nd phase constructor can leave. |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 void CIAUpdaterSilentLauncher::ConstructL() |
|
45 { |
|
46 iOptionsPckg = SilentInstallOptionsL(); |
|
47 } |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // CIAUpdaterSilentLauncher::NewL |
|
51 // Two-phased constructor. |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 CIAUpdaterSilentLauncher* CIAUpdaterSilentLauncher::NewL( RFs& aFs ) |
|
55 { |
|
56 CIAUpdaterSilentLauncher* self = new( ELeave ) CIAUpdaterSilentLauncher( aFs ); |
|
57 CleanupStack::PushL( self ); |
|
58 self->ConstructL(); |
|
59 CleanupStack::Pop( self ); |
|
60 return self; |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // CIAUpdaterSilentLauncher::~CIAUpdaterSilentLauncher |
|
65 // C++ Destructor |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 CIAUpdaterSilentLauncher::~CIAUpdaterSilentLauncher() |
|
69 { |
|
70 iLauncher.Close(); |
|
71 } |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // CIAUpdaterSilentLauncher::InstallL |
|
75 // Perform installation. |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 void CIAUpdaterSilentLauncher::InstallL( const TDesC& aFile, TRequestStatus& aStatus ) |
|
79 { |
|
80 IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::InstallL() begin"); |
|
81 |
|
82 if ( !iConnected ) |
|
83 { |
|
84 IAUPDATE_TRACE("[IAUpdater] Connect to launcher"); |
|
85 User::LeaveIfError( iLauncher.Connect() ); |
|
86 iConnected = ETrue; |
|
87 } |
|
88 |
|
89 // Launch the installation |
|
90 IAUPDATE_TRACE("[IAUpdater] Launch silent install"); |
|
91 iLauncher.SilentInstall( aStatus, aFile, iOptionsPckg ); |
|
92 |
|
93 IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::InstallL() end"); |
|
94 } |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // CIAUpdaterSilentLauncher::Cancel |
|
98 // Cancel the current installation. |
|
99 // ----------------------------------------------------------------------------- |
|
100 // |
|
101 void CIAUpdaterSilentLauncher::Cancel() |
|
102 { |
|
103 IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::Cancel() begin"); |
|
104 |
|
105 iLauncher.CancelAsyncRequest( SwiUI::ERequestSilentInstall ); |
|
106 |
|
107 IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::Cancel() end"); |
|
108 } |
|
109 |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CIAUpdaterSilentLauncher::SilentInstallOptionsL |
|
113 // |
|
114 // --------------------------------------------------------------------------- |
|
115 // |
|
116 SwiUI::TInstallOptions CIAUpdaterSilentLauncher::SilentInstallOptionsL() const |
|
117 { |
|
118 IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::SilentInstallOptionsL() begin"); |
|
119 |
|
120 SwiUI::TInstallOptions options; |
|
121 |
|
122 // Upgrades are allowed |
|
123 options.iUpgrade = SwiUI::EPolicyAllowed; |
|
124 |
|
125 // Install all if optional packets exist. |
|
126 options.iOptionalItems = SwiUI::EPolicyAllowed; |
|
127 |
|
128 // Prevent online cert revocation check. |
|
129 options.iOCSP = SwiUI::EPolicyNotAllowed; |
|
130 |
|
131 // See iOCSP setting above |
|
132 options.iIgnoreOCSPWarnings = SwiUI::EPolicyAllowed; |
|
133 |
|
134 // Do not allow installation of uncertified packages. |
|
135 options.iUntrusted = SwiUI::EPolicyNotAllowed; |
|
136 |
|
137 // If filetexts are included in SIS package. Then, show them. |
|
138 options.iPackageInfo = SwiUI::EPolicyUserConfirm; |
|
139 |
|
140 // Automatically grant user capabilities. |
|
141 // See also iUntrusted above. |
|
142 options.iCapabilities = SwiUI::EPolicyAllowed; |
|
143 |
|
144 // Open application will be closed. |
|
145 options.iKillApp = SwiUI::EPolicyAllowed; |
|
146 |
|
147 // Files can be overwritten. |
|
148 options.iOverwrite = SwiUI::EPolicyAllowed; |
|
149 |
|
150 // This only affects Java applications. |
|
151 options.iDownload = SwiUI::EPolicyAllowed; |
|
152 |
|
153 // Notice! Here we use always the same drive for the IAD. |
|
154 // So, this will not change automatically according to the disk spaces |
|
155 // and when new memory cards are inserted into the phone. |
|
156 options.iDrive = IAUpdaterDefs::KIAUpdaterDrive; |
|
157 |
|
158 // Choose the phone language. |
|
159 options.iLang = User::Language(); |
|
160 |
|
161 // If language is asked, then use the current phone language. |
|
162 options.iUsePhoneLang = ETrue; |
|
163 |
|
164 // Does not affect SISX. This is for Java. |
|
165 options.iUpgradeData = SwiUI::EPolicyAllowed; |
|
166 |
|
167 IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::SilentInstallOptionsL() end"); |
|
168 |
|
169 return options; |
|
170 } |
|
171 |
|
172 |
|
173 // ======== GLOBAL FUNCTIONS ======== |
|
174 |
|
175 // EOF |