aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/bundlepackageengine.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-03-13 23:45:32 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-03-14 14:53:29 -0500
commit4cd1c4e06145434ca940ac828772dc47b9d9738e (patch)
treea754d685039173c63303dc6d0d8b1a2bf3ab506b /src/burn/engine/bundlepackageengine.cpp
parent89adb2e3cc232b11b28e5bdeccb0c522c8124a29 (diff)
downloadwix-4cd1c4e06145434ca940ac828772dc47b9d9738e.tar.gz
wix-4cd1c4e06145434ca940ac828772dc47b9d9738e.tar.bz2
wix-4cd1c4e06145434ca940ac828772dc47b9d9738e.zip
Allow the BA to override the bundle relation type during plan.
Diffstat (limited to 'src/burn/engine/bundlepackageengine.cpp')
-rw-r--r--src/burn/engine/bundlepackageengine.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/burn/engine/bundlepackageengine.cpp b/src/burn/engine/bundlepackageengine.cpp
index b5fc51e5..88a00f5e 100644
--- a/src/burn/engine/bundlepackageengine.cpp
+++ b/src/burn/engine/bundlepackageengine.cpp
@@ -2,7 +2,9 @@
2 2
3#include "precomp.h" 3#include "precomp.h"
4 4
5 5static BOOTSTRAPPER_RELATION_TYPE ConvertRelationType(
6 __in BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE relationType
7 );
6 8
7// function definitions 9// function definitions
8 10
@@ -265,7 +267,7 @@ extern "C" HRESULT BundlePackageEngineExecuteRelatedBundle(
265 GENERIC_EXECUTE_MESSAGE message = { }; 267 GENERIC_EXECUTE_MESSAGE message = { };
266 BOOTSTRAPPER_ACTION_STATE action = pExecuteAction->relatedBundle.action; 268 BOOTSTRAPPER_ACTION_STATE action = pExecuteAction->relatedBundle.action;
267 BURN_RELATED_BUNDLE* pRelatedBundle = pExecuteAction->relatedBundle.pRelatedBundle; 269 BURN_RELATED_BUNDLE* pRelatedBundle = pExecuteAction->relatedBundle.pRelatedBundle;
268 BOOTSTRAPPER_RELATION_TYPE relationType = pRelatedBundle->relationType; 270 BOOTSTRAPPER_RELATION_TYPE relationType = ConvertRelationType(pRelatedBundle->planRelationType);
269 BURN_PACKAGE* pPackage = &pRelatedBundle->package; 271 BURN_PACKAGE* pPackage = &pRelatedBundle->package;
270 BURN_PAYLOAD* pPackagePayload = pPackage->payloads.rgItems[0].pPayload; 272 BURN_PAYLOAD* pPackagePayload = pPackage->payloads.rgItems[0].pPayload;
271 LPCWSTR wzRelationTypeCommandLine = CoreRelationTypeToCommandLineString(relationType); 273 LPCWSTR wzRelationTypeCommandLine = CoreRelationTypeToCommandLineString(relationType);
@@ -467,3 +469,26 @@ LExit:
467 469
468 return hr; 470 return hr;
469} 471}
472
473static BOOTSTRAPPER_RELATION_TYPE ConvertRelationType(
474 __in BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE relationType
475 )
476{
477 switch (relationType)
478 {
479 case BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DOWNGRADE: __fallthrough;
480 case BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_UPGRADE:
481 return BOOTSTRAPPER_RELATION_UPGRADE;
482 case BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_ADDON:
483 return BOOTSTRAPPER_RELATION_ADDON;
484 case BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_PATCH:
485 return BOOTSTRAPPER_RELATION_PATCH;
486 case BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DEPENDENT_ADDON:
487 return BOOTSTRAPPER_RELATION_DEPENDENT_ADDON;
488 case BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_DEPENDENT_PATCH:
489 return BOOTSTRAPPER_RELATION_DEPENDENT_PATCH;
490 default:
491 AssertSz(BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_NONE == relationType, "Unknown BUNDLE_RELATION_TYPE");
492 return BOOTSTRAPPER_RELATION_NONE;
493 }
494}