diff options
Diffstat (limited to 'src/burn/engine')
-rw-r--r-- | src/burn/engine/bundlepackageengine.cpp | 30 | ||||
-rw-r--r-- | src/burn/engine/elevation.cpp | 8 | ||||
-rw-r--r-- | src/burn/engine/plan.cpp | 7 | ||||
-rw-r--r-- | src/burn/engine/plan.h | 1 |
4 files changed, 39 insertions, 7 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 | ||
240 | extern "C" HRESULT BundlePackageEngineDetectPackage( | 241 | extern "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 | ||
609 | extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle( | 616 | extern "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 | ||
630 | extern "C" void BundlePackageEngineUpdateInstallRegistrationState( | 638 | extern "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 | { |
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index 504ddaea..56a62955 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
@@ -949,6 +949,9 @@ extern "C" HRESULT ElevationExecuteBundlePackage( | |||
949 | hr = BuffWriteNumber(&pbData, &cbData, fRollback); | 949 | hr = BuffWriteNumber(&pbData, &cbData, fRollback); |
950 | ExitOnFailure(hr, "Failed to write rollback."); | 950 | ExitOnFailure(hr, "Failed to write rollback."); |
951 | 951 | ||
952 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->bundlePackage.sczParent); | ||
953 | ExitOnFailure(hr, "Failed to write the parent to the message buffer."); | ||
954 | |||
952 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->bundlePackage.sczIgnoreDependencies); | 955 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->bundlePackage.sczIgnoreDependencies); |
953 | ExitOnFailure(hr, "Failed to write the list of dependencies to ignore to the message buffer."); | 956 | ExitOnFailure(hr, "Failed to write the list of dependencies to ignore to the message buffer."); |
954 | 957 | ||
@@ -2929,7 +2932,7 @@ static HRESULT OnExecuteBundlePackage( | |||
2929 | 2932 | ||
2930 | // Deserialize message data. | 2933 | // Deserialize message data. |
2931 | hr = BuffReadString(pbData, cbData, &iData, &sczPackage); | 2934 | hr = BuffReadString(pbData, cbData, &iData, &sczPackage); |
2932 | ExitOnFailure(hr, "Failed to read EXE package id."); | 2935 | ExitOnFailure(hr, "Failed to read BUNDLE package id."); |
2933 | 2936 | ||
2934 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.bundlePackage.action); | 2937 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.bundlePackage.action); |
2935 | ExitOnFailure(hr, "Failed to read action."); | 2938 | ExitOnFailure(hr, "Failed to read action."); |
@@ -2937,6 +2940,9 @@ static HRESULT OnExecuteBundlePackage( | |||
2937 | hr = BuffReadNumber(pbData, cbData, &iData, &dwRollback); | 2940 | hr = BuffReadNumber(pbData, cbData, &iData, &dwRollback); |
2938 | ExitOnFailure(hr, "Failed to read rollback."); | 2941 | ExitOnFailure(hr, "Failed to read rollback."); |
2939 | 2942 | ||
2943 | hr = BuffReadString(pbData, cbData, &iData, &executeAction.bundlePackage.sczParent); | ||
2944 | ExitOnFailure(hr, "Failed to read the parent."); | ||
2945 | |||
2940 | hr = BuffReadString(pbData, cbData, &iData, &sczIgnoreDependencies); | 2946 | hr = BuffReadString(pbData, cbData, &iData, &sczIgnoreDependencies); |
2941 | ExitOnFailure(hr, "Failed to read the list of dependencies to ignore."); | 2947 | ExitOnFailure(hr, "Failed to read the list of dependencies to ignore."); |
2942 | 2948 | ||
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index 1d008dba..183ac62a 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
@@ -291,6 +291,13 @@ extern "C" void PlanUninitializeExecuteAction( | |||
291 | ReleaseStr(pExecuteAction->relatedBundle.sczEngineWorkingDirectory); | 291 | ReleaseStr(pExecuteAction->relatedBundle.sczEngineWorkingDirectory); |
292 | break; | 292 | break; |
293 | 293 | ||
294 | case BURN_EXECUTE_ACTION_TYPE_BUNDLE_PACKAGE: | ||
295 | ReleaseStr(pExecuteAction->bundlePackage.sczParent); | ||
296 | ReleaseStr(pExecuteAction->bundlePackage.sczIgnoreDependencies); | ||
297 | ReleaseStr(pExecuteAction->bundlePackage.sczAncestors); | ||
298 | ReleaseStr(pExecuteAction->bundlePackage.sczEngineWorkingDirectory); | ||
299 | break; | ||
300 | |||
294 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: | 301 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: |
295 | ReleaseStr(pExecuteAction->exePackage.sczAncestors); | 302 | ReleaseStr(pExecuteAction->exePackage.sczAncestors); |
296 | ReleaseStr(pExecuteAction->exePackage.sczEngineWorkingDirectory); | 303 | ReleaseStr(pExecuteAction->exePackage.sczEngineWorkingDirectory); |
diff --git a/src/burn/engine/plan.h b/src/burn/engine/plan.h index 5b6ee0fb..a8b16705 100644 --- a/src/burn/engine/plan.h +++ b/src/burn/engine/plan.h | |||
@@ -165,6 +165,7 @@ typedef struct _BURN_EXECUTE_ACTION | |||
165 | { | 165 | { |
166 | BURN_PACKAGE* pPackage; | 166 | BURN_PACKAGE* pPackage; |
167 | BOOTSTRAPPER_ACTION_STATE action; | 167 | BOOTSTRAPPER_ACTION_STATE action; |
168 | LPWSTR sczParent; | ||
168 | LPWSTR sczIgnoreDependencies; | 169 | LPWSTR sczIgnoreDependencies; |
169 | LPWSTR sczAncestors; | 170 | LPWSTR sczAncestors; |
170 | LPWSTR sczEngineWorkingDirectory; | 171 | LPWSTR sczEngineWorkingDirectory; |