|
1 /* |
|
2 * Copyright (c) 1997-2009 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 the License "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: |
|
15 * Application Processor. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @released |
|
23 @internalTechnology |
|
24 */ |
|
25 |
|
26 #include <hash.h> |
|
27 #include "uninstallationprocessor.h" |
|
28 |
|
29 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
30 #include "integrityservices.h" |
|
31 #endif |
|
32 |
|
33 #include "sishelperclient.h" |
|
34 #include "sisregistryfiledescription.h" |
|
35 #include "sisstring.h" |
|
36 #include "hashcontainer.h" |
|
37 #include "siscontroller.h" |
|
38 #include "application.h" |
|
39 #include "log.h" |
|
40 #include "secutils.h" |
|
41 #include "sisuihandler.h" |
|
42 #include "filesisdataprovider.h" |
|
43 #include "securitymanager.h" |
|
44 #include "sislauncherclient.h" |
|
45 #include "sisinfo.h" |
|
46 #include "sisuid.h" |
|
47 |
|
48 |
|
49 using namespace Swi; |
|
50 |
|
51 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
52 CUninstallationProcessor* CUninstallationProcessor::NewL(const CPlan& aPlan, |
|
53 RUiHandler& aUiHandler, Usif::RStsSession& aStsSession, |
|
54 CRegistryWrapper& aRegistryWrapper, RSwiObserverSession& aObserver) |
|
55 { |
|
56 CUninstallationProcessor* self = CUninstallationProcessor::NewLC(aPlan, aUiHandler, aStsSession, |
|
57 aRegistryWrapper, aObserver); |
|
58 CleanupStack::Pop(self); |
|
59 return self; |
|
60 } |
|
61 #else |
|
62 CUninstallationProcessor* CUninstallationProcessor::NewL(const CPlan& aPlan, |
|
63 RUiHandler& aUiHandler, CIntegrityServices& aIntegrityServices, RSwiObserverSession& aObserver) |
|
64 { |
|
65 CUninstallationProcessor* self = CUninstallationProcessor::NewLC(aPlan, aUiHandler, aIntegrityServices, aObserver); |
|
66 CleanupStack::Pop(self); |
|
67 return self; |
|
68 } |
|
69 #endif |
|
70 |
|
71 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
72 CUninstallationProcessor* CUninstallationProcessor::NewLC(const CPlan& aPlan, |
|
73 RUiHandler& aUiHandler, Usif::RStsSession& aStsSession, |
|
74 CRegistryWrapper& aRegistryWrapper, RSwiObserverSession& aObserver) |
|
75 { |
|
76 CUninstallationProcessor* self = new(ELeave) CUninstallationProcessor(aPlan, |
|
77 aUiHandler, aStsSession, aRegistryWrapper, aObserver); |
|
78 CleanupStack::PushL(self); |
|
79 self->ConstructL(); |
|
80 return self; |
|
81 } |
|
82 #else |
|
83 CUninstallationProcessor* CUninstallationProcessor::NewLC(const CPlan& aPlan, |
|
84 RUiHandler& aUiHandler, CIntegrityServices& aIntegrityServices, RSwiObserverSession& aObserver) |
|
85 { |
|
86 CUninstallationProcessor* self = new(ELeave) CUninstallationProcessor(aPlan, |
|
87 aUiHandler, aIntegrityServices, aObserver); |
|
88 CleanupStack::PushL(self); |
|
89 self->ConstructL(); |
|
90 return self; |
|
91 } |
|
92 #endif |
|
93 |
|
94 CUninstallationProcessor* CUninstallationProcessor::NewL(CUninstallationProcessor& aProcessor) |
|
95 { |
|
96 return CUninstallationProcessor::NewL(aProcessor.Plan(), aProcessor.UiHandler(), |
|
97 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
98 aProcessor.TransactionSession(), aProcessor.iRegistryWrapper, |
|
99 #else |
|
100 aProcessor.IntegrityServices(), |
|
101 #endif |
|
102 aProcessor.Observer()); |
|
103 } |
|
104 |
|
105 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
106 CUninstallationProcessor::CUninstallationProcessor(const CPlan& aPlan, |
|
107 RUiHandler& aUiHandler, Usif::RStsSession& aStsSession, CRegistryWrapper& aRegistryWrapper, |
|
108 RSwiObserverSession& aObserver) |
|
109 : CProcessor(aPlan, aUiHandler, aStsSession, aRegistryWrapper, aObserver) |
|
110 { |
|
111 } |
|
112 #else |
|
113 CUninstallationProcessor::CUninstallationProcessor(const CPlan& aPlan, |
|
114 RUiHandler& aUiHandler, CIntegrityServices& aIntegrityServices, RSwiObserverSession& aObserver) |
|
115 : CProcessor(aPlan, aUiHandler, aIntegrityServices, aObserver) |
|
116 { |
|
117 } |
|
118 #endif |
|
119 |
|
120 CUninstallationProcessor::~CUninstallationProcessor() |
|
121 { |
|
122 Cancel(); |
|
123 |
|
124 delete iEmbeddedProcessor; |
|
125 Reset(); // reset filename arrays |
|
126 } |
|
127 |
|
128 void CUninstallationProcessor::ConstructL() |
|
129 { |
|
130 CProcessor::ConstructL(); |
|
131 } |
|
132 |
|
133 void CUninstallationProcessor::Reset() |
|
134 { |
|
135 } |
|
136 |
|
137 |
|
138 void CUninstallationProcessor::DoCancel() |
|
139 { |
|
140 CProcessor::DoCancel(); |
|
141 if (iEmbeddedProcessor && iEmbeddedProcessor->IsActive()) |
|
142 { |
|
143 iEmbeddedProcessor->Cancel(); |
|
144 } |
|
145 } |
|
146 |
|
147 // State processing functions |
|
148 |
|
149 TBool CUninstallationProcessor::DoStateInitializeL() |
|
150 { |
|
151 iUiState = EInitialize; |
|
152 iCurrent = 0; |
|
153 return ETrue; |
|
154 } |
|
155 |
|
156 TBool CUninstallationProcessor::DoStateProcessEmbeddedL() |
|
157 { |
|
158 if (iCurrent < ApplicationL().EmbeddedApplications().Count()) |
|
159 { |
|
160 EmbeddedProcessorL().ProcessApplicationL(*ApplicationL().EmbeddedApplications()[iCurrent++], iStatus); |
|
161 WaitState(ECurrentState); |
|
162 return EFalse; |
|
163 } |
|
164 else |
|
165 { |
|
166 iCurrent=0; |
|
167 return ETrue; |
|
168 } |
|
169 } |
|
170 |
|
171 TBool CUninstallationProcessor::DoStateExtractFilesL() |
|
172 { |
|
173 return ETrue; // Nothing to do |
|
174 } |
|
175 |
|
176 TBool CUninstallationProcessor::DoStateVerifyPathsL() |
|
177 { |
|
178 return ETrue; // Nothing to do |
|
179 } |
|
180 |
|
181 TBool CUninstallationProcessor::DoStateInstallFilesL() |
|
182 { |
|
183 return ETrue; // Nothing to do |
|
184 } |
|
185 |
|
186 TBool CUninstallationProcessor::DoStateDisplayFilesL() |
|
187 { |
|
188 return ETrue; // Nothing to do |
|
189 } |
|
190 |
|
191 TBool CUninstallationProcessor::DoStateProcessSkipFilesL() |
|
192 { |
|
193 return ETrue; // Nothing to do |
|
194 } |
|
195 |
|
196 TBool CUninstallationProcessor::DoStateUpdateRegistryL() |
|
197 { |
|
198 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
199 // Now that we are ready to make changes to the registry so we start a transaction |
|
200 // Note that the commit/rollback action is subsequently taken by the later steps of the state machine |
|
201 iRegistryWrapper.StartMutableOperationsL(); |
|
202 iRegistryWrapper.RegistrySession().DeleteEntryL(ApplicationL().PackageL(), TransactionSession().TransactionIdL()); |
|
203 #else |
|
204 RSisRegistryWritableSession session; |
|
205 User::LeaveIfError(session.Connect()); |
|
206 CleanupClosePushL(session); |
|
207 |
|
208 session.DeleteEntryL(ApplicationL().PackageL(), IntegrityServices().TransactionId()); |
|
209 CleanupStack::PopAndDestroy(&session); |
|
210 #endif |
|
211 return ETrue; |
|
212 } |
|
213 |
|
214 CUninstallationProcessor& CUninstallationProcessor::EmbeddedProcessorL() |
|
215 { |
|
216 if (!iEmbeddedProcessor) |
|
217 { |
|
218 iEmbeddedProcessor=CUninstallationProcessor::NewL(*this); |
|
219 } |
|
220 return *iEmbeddedProcessor; |
|
221 } |
|
222 |