diff options
Diffstat (limited to 'src/burn/engine/bundlepackageengine.cpp')
-rw-r--r-- | src/burn/engine/bundlepackageengine.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/src/burn/engine/bundlepackageengine.cpp b/src/burn/engine/bundlepackageengine.cpp index 00cf9454..97861436 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 BOOL fPseudoPackage, | ||
26 | __in_z_opt LPCWSTR wzParent, | 27 | __in_z_opt LPCWSTR wzParent, |
27 | __in_z_opt LPCWSTR wzIgnoreDependencies, | 28 | __in_z_opt LPCWSTR wzIgnoreDependencies, |
28 | __in_z_opt LPCWSTR wzAncestors, | 29 | __in_z_opt LPCWSTR wzAncestors, |
@@ -614,7 +615,7 @@ extern "C" HRESULT BundlePackageEngineExecutePackage( | |||
614 | BOOTSTRAPPER_RELATION_TYPE relationType = BOOTSTRAPPER_RELATION_CHAIN_PACKAGE; | 615 | BOOTSTRAPPER_RELATION_TYPE relationType = BOOTSTRAPPER_RELATION_CHAIN_PACKAGE; |
615 | BURN_PACKAGE* pPackage = pExecuteAction->bundlePackage.pPackage; | 616 | BURN_PACKAGE* pPackage = pExecuteAction->bundlePackage.pPackage; |
616 | 617 | ||
617 | return ExecuteBundle(pCache, pVariables, fRollback, pfnGenericMessageHandler, pvContext, action, relationType, pPackage, wzParent, wzIgnoreDependencies, wzAncestors, wzEngineWorkingDirectory, pRestart); | 618 | return ExecuteBundle(pCache, pVariables, fRollback, pfnGenericMessageHandler, pvContext, action, relationType, pPackage, FALSE, wzParent, wzIgnoreDependencies, wzAncestors, wzEngineWorkingDirectory, pRestart); |
618 | } | 619 | } |
619 | 620 | ||
620 | extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle( | 621 | extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle( |
@@ -636,7 +637,7 @@ extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle( | |||
636 | BOOTSTRAPPER_RELATION_TYPE relationType = ConvertRelationType(pRelatedBundle->planRelationType); | 637 | BOOTSTRAPPER_RELATION_TYPE relationType = ConvertRelationType(pRelatedBundle->planRelationType); |
637 | BURN_PACKAGE* pPackage = &pRelatedBundle->package; | 638 | BURN_PACKAGE* pPackage = &pRelatedBundle->package; |
638 | 639 | ||
639 | return ExecuteBundle(pCache, pVariables, fRollback, pfnGenericMessageHandler, pvContext, action, relationType, pPackage, wzParent, wzIgnoreDependencies, wzAncestors, wzEngineWorkingDirectory, pRestart); | 640 | return ExecuteBundle(pCache, pVariables, fRollback, pfnGenericMessageHandler, pvContext, action, relationType, pPackage, TRUE, wzParent, wzIgnoreDependencies, wzAncestors, wzEngineWorkingDirectory, pRestart); |
640 | } | 641 | } |
641 | 642 | ||
642 | extern "C" void BundlePackageEngineUpdateInstallRegistrationState( | 643 | extern "C" void BundlePackageEngineUpdateInstallRegistrationState( |
@@ -733,6 +734,7 @@ static HRESULT ExecuteBundle( | |||
733 | __in BOOTSTRAPPER_ACTION_STATE action, | 734 | __in BOOTSTRAPPER_ACTION_STATE action, |
734 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 735 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
735 | __in BURN_PACKAGE* pPackage, | 736 | __in BURN_PACKAGE* pPackage, |
737 | __in BOOL fPseudoPackage, | ||
736 | __in_z_opt LPCWSTR wzParent, | 738 | __in_z_opt LPCWSTR wzParent, |
737 | __in_z_opt LPCWSTR wzIgnoreDependencies, | 739 | __in_z_opt LPCWSTR wzIgnoreDependencies, |
738 | __in_z_opt LPCWSTR wzAncestors, | 740 | __in_z_opt LPCWSTR wzAncestors, |
@@ -759,17 +761,33 @@ static HRESULT ExecuteBundle( | |||
759 | LPCWSTR wzOperationCommandLine = NULL; | 761 | LPCWSTR wzOperationCommandLine = NULL; |
760 | BOOL fRunEmbedded = pPackage->Bundle.fSupportsBurnProtocol; | 762 | BOOL fRunEmbedded = pPackage->Bundle.fSupportsBurnProtocol; |
761 | 763 | ||
762 | // get cached executable path | 764 | if (fPseudoPackage) |
763 | hr = CacheGetCompletedPath(pCache, pPackage->fPerMachine, pPackage->sczCacheId, &sczCachedDirectory); | 765 | { |
764 | ExitOnFailure(hr, "Failed to get cached path for package: %ls", pPackage->sczId); | 766 | if (!PathIsFullyQualified(pPackagePayload->sczFilePath, NULL)) |
767 | { | ||
768 | ExitWithRootFailure(hr, E_INVALIDSTATE, "Related bundles must have a fully qualified target path."); | ||
769 | } | ||
770 | |||
771 | hr = StrAllocString(&sczExecutablePath, pPackagePayload->sczFilePath, 0); | ||
772 | ExitOnFailure(hr, "Failed to build executable path."); | ||
773 | |||
774 | hr = PathGetDirectory(sczExecutablePath, &sczCachedDirectory); | ||
775 | ExitOnFailure(hr, "Failed to get cached path for related bundle: %ls", pPackage->sczId); | ||
776 | } | ||
777 | else | ||
778 | { | ||
779 | // get cached executable path | ||
780 | hr = CacheGetCompletedPath(pCache, pPackage->fPerMachine, pPackage->sczCacheId, &sczCachedDirectory); | ||
781 | ExitOnFailure(hr, "Failed to get cached path for package: %ls", pPackage->sczId); | ||
782 | |||
783 | hr = PathConcatRelativeToBase(sczCachedDirectory, pPackagePayload->sczFilePath, &sczExecutablePath); | ||
784 | ExitOnFailure(hr, "Failed to build executable path."); | ||
785 | } | ||
765 | 786 | ||
766 | // Best effort to set the execute package cache folder and action variables. | 787 | // Best effort to set the execute package cache folder and action variables. |
767 | VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, sczCachedDirectory, TRUE, FALSE); | 788 | VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, sczCachedDirectory, TRUE, FALSE); |
768 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, action, TRUE); | 789 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, action, TRUE); |
769 | 790 | ||
770 | hr = PathConcat(sczCachedDirectory, pPackagePayload->sczFilePath, &sczExecutablePath); | ||
771 | ExitOnFailure(hr, "Failed to build executable path."); | ||
772 | |||
773 | // pick arguments | 791 | // pick arguments |
774 | switch (action) | 792 | switch (action) |
775 | { | 793 | { |