summaryrefslogtreecommitdiff
path: root/src/burn/engine/bundlepackageengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/bundlepackageengine.cpp')
-rw-r--r--src/burn/engine/bundlepackageengine.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/burn/engine/bundlepackageengine.cpp b/src/burn/engine/bundlepackageengine.cpp
index ef08d417..6336bd27 100644
--- a/src/burn/engine/bundlepackageengine.cpp
+++ b/src/burn/engine/bundlepackageengine.cpp
@@ -23,6 +23,7 @@ static HRESULT ExecuteBundle(
23 __in BOOTSTRAPPER_ACTION_STATE action, 23 __in BOOTSTRAPPER_ACTION_STATE action,
24 __in BOOTSTRAPPER_RELATION_TYPE relationType, 24 __in BOOTSTRAPPER_RELATION_TYPE relationType,
25 __in BURN_PACKAGE* pPackage, 25 __in BURN_PACKAGE* pPackage,
26 __in_z_opt LPCWSTR wzParent,
26 __in_z_opt LPCWSTR wzIgnoreDependencies, 27 __in_z_opt LPCWSTR wzIgnoreDependencies,
27 __in_z_opt LPCWSTR wzAncestors, 28 __in_z_opt LPCWSTR wzAncestors,
28 __in_z_opt LPCWSTR wzEngineWorkingDirectory, 29 __in_z_opt LPCWSTR wzEngineWorkingDirectory,
@@ -239,7 +240,7 @@ extern "C" void BundlePackageEnginePackageUninitialize(
239 240
240extern "C" HRESULT BundlePackageEngineDetectPackage( 241extern "C" HRESULT BundlePackageEngineDetectPackage(
241 __in BURN_PACKAGE* pPackage, 242 __in BURN_PACKAGE* pPackage,
242 __in BURN_REGISTRATION* /*pRegistration*/, 243 __in BURN_REGISTRATION* pRegistration,
243 __in BURN_USER_EXPERIENCE* pUserExperience 244 __in BURN_USER_EXPERIENCE* pUserExperience
244 ) 245 )
245{ 246{
@@ -291,9 +292,8 @@ extern "C" HRESULT BundlePackageEngineDetectPackage(
291 pPackage->installRegistrationState = BOOTSTRAPPER_PACKAGE_STATE_ABSENT < pPackage->currentState ? BURN_PACKAGE_REGISTRATION_STATE_PRESENT : BURN_PACKAGE_REGISTRATION_STATE_ABSENT; 292 pPackage->installRegistrationState = BOOTSTRAPPER_PACKAGE_STATE_ABSENT < pPackage->currentState ? BURN_PACKAGE_REGISTRATION_STATE_PRESENT : BURN_PACKAGE_REGISTRATION_STATE_ABSENT;
292 } 293 }
293 294
294 // TODO: The bundle is registering itself as a dependent when installed as a chain package, which prevents us from uninstalling it. 295 hr = DependencyDetectChainPackage(pPackage, pRegistration);
295 //hr = DependencyDetectChainPackage(pPackage, pRegistration); 296 ExitOnFailure(hr, "Failed to detect dependencies for BUNDLE package.");
296 //ExitOnFailure(hr, "Failed to detect dependencies for BUNDLE package.");
297 297
298 // TODO: uninstalling compatible Bundles like MsiEngine supports? 298 // TODO: uninstalling compatible Bundles like MsiEngine supports?
299 299
@@ -447,6 +447,9 @@ extern "C" HRESULT BundlePackageEnginePlanAddPackage(
447 pAction->bundlePackage.pPackage = pPackage; 447 pAction->bundlePackage.pPackage = pPackage;
448 pAction->bundlePackage.action = pPackage->rollback; 448 pAction->bundlePackage.action = pPackage->rollback;
449 449
450 hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleId, 0);
451 ExitOnFailure(hr, "Failed to allocate the parent.");
452
450 if (pPackage->Bundle.wzAncestors) 453 if (pPackage->Bundle.wzAncestors)
451 { 454 {
452 hr = StrAllocString(&pAction->bundlePackage.sczAncestors, pPackage->Bundle.wzAncestors, 0); 455 hr = StrAllocString(&pAction->bundlePackage.sczAncestors, pPackage->Bundle.wzAncestors, 0);
@@ -475,6 +478,9 @@ extern "C" HRESULT BundlePackageEnginePlanAddPackage(
475 pAction->bundlePackage.pPackage = pPackage; 478 pAction->bundlePackage.pPackage = pPackage;
476 pAction->bundlePackage.action = pPackage->execute; 479 pAction->bundlePackage.action = pPackage->execute;
477 480
481 hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleId, 0);
482 ExitOnFailure(hr, "Failed to allocate the parent.");
483
478 if (pPackage->Bundle.wzAncestors) 484 if (pPackage->Bundle.wzAncestors)
479 { 485 {
480 hr = StrAllocString(&pAction->bundlePackage.sczAncestors, pPackage->Bundle.wzAncestors, 0); 486 hr = StrAllocString(&pAction->bundlePackage.sczAncestors, pPackage->Bundle.wzAncestors, 0);
@@ -597,13 +603,14 @@ extern "C" HRESULT BundlePackageEngineExecutePackage(
597 ) 603 )
598{ 604{
599 BOOTSTRAPPER_ACTION_STATE action = pExecuteAction->bundlePackage.action; 605 BOOTSTRAPPER_ACTION_STATE action = pExecuteAction->bundlePackage.action;
606 LPCWSTR wzParent = pExecuteAction->bundlePackage.sczParent;
600 LPCWSTR wzIgnoreDependencies = pExecuteAction->bundlePackage.sczIgnoreDependencies; 607 LPCWSTR wzIgnoreDependencies = pExecuteAction->bundlePackage.sczIgnoreDependencies;
601 LPCWSTR wzAncestors = pExecuteAction->bundlePackage.sczAncestors; 608 LPCWSTR wzAncestors = pExecuteAction->bundlePackage.sczAncestors;
602 LPCWSTR wzEngineWorkingDirectory = pExecuteAction->bundlePackage.sczEngineWorkingDirectory; 609 LPCWSTR wzEngineWorkingDirectory = pExecuteAction->bundlePackage.sczEngineWorkingDirectory;
603 BOOTSTRAPPER_RELATION_TYPE relationType = BOOTSTRAPPER_RELATION_CHAIN_PACKAGE; 610 BOOTSTRAPPER_RELATION_TYPE relationType = BOOTSTRAPPER_RELATION_CHAIN_PACKAGE;
604 BURN_PACKAGE* pPackage = pExecuteAction->bundlePackage.pPackage; 611 BURN_PACKAGE* pPackage = pExecuteAction->bundlePackage.pPackage;
605 612
606 return ExecuteBundle(pCache, pVariables, fRollback, pfnGenericMessageHandler, pvContext, action, relationType, pPackage, wzIgnoreDependencies, wzAncestors, wzEngineWorkingDirectory, pRestart); 613 return ExecuteBundle(pCache, pVariables, fRollback, pfnGenericMessageHandler, pvContext, action, relationType, pPackage, wzParent, wzIgnoreDependencies, wzAncestors, wzEngineWorkingDirectory, pRestart);
607} 614}
608 615
609extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle( 616extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle(
@@ -617,6 +624,7 @@ extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle(
617 ) 624 )
618{ 625{
619 BOOTSTRAPPER_ACTION_STATE action = pExecuteAction->relatedBundle.action; 626 BOOTSTRAPPER_ACTION_STATE action = pExecuteAction->relatedBundle.action;
627 LPCWSTR wzParent = NULL;
620 LPCWSTR wzIgnoreDependencies = pExecuteAction->relatedBundle.sczIgnoreDependencies; 628 LPCWSTR wzIgnoreDependencies = pExecuteAction->relatedBundle.sczIgnoreDependencies;
621 LPCWSTR wzAncestors = pExecuteAction->relatedBundle.sczAncestors; 629 LPCWSTR wzAncestors = pExecuteAction->relatedBundle.sczAncestors;
622 LPCWSTR wzEngineWorkingDirectory = pExecuteAction->relatedBundle.sczEngineWorkingDirectory; 630 LPCWSTR wzEngineWorkingDirectory = pExecuteAction->relatedBundle.sczEngineWorkingDirectory;
@@ -624,7 +632,7 @@ extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle(
624 BOOTSTRAPPER_RELATION_TYPE relationType = ConvertRelationType(pRelatedBundle->planRelationType); 632 BOOTSTRAPPER_RELATION_TYPE relationType = ConvertRelationType(pRelatedBundle->planRelationType);
625 BURN_PACKAGE* pPackage = &pRelatedBundle->package; 633 BURN_PACKAGE* pPackage = &pRelatedBundle->package;
626 634
627 return ExecuteBundle(pCache, pVariables, fRollback, pfnGenericMessageHandler, pvContext, action, relationType, pPackage, wzIgnoreDependencies, wzAncestors, wzEngineWorkingDirectory, pRestart); 635 return ExecuteBundle(pCache, pVariables, fRollback, pfnGenericMessageHandler, pvContext, action, relationType, pPackage, wzParent, wzIgnoreDependencies, wzAncestors, wzEngineWorkingDirectory, pRestart);
628} 636}
629 637
630extern "C" void BundlePackageEngineUpdateInstallRegistrationState( 638extern "C" void BundlePackageEngineUpdateInstallRegistrationState(
@@ -721,6 +729,7 @@ static HRESULT ExecuteBundle(
721 __in BOOTSTRAPPER_ACTION_STATE action, 729 __in BOOTSTRAPPER_ACTION_STATE action,
722 __in BOOTSTRAPPER_RELATION_TYPE relationType, 730 __in BOOTSTRAPPER_RELATION_TYPE relationType,
723 __in BURN_PACKAGE* pPackage, 731 __in BURN_PACKAGE* pPackage,
732 __in_z_opt LPCWSTR wzParent,
724 __in_z_opt LPCWSTR wzIgnoreDependencies, 733 __in_z_opt LPCWSTR wzIgnoreDependencies,
725 __in_z_opt LPCWSTR wzAncestors, 734 __in_z_opt LPCWSTR wzAncestors,
726 __in_z_opt LPCWSTR wzEngineWorkingDirectory, 735 __in_z_opt LPCWSTR wzEngineWorkingDirectory,
@@ -848,6 +857,15 @@ static HRESULT ExecuteBundle(
848 ExitOnFailure(hr, "Failed to append relation type argument."); 857 ExitOnFailure(hr, "Failed to append relation type argument.");
849 } 858 }
850 859
860 if (wzParent)
861 {
862 hr = StrAllocConcatFormatted(&sczBaseCommand, L" -%ls", BURN_COMMANDLINE_SWITCH_PARENT);
863 ExitOnFailure(hr, "Failed to append the parent switch to the command line.");
864
865 hr = AppAppendCommandLineArgument(&sczBaseCommand, wzParent);
866 ExitOnFailure(hr, "Failed to append the parent to the command line.");
867 }
868
851 // Add the list of dependencies to ignore, if any, to the burn command line. 869 // Add the list of dependencies to ignore, if any, to the burn command line.
852 if (BOOTSTRAPPER_RELATION_CHAIN_PACKAGE == relationType) 870 if (BOOTSTRAPPER_RELATION_CHAIN_PACKAGE == relationType)
853 { 871 {