114 } |
114 } |
115 |
115 |
116 bool SisFile::GetInstallableFiles(InstallableFiles& aFiles, |
116 bool SisFile::GetInstallableFiles(InstallableFiles& aFiles, |
117 ExpressionEvaluator& aEvaluator, |
117 ExpressionEvaluator& aEvaluator, |
118 const std::wstring& aDrivePath, |
118 const std::wstring& aDrivePath, |
119 int aInstallingDrive) const |
119 int aInstallingDrive, |
|
120 const int aSystemDrive, |
|
121 const bool aGenerateRomStub) const |
120 { |
122 { |
121 bool success = true; |
123 bool success = true; |
122 |
124 |
123 CSISInfo::TSISInstallationType installType = iContents.Controller().SISInfo().InstallationType(); |
125 CSISInfo::TSISInstallationType installType = iContents.Controller().SISInfo().InstallationType(); |
124 int count = iContents.SisData().DataUnitCount(); |
126 int count = iContents.SisData().DataUnitCount(); |
139 { |
141 { |
140 // for PA stub sis files no file data present, |
142 // for PA stub sis files no file data present, |
141 // aFiles will be filled with only file descriptions of files, empty file data |
143 // aFiles will be filled with only file descriptions of files, empty file data |
142 if (NULL != dataUnit && fileDes.Operation() != CSISFileDescription::EOpNull) |
144 if (NULL != dataUnit && fileDes.Operation() != CSISFileDescription::EOpNull) |
143 { |
145 { |
144 aFiles.push_back(new InstallableFile(fileDes, new CSISFileData(dataUnit->FileData(fileDes.FileIndex())), aDrivePath, aInstallingDrive)); |
146 aFiles.push_back(new InstallableFile(fileDes, new CSISFileData(dataUnit->FileData(fileDes.FileIndex())), aDrivePath, aInstallingDrive, aSystemDrive, aGenerateRomStub)); |
145 } |
147 } |
146 else |
148 else |
147 { |
149 { |
148 // SIS files will not be present in PA stubs |
150 // SIS files will not be present in PA stubs |
149 aFiles.push_back( new InstallableFile(fileDes,aDrivePath,aInstallingDrive)); |
151 aFiles.push_back( new InstallableFile(fileDes,aDrivePath,aInstallingDrive, aSystemDrive, aGenerateRomStub)); |
150 } |
152 } |
151 } |
153 } |
152 } |
154 } |
153 |
155 |
154 // process main controller - data unit 0 |
156 // process main controller - data unit 0 |
155 const CSISInstallBlock& installBlock = iContents.Controller().InstallBlock(); |
157 const CSISInstallBlock& installBlock = iContents.Controller().InstallBlock(); |
156 |
158 |
157 ProcessInstallBlock(installBlock, aFiles, aEvaluator, aDrivePath, aInstallingDrive); |
159 ProcessInstallBlock(installBlock, aFiles, aEvaluator, aDrivePath, aInstallingDrive, aSystemDrive, aGenerateRomStub); |
158 |
160 |
159 return success; |
161 return success; |
160 } |
162 } |
161 |
163 |
162 bool SisFile::HasEmbedded() const |
164 bool SisFile::HasEmbedded() const |
228 case CSISFileDescription::EOpRun: |
230 case CSISFileDescription::EOpRun: |
229 { |
231 { |
230 const CSISFileDescription::TSISInstOption operationOptions = fD.OperationOptions(); |
232 const CSISFileDescription::TSISInstOption operationOptions = fD.OperationOptions(); |
231 if(operationOptions & CSISFileDescription::EInstFileRunOptionByMimeType) |
233 if(operationOptions & CSISFileDescription::EInstFileRunOptionByMimeType) |
232 { |
234 { |
233 LWARN(L"File " << target << L" contains \"Run-Using-MIME\" option that will be ignored."); |
235 LWARN(L"File " << target.c_str() << L" contains \"Run-Using-MIME\" option that will be ignored."); |
234 } |
236 } |
235 if((operationOptions & CSISFileDescription::EInstFileRunOptionInstall) \ |
237 if((operationOptions & CSISFileDescription::EInstFileRunOptionInstall) \ |
236 && (operationOptions & CSISFileDescription::EInstFileRunOptionUninstall)) |
238 && (operationOptions & CSISFileDescription::EInstFileRunOptionUninstall)) |
237 { |
239 { |
238 LWARN(L"File " << target << L" contains \"RUN-BOTH\" option that will be ignored."); |
240 LWARN(L"File " << target.c_str() << L" contains \"RUN-BOTH\" option that will be ignored."); |
239 } |
241 } |
240 else if(operationOptions & CSISFileDescription::EInstFileRunOptionInstall) |
242 else if(operationOptions & CSISFileDescription::EInstFileRunOptionInstall) |
241 { |
243 { |
242 LWARN(L"File " << target << L" contains \"Run-On-Install\" option that will be ignored."); |
244 LWARN(L"File " << target.c_str() << L" contains \"Run-On-Install\" option that will be ignored."); |
243 } |
245 } |
244 else if(operationOptions & CSISFileDescription::EInstFileRunOptionUninstall) |
246 else if(operationOptions & CSISFileDescription::EInstFileRunOptionUninstall) |
245 { |
247 { |
246 LWARN(L"File " << target << L" contains \"Run-On-Uninstall\" option that will be ignored."); |
248 LWARN(L"File " << target.c_str() << L" contains \"Run-On-Uninstall\" option that will be ignored."); |
247 } |
249 } |
248 if(operationOptions & CSISFileDescription::EInstFileRunOptionBeforeShutdown) |
250 if(operationOptions & CSISFileDescription::EInstFileRunOptionBeforeShutdown) |
249 { |
251 { |
250 LWARN(L"File " << target << L" contains \"Run-Before-Shutdown\" option that will be ignored."); |
252 LWARN(L"File " << target.c_str() << L" contains \"Run-Before-Shutdown\" option that will be ignored."); |
251 } |
253 } |
252 if(operationOptions & CSISFileDescription::EInstFileRunOptionAfterInstall) |
254 if(operationOptions & CSISFileDescription::EInstFileRunOptionAfterInstall) |
253 { |
255 { |
254 LWARN(L"File " << target << L" contains \"Run-After-Install\" option that will be ignored."); |
256 LWARN(L"File " << target.c_str() << L" contains \"Run-After-Install\" option that will be ignored."); |
255 } |
257 } |
256 LWARN(L"File " << target << L" contains \"File-Run\" option that will be ignored."); |
258 LWARN(L"File " << target.c_str() << L" contains \"File-Run\" option that will be ignored."); |
257 } |
259 } |
258 success = true; |
260 success = true; |
259 break; |
261 break; |
260 case CSISFileDescription::EOpText: |
262 case CSISFileDescription::EOpText: |
261 LWARN(L"File " << target << L" contains \"Display Text\" option that will be ignored." ); |
263 LWARN(L"File " << target.c_str() << L" contains \"Display Text\" option that will be ignored." ); |
262 success = true; |
264 success = true; |
263 break; |
265 break; |
264 case CSISFileDescription::EOpNull: |
266 case CSISFileDescription::EOpNull: |
265 case CSISFileDescription::EOpNone: |
267 case CSISFileDescription::EOpNone: |
266 success = true; |
268 success = true; |
369 } |
371 } |
370 |
372 |
371 void SisFile::GetInstallableFiles( InstallableFiles& aFiles, |
373 void SisFile::GetInstallableFiles( InstallableFiles& aFiles, |
372 const CSISInstallBlock& aInstallBlock, |
374 const CSISInstallBlock& aInstallBlock, |
373 const std::wstring& aDrivePath, |
375 const std::wstring& aDrivePath, |
374 int aInstallingDrive) const |
376 int aInstallingDrive, |
|
377 const int aSystemDrive, |
|
378 const bool aGenerateRomStub) const |
375 { |
379 { |
376 CSISInfo::TSISInstallationType installType = iContents.Controller().SISInfo().InstallationType(); |
380 CSISInfo::TSISInstallationType installType = iContents.Controller().SISInfo().InstallationType(); |
377 const CSISDataUnit* dataUnit = NULL; |
381 const CSISDataUnit* dataUnit = NULL; |
378 |
382 |
379 if (installType == CSISInfo::EInstInstallation || installType == CSISInfo::EInstAugmentation || installType == CSISInfo::EInstPartialUpgrade) |
383 if (installType == CSISInfo::EInstInstallation || installType == CSISInfo::EInstAugmentation || installType == CSISInfo::EInstPartialUpgrade) |
396 // for PA stub sis files no file data present, |
400 // for PA stub sis files no file data present, |
397 // aFiles will be filled with only file descriptions of files, empty file data |
401 // aFiles will be filled with only file descriptions of files, empty file data |
398 if (NULL != dataUnit && fileDes.Operation() != CSISFileDescription::EOpNull) |
402 if (NULL != dataUnit && fileDes.Operation() != CSISFileDescription::EOpNull) |
399 { |
403 { |
400 const CSISFileData& filedataref = dataUnit->FileData(fileDes.FileIndex()); |
404 const CSISFileData& filedataref = dataUnit->FileData(fileDes.FileIndex()); |
401 aFiles.push_back(new InstallableFile(fileDes, new CSISFileData(dataUnit->FileData(fileDes.FileIndex())), aDrivePath, aInstallingDrive)); |
405 aFiles.push_back(new InstallableFile(fileDes, new CSISFileData(dataUnit->FileData(fileDes.FileIndex())), aDrivePath, aInstallingDrive, aSystemDrive, aGenerateRomStub)); |
402 } |
406 } |
403 else // for stubs, no file data |
407 else // for stubs, no file data |
404 { |
408 { |
405 aFiles.push_back(new InstallableFile(fileDes, aDrivePath, aInstallingDrive)); |
409 aFiles.push_back(new InstallableFile(fileDes, aDrivePath, aInstallingDrive, aSystemDrive, aGenerateRomStub)); |
406 } |
410 } |
407 } |
411 } |
408 } |
412 } |
409 |
413 |
410 void SisFile::ProcessInstallBlock(const CSISInstallBlock& aInstallBlock, |
414 void SisFile::ProcessInstallBlock(const CSISInstallBlock& aInstallBlock, |
411 InstallableFiles& aFiles, |
415 InstallableFiles& aFiles, |
412 ExpressionEvaluator& aEvaluator, |
416 ExpressionEvaluator& aEvaluator, |
413 const std::wstring& aDrivePath, |
417 const std::wstring& aDrivePath, |
414 int aInstallingDrive) const |
418 int aInstallingDrive, |
415 { |
419 const int aSystemDrive, |
416 GetInstallableFiles(aFiles, aInstallBlock, aDrivePath, aInstallingDrive); |
420 const bool aGenerateRomStub) const |
|
421 { |
|
422 GetInstallableFiles(aFiles, aInstallBlock, aDrivePath, aInstallingDrive, aSystemDrive,aGenerateRomStub); |
417 |
423 |
418 const CSISArray<CSISIf, CSISFieldRoot::ESISIf>& ifs = aInstallBlock.Ifs(); |
424 const CSISArray<CSISIf, CSISFieldRoot::ESISIf>& ifs = aInstallBlock.Ifs(); |
419 for (int i = 0; i < ifs.size(); ++i) |
425 for (int i = 0; i < ifs.size(); ++i) |
420 { |
426 { |
421 const CSISIf& ifBlock = ifs[i]; |
427 const CSISIf& ifBlock = ifs[i]; |
430 // Main expression |
436 // Main expression |
431 const ExpressionResult expressionResult = aEvaluator.Evaluate( ifBlock.Expression() ); |
437 const ExpressionResult expressionResult = aEvaluator.Evaluate( ifBlock.Expression() ); |
432 const bool processBlock = expressionResult.BoolValue(); |
438 const bool processBlock = expressionResult.BoolValue(); |
433 if ( processBlock ) |
439 if ( processBlock ) |
434 { |
440 { |
435 ProcessInstallBlock(ifBlock.InstallBlock(), aFiles, aEvaluator, aDrivePath, aInstallingDrive); |
441 ProcessInstallBlock(ifBlock.InstallBlock(), aFiles, aEvaluator, aDrivePath, aInstallingDrive, aSystemDrive, aGenerateRomStub); |
436 continue; |
442 continue; |
437 } |
443 } |
438 |
444 |
439 int elseCount = ifBlock.ElseIfCount(); |
445 int elseCount = ifBlock.ElseIfCount(); |
440 for (int i = 0; i < elseCount; ++i) |
446 for (int i = 0; i < elseCount; ++i) |
441 { |
447 { |
442 const CSISElseIf& ifElseBlock = ifBlock.ElseIf(i) ; |
448 const CSISElseIf& ifElseBlock = ifBlock.ElseIf(i) ; |
443 if ( aEvaluator.Evaluate(ifElseBlock.Expression()).BoolValue()) |
449 if ( aEvaluator.Evaluate(ifElseBlock.Expression()).BoolValue()) |
444 { |
450 { |
445 ProcessInstallBlock(ifElseBlock.InstallBlock(), aFiles, aEvaluator, aDrivePath, aInstallingDrive); |
451 ProcessInstallBlock(ifElseBlock.InstallBlock(), aFiles, aEvaluator, aDrivePath, aInstallingDrive, aSystemDrive, aGenerateRomStub); |
446 break; // Stop processing else if blocks |
452 break; // Stop processing else if blocks |
447 } |
453 } |
448 // Process the rest of the files |
454 // Process the rest of the files |
449 GetInstallableFiles(aFiles, ifElseBlock.InstallBlock(), aDrivePath, aInstallingDrive); |
455 GetInstallableFiles(aFiles, ifElseBlock.InstallBlock(), aDrivePath, aInstallingDrive, aSystemDrive, aGenerateRomStub); |
450 } |
456 } |
451 } |
457 } |
452 } |
458 } |
453 |
459 |
454 PackageUids SisFile::GetEmbeddedPackageUids() const |
460 PackageUids SisFile::GetEmbeddedPackageUids() const |