diff options
| author | Bob Arnson <bob@firegiant.com> | 2026-02-04 20:47:04 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2026-02-04 20:47:04 -0500 |
| commit | edccb203c421d2bd820062024088c6698424d9ee (patch) | |
| tree | 6b47c3eb5ca53bd9f79f3d032dc1a596d411bf38 /src/burn/engine/plan.cpp | |
| parent | a3d3963f806117ce123d95e8b77e73e1c1545b25 (diff) | |
| download | wix-bob/ConfigurableScopeBundles.tar.gz wix-bob/ConfigurableScopeBundles.tar.bz2 wix-bob/ConfigurableScopeBundles.zip | |
Support dual-purpose packages in Burn.bob/ConfigurableScopeBundles
Fixes https://github.com/wixtoolset/issues/issues/8958
Diffstat (limited to 'src/burn/engine/plan.cpp')
| -rw-r--r-- | src/burn/engine/plan.cpp | 73 |
1 files changed, 71 insertions, 2 deletions
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index edc09033..6c46269b 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
| @@ -278,7 +278,7 @@ extern "C" void PlanReset( | |||
| 278 | } | 278 | } |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | PlanSetVariables(BOOTSTRAPPER_ACTION_UNKNOWN, pVariables); | 281 | PlanSetVariables(BOOTSTRAPPER_ACTION_UNKNOWN, BOOTSTRAPPER_PACKAGE_SCOPE_INVALID, BOOTSTRAPPER_SCOPE_DEFAULT, pVariables); |
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | extern "C" void PlanUninitializeExecuteAction( | 284 | extern "C" void PlanUninitializeExecuteAction( |
| @@ -332,6 +332,8 @@ extern "C" void PlanUninitializeExecuteAction( | |||
| 332 | 332 | ||
| 333 | extern "C" HRESULT PlanSetVariables( | 333 | extern "C" HRESULT PlanSetVariables( |
| 334 | __in BOOTSTRAPPER_ACTION action, | 334 | __in BOOTSTRAPPER_ACTION action, |
| 335 | __in BOOTSTRAPPER_PACKAGE_SCOPE authoredScope, | ||
| 336 | __in BOOTSTRAPPER_SCOPE plannedScope, | ||
| 335 | __in BURN_VARIABLES* pVariables | 337 | __in BURN_VARIABLES* pVariables |
| 336 | ) | 338 | ) |
| 337 | { | 339 | { |
| @@ -340,6 +342,12 @@ extern "C" HRESULT PlanSetVariables( | |||
| 340 | hr = VariableSetNumeric(pVariables, BURN_BUNDLE_ACTION, action, TRUE); | 342 | hr = VariableSetNumeric(pVariables, BURN_BUNDLE_ACTION, action, TRUE); |
| 341 | ExitOnFailure(hr, "Failed to set the bundle action built-in variable."); | 343 | ExitOnFailure(hr, "Failed to set the bundle action built-in variable."); |
| 342 | 344 | ||
| 345 | hr = VariableSetNumeric(pVariables, BURN_BUNDLE_SCOPE, authoredScope, TRUE); | ||
| 346 | ExitOnFailure(hr, "Failed to set the bundle authored scope built-in variable."); | ||
| 347 | |||
| 348 | hr = VariableSetNumeric(pVariables, BURN_BUNDLE_PLANNED_SCOPE, plannedScope, TRUE); | ||
| 349 | ExitOnFailure(hr, "Failed to set the bundle planned scope built-in variable."); | ||
| 350 | |||
| 343 | LExit: | 351 | LExit: |
| 344 | return hr; | 352 | return hr; |
| 345 | } | 353 | } |
| @@ -812,6 +820,66 @@ LExit: | |||
| 812 | return hr; | 820 | return hr; |
| 813 | } | 821 | } |
| 814 | 822 | ||
| 823 | extern "C" HRESULT PlanPackagesAndBundleScope( | ||
| 824 | __in BURN_PACKAGE* rgPackages, | ||
| 825 | __in DWORD cPackages, | ||
| 826 | __in BOOTSTRAPPER_SCOPE scope, | ||
| 827 | __in BOOTSTRAPPER_PACKAGE_SCOPE authoredScope, | ||
| 828 | __in BOOTSTRAPPER_SCOPE commandLineScope, | ||
| 829 | __out BOOTSTRAPPER_SCOPE* pResultingScope, | ||
| 830 | __out BOOL* pfRegistrationPerMachine | ||
| 831 | ) | ||
| 832 | { | ||
| 833 | HRESULT hr = S_OK; | ||
| 834 | BOOL fRegistrationPerMachine = TRUE; | ||
| 835 | |||
| 836 | // If a scope was specified on the command line and the BA didn't set a scope, | ||
| 837 | // let the command-line switch override. | ||
| 838 | if (BOOTSTRAPPER_SCOPE_DEFAULT != commandLineScope) | ||
| 839 | { | ||
| 840 | if (BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE_OR_PER_USER == authoredScope || BOOTSTRAPPER_PACKAGE_SCOPE_PER_USER_OR_PER_MACHINE == authoredScope) | ||
| 841 | { | ||
| 842 | if (BOOTSTRAPPER_SCOPE_DEFAULT == scope) | ||
| 843 | { | ||
| 844 | scope = commandLineScope; | ||
| 845 | } | ||
| 846 | else | ||
| 847 | { | ||
| 848 | LogId(REPORT_STANDARD, MSG_SCOPE_IGNORED_BA_SCOPE); | ||
| 849 | } | ||
| 850 | } | ||
| 851 | else | ||
| 852 | { | ||
| 853 | LogId(REPORT_STANDARD, MSG_SCOPE_IGNORED_UNCONFIGURABLE); | ||
| 854 | } | ||
| 855 | } | ||
| 856 | |||
| 857 | for (DWORD i = 0; i < cPackages; ++i) | ||
| 858 | { | ||
| 859 | BURN_PACKAGE* pPackage = rgPackages + i; | ||
| 860 | |||
| 861 | pPackage->fPerMachine = | ||
| 862 | (BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE == pPackage->scope) | ||
| 863 | || (BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE_OR_PER_USER == pPackage->scope && | ||
| 864 | (BOOTSTRAPPER_SCOPE_DEFAULT == scope || BOOTSTRAPPER_SCOPE_PER_MACHINE == scope)) | ||
| 865 | || (BOOTSTRAPPER_PACKAGE_SCOPE_PER_USER_OR_PER_MACHINE == pPackage->scope && | ||
| 866 | BOOTSTRAPPER_SCOPE_PER_MACHINE == scope); | ||
| 867 | |||
| 868 | // Any per-user package makes the registration per-user as well. | ||
| 869 | if (!pPackage->fPerMachine) | ||
| 870 | { | ||
| 871 | fRegistrationPerMachine = FALSE; | ||
| 872 | } | ||
| 873 | } | ||
| 874 | |||
| 875 | *pResultingScope = scope; | ||
| 876 | *pfRegistrationPerMachine = fRegistrationPerMachine; | ||
| 877 | |||
| 878 | //LExit: | ||
| 879 | return hr; | ||
| 880 | } | ||
| 881 | |||
| 882 | |||
| 815 | static HRESULT PlanPackagesHelper( | 883 | static HRESULT PlanPackagesHelper( |
| 816 | __in BURN_PACKAGE* rgPackages, | 884 | __in BURN_PACKAGE* rgPackages, |
| 817 | __in DWORD cPackages, | 885 | __in DWORD cPackages, |
| @@ -2971,7 +3039,7 @@ static void ExecuteActionLog( | |||
| 2971 | break; | 3039 | break; |
| 2972 | 3040 | ||
| 2973 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: | 3041 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: |
| 2974 | LogStringLine(PlanDumpLevel, "%ls action[%u]: MSI_PACKAGE package id: %ls, action: %hs, action msi property: %ls, ui level: %u, disable externaluihandler: %hs, file versioning: %hs, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pAction->msiPackage.action), LoggingBurnMsiPropertyToString(pAction->msiPackage.actionMsiProperty), pAction->msiPackage.uiLevel, LoggingBoolToString(pAction->msiPackage.fDisableExternalUiHandler), LoggingMsiFileVersioningToString(pAction->msiPackage.fileVersioning), pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes); | 3042 | LogStringLine(PlanDumpLevel, "%ls action[%u]: MSI_PACKAGE package id: %ls, scope: %hs, action: %hs, action msi property: %ls, ui level: %u, disable externaluihandler: %hs, file versioning: %hs, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingPackageScopeToString(pAction->msiPackage.pPackage->scope), LoggingActionStateToString(pAction->msiPackage.action), LoggingBurnMsiPropertyToString(pAction->msiPackage.actionMsiProperty), pAction->msiPackage.uiLevel, LoggingBoolToString(pAction->msiPackage.fDisableExternalUiHandler), LoggingMsiFileVersioningToString(pAction->msiPackage.fileVersioning), pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes); |
| 2975 | for (DWORD j = 0; j < pAction->msiPackage.pPackage->Msi.cSlipstreamMspPackages; ++j) | 3043 | for (DWORD j = 0; j < pAction->msiPackage.pPackage->Msi.cSlipstreamMspPackages; ++j) |
| 2976 | { | 3044 | { |
| 2977 | const BURN_SLIPSTREAM_MSP* pSlipstreamMsp = pAction->msiPackage.pPackage->Msi.rgSlipstreamMsps + j; | 3045 | const BURN_SLIPSTREAM_MSP* pSlipstreamMsp = pAction->msiPackage.pPackage->Msi.rgSlipstreamMsps + j; |
| @@ -3083,6 +3151,7 @@ extern "C" void PlanDump( | |||
| 3083 | LogStringLine(PlanDumpLevel, " bundle code: %ls", pPlan->wzBundleCode); | 3151 | LogStringLine(PlanDumpLevel, " bundle code: %ls", pPlan->wzBundleCode); |
| 3084 | LogStringLine(PlanDumpLevel, " bundle provider key: %ls", pPlan->wzBundleProviderKey); | 3152 | LogStringLine(PlanDumpLevel, " bundle provider key: %ls", pPlan->wzBundleProviderKey); |
| 3085 | LogStringLine(PlanDumpLevel, " use-forward-compatible: %hs", LoggingTrueFalseToString(pPlan->fEnabledForwardCompatibleBundle)); | 3153 | LogStringLine(PlanDumpLevel, " use-forward-compatible: %hs", LoggingTrueFalseToString(pPlan->fEnabledForwardCompatibleBundle)); |
| 3154 | LogStringLine(PlanDumpLevel, " planned scope: %hs", LoggingBundleScopeToString(pPlan->plannedScope)); | ||
| 3086 | LogStringLine(PlanDumpLevel, " per-machine: %hs", LoggingTrueFalseToString(pPlan->fPerMachine)); | 3155 | LogStringLine(PlanDumpLevel, " per-machine: %hs", LoggingTrueFalseToString(pPlan->fPerMachine)); |
| 3087 | LogStringLine(PlanDumpLevel, " can affect machine state: %hs", LoggingTrueFalseToString(pPlan->fCanAffectMachineState)); | 3156 | LogStringLine(PlanDumpLevel, " can affect machine state: %hs", LoggingTrueFalseToString(pPlan->fCanAffectMachineState)); |
| 3088 | LogStringLine(PlanDumpLevel, " disable-rollback: %hs", LoggingTrueFalseToString(pPlan->fDisableRollback)); | 3157 | LogStringLine(PlanDumpLevel, " disable-rollback: %hs", LoggingTrueFalseToString(pPlan->fDisableRollback)); |
