diff options
| author | Bob Arnson <bob@firegiant.com> | 2026-02-20 19:18:23 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2026-02-20 19:18:23 -0500 |
| commit | 8f3c366e9671dc5d4931dd3de28a42a1f1be32a5 (patch) | |
| tree | b9f270a14fe73dc07667cf37ea0232662e7d858b /src/ext/Bal/stdbas | |
| parent | 96222b03ccc510027cb4d506fb424961cc351e03 (diff) | |
| download | wix-bob/WixStdBaConfigurableScope.tar.gz wix-bob/WixStdBaConfigurableScope.tar.bz2 wix-bob/WixStdBaConfigurableScope.zip | |
Configurable-scope bundles for WixStdBA.bob/WixStdBaConfigurableScope
Fixes https://github.com/wixtoolset/issues/issues/9234
Fixes https://github.com/wixtoolset/issues/issues/9235
Diffstat (limited to 'src/ext/Bal/stdbas')
8 files changed, 68 insertions, 2 deletions
diff --git a/src/ext/Bal/stdbas/Resources/HyperlinkLargeTheme.xml b/src/ext/Bal/stdbas/Resources/HyperlinkLargeTheme.xml index 6e7b69ee..dcc1a7c1 100644 --- a/src/ext/Bal/stdbas/Resources/HyperlinkLargeTheme.xml +++ b/src/ext/Bal/stdbas/Resources/HyperlinkLargeTheme.xml | |||
| @@ -51,6 +51,10 @@ | |||
| 51 | <Text>#(loc.OptionsBrowseButton)</Text> | 51 | <Text>#(loc.OptionsBrowseButton)</Text> |
| 52 | <BrowseDirectoryAction VariableName="InstallFolder" /> | 52 | <BrowseDirectoryAction VariableName="InstallFolder" /> |
| 53 | </Button> | 53 | </Button> |
| 54 | <RadioButtons Name="WixStdBAScope"> | ||
| 55 | <RadioButton X="11" Y="180" Height="20" Width="-11" Value="PerUser" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerUserScopeText)</RadioButton> | ||
| 56 | <RadioButton X="11" Y="200" Height="20" Width="-11" Value="PerMachine" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerMachineScopeText)</RadioButton> | ||
| 57 | </RadioButtons> | ||
| 54 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> | 58 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> |
| 55 | <Text>#(loc.OptionsOkButton)</Text> | 59 | <Text>#(loc.OptionsOkButton)</Text> |
| 56 | <ChangePageAction Page="Install" /> | 60 | <ChangePageAction Page="Install" /> |
diff --git a/src/ext/Bal/stdbas/Resources/HyperlinkSidebarTheme.xml b/src/ext/Bal/stdbas/Resources/HyperlinkSidebarTheme.xml index 59a03ad0..11eac2de 100644 --- a/src/ext/Bal/stdbas/Resources/HyperlinkSidebarTheme.xml +++ b/src/ext/Bal/stdbas/Resources/HyperlinkSidebarTheme.xml | |||
| @@ -54,6 +54,10 @@ | |||
| 54 | <Text>#(loc.OptionsBrowseButton)</Text> | 54 | <Text>#(loc.OptionsBrowseButton)</Text> |
| 55 | <BrowseDirectoryAction VariableName="InstallFolder" /> | 55 | <BrowseDirectoryAction VariableName="InstallFolder" /> |
| 56 | </Button> | 56 | </Button> |
| 57 | <RadioButtons Name="WixStdBAScope"> | ||
| 58 | <RadioButton X="11" Y="180" Height="20" Width="-11" Value="PerUser" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerUserScopeText)</RadioButton> | ||
| 59 | <RadioButton X="11" Y="200" Height="20" Width="-11" Value="PerMachine" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerMachineScopeText)</RadioButton> | ||
| 60 | </RadioButtons> | ||
| 57 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> | 61 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> |
| 58 | <Text>#(loc.OptionsOkButton)</Text> | 62 | <Text>#(loc.OptionsOkButton)</Text> |
| 59 | <ChangePageAction Page="Install" /> | 63 | <ChangePageAction Page="Install" /> |
diff --git a/src/ext/Bal/stdbas/Resources/HyperlinkTheme.wxl b/src/ext/Bal/stdbas/Resources/HyperlinkTheme.wxl index 24e7b728..0a0664dc 100644 --- a/src/ext/Bal/stdbas/Resources/HyperlinkTheme.wxl +++ b/src/ext/Bal/stdbas/Resources/HyperlinkTheme.wxl | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | <String Id="InstallCancelButton" Value="&Cancel" /> | 22 | <String Id="InstallCancelButton" Value="&Cancel" /> |
| 23 | <String Id="OptionsHeader" Value="Setup Options" /> | 23 | <String Id="OptionsHeader" Value="Setup Options" /> |
| 24 | <String Id="OptionsLocationLabel" Value="Install location:" /> | 24 | <String Id="OptionsLocationLabel" Value="Install location:" /> |
| 25 | <String Id="OptionsPerUserScopeText" Value="Install [WixBundleName] just for &me" /> | ||
| 26 | <String Id="OptionsPerMachineScopeText" Value="Install [WixBundleName] for all &users" /> | ||
| 25 | <String Id="OptionsBrowseButton" Value="&Browse" /> | 27 | <String Id="OptionsBrowseButton" Value="&Browse" /> |
| 26 | <String Id="OptionsOkButton" Value="&OK" /> | 28 | <String Id="OptionsOkButton" Value="&OK" /> |
| 27 | <String Id="OptionsCancelButton" Value="&Cancel" /> | 29 | <String Id="OptionsCancelButton" Value="&Cancel" /> |
diff --git a/src/ext/Bal/stdbas/Resources/HyperlinkTheme.xml b/src/ext/Bal/stdbas/Resources/HyperlinkTheme.xml index c82e1b9f..2d33344e 100644 --- a/src/ext/Bal/stdbas/Resources/HyperlinkTheme.xml +++ b/src/ext/Bal/stdbas/Resources/HyperlinkTheme.xml | |||
| @@ -45,6 +45,10 @@ | |||
| 45 | <Text>#(loc.OptionsBrowseButton)</Text> | 45 | <Text>#(loc.OptionsBrowseButton)</Text> |
| 46 | <BrowseDirectoryAction VariableName="InstallFolder" /> | 46 | <BrowseDirectoryAction VariableName="InstallFolder" /> |
| 47 | </Button> | 47 | </Button> |
| 48 | <RadioButtons Name="WixStdBAScope"> | ||
| 49 | <RadioButton X="11" Y="180" Height="20" Width="-11" Value="PerUser" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerUserScopeText)</RadioButton> | ||
| 50 | <RadioButton X="11" Y="200" Height="20" Width="-11" Value="PerMachine" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerMachineScopeText)</RadioButton> | ||
| 51 | </RadioButtons> | ||
| 48 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> | 52 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> |
| 49 | <Text>#(loc.OptionsOkButton)</Text> | 53 | <Text>#(loc.OptionsOkButton)</Text> |
| 50 | <ChangePageAction Page="Install" /> | 54 | <ChangePageAction Page="Install" /> |
diff --git a/src/ext/Bal/stdbas/Resources/RtfLargeTheme.xml b/src/ext/Bal/stdbas/Resources/RtfLargeTheme.xml index b30fe3cd..a41e4457 100644 --- a/src/ext/Bal/stdbas/Resources/RtfLargeTheme.xml +++ b/src/ext/Bal/stdbas/Resources/RtfLargeTheme.xml | |||
| @@ -47,6 +47,10 @@ | |||
| 47 | <Text>#(loc.OptionsBrowseButton)</Text> | 47 | <Text>#(loc.OptionsBrowseButton)</Text> |
| 48 | <BrowseDirectoryAction VariableName="InstallFolder" /> | 48 | <BrowseDirectoryAction VariableName="InstallFolder" /> |
| 49 | </Button> | 49 | </Button> |
| 50 | <RadioButtons Name="WixStdBAScope"> | ||
| 51 | <RadioButton X="11" Y="180" Height="20" Width="-11" Value="PerUser" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerUserScopeText)</RadioButton> | ||
| 52 | <RadioButton X="11" Y="200" Height="20" Width="-11" Value="PerMachine" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerMachineScopeText)</RadioButton> | ||
| 53 | </RadioButtons> | ||
| 50 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> | 54 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> |
| 51 | <Text>#(loc.OptionsOkButton)</Text> | 55 | <Text>#(loc.OptionsOkButton)</Text> |
| 52 | <ChangePageAction Page="Install" /> | 56 | <ChangePageAction Page="Install" /> |
diff --git a/src/ext/Bal/stdbas/Resources/RtfTheme.wxl b/src/ext/Bal/stdbas/Resources/RtfTheme.wxl index a827d1a9..9969f1f2 100644 --- a/src/ext/Bal/stdbas/Resources/RtfTheme.wxl +++ b/src/ext/Bal/stdbas/Resources/RtfTheme.wxl | |||
| @@ -18,6 +18,8 @@ | |||
| 18 | <String Id="InstallCancelButton" Value="&Cancel" /> | 18 | <String Id="InstallCancelButton" Value="&Cancel" /> |
| 19 | <String Id="OptionsHeader" Value="Setup Options" /> | 19 | <String Id="OptionsHeader" Value="Setup Options" /> |
| 20 | <String Id="OptionsLocationLabel" Value="Install location:" /> | 20 | <String Id="OptionsLocationLabel" Value="Install location:" /> |
| 21 | <String Id="OptionsPerUserScopeText" Value="Install [WixBundleName] just for &me" /> | ||
| 22 | <String Id="OptionsPerMachineScopeText" Value="Install [WixBundleName] for all &users" /> | ||
| 21 | <String Id="OptionsBrowseButton" Value="&Browse" /> | 23 | <String Id="OptionsBrowseButton" Value="&Browse" /> |
| 22 | <String Id="OptionsOkButton" Value="&OK" /> | 24 | <String Id="OptionsOkButton" Value="&OK" /> |
| 23 | <String Id="OptionsCancelButton" Value="&Cancel" /> | 25 | <String Id="OptionsCancelButton" Value="&Cancel" /> |
diff --git a/src/ext/Bal/stdbas/Resources/RtfTheme.xml b/src/ext/Bal/stdbas/Resources/RtfTheme.xml index e1a486c8..1f1c3810 100644 --- a/src/ext/Bal/stdbas/Resources/RtfTheme.xml +++ b/src/ext/Bal/stdbas/Resources/RtfTheme.xml | |||
| @@ -45,6 +45,10 @@ | |||
| 45 | <Text>#(loc.OptionsBrowseButton)</Text> | 45 | <Text>#(loc.OptionsBrowseButton)</Text> |
| 46 | <BrowseDirectoryAction VariableName="InstallFolder" /> | 46 | <BrowseDirectoryAction VariableName="InstallFolder" /> |
| 47 | </Button> | 47 | </Button> |
| 48 | <RadioButtons Name="WixStdBAScope"> | ||
| 49 | <RadioButton X="11" Y="180" Height="20" Width="-11" Value="PerUser" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerUserScopeText)</RadioButton> | ||
| 50 | <RadioButton X="11" Y="200" Height="20" Width="-11" Value="PerMachine" EnableCondition="WixBundleAuthoredScope = 2 OR WixBundleAuthoredScope = 3" HideWhenDisabled="yes" FontId="3">#(loc.OptionsPerMachineScopeText)</RadioButton> | ||
| 51 | </RadioButtons> | ||
| 48 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> | 52 | <Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0"> |
| 49 | <Text>#(loc.OptionsOkButton)</Text> | 53 | <Text>#(loc.OptionsOkButton)</Text> |
| 50 | <ChangePageAction Page="Install" /> | 54 | <ChangePageAction Page="Install" /> |
diff --git a/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp index 74c6b4db..e0b03f98 100644 --- a/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/stdbas/WixStandardBootstrapperApplication.cpp | |||
| @@ -23,6 +23,9 @@ static const LPCWSTR WIXSTDBA_VARIABLE_SHOW_VERSION = L"WixStdBAShowVersion"; | |||
| 23 | static const LPCWSTR WIXSTDBA_VARIABLE_SUPPRESS_OPTIONS_UI = L"WixStdBASuppressOptionsUI"; | 23 | static const LPCWSTR WIXSTDBA_VARIABLE_SUPPRESS_OPTIONS_UI = L"WixStdBASuppressOptionsUI"; |
| 24 | static const LPCWSTR WIXSTDBA_VARIABLE_UPDATE_AVAILABLE = L"WixStdBAUpdateAvailable"; | 24 | static const LPCWSTR WIXSTDBA_VARIABLE_UPDATE_AVAILABLE = L"WixStdBAUpdateAvailable"; |
| 25 | 25 | ||
| 26 | static const LPCWSTR WIXSTDBA_PER_USER_SCOPE = L"PerUser"; | ||
| 27 | static const LPCWSTR WIXSTDBA_PER_MACHINE_SCOPE = L"PerMachine";; | ||
| 28 | |||
| 26 | enum WIXSTDBA_STATE | 29 | enum WIXSTDBA_STATE |
| 27 | { | 30 | { |
| 28 | WIXSTDBA_STATE_INITIALIZING, | 31 | WIXSTDBA_STATE_INITIALIZING, |
| @@ -186,6 +189,7 @@ public: // IBootstrapperApplication | |||
| 186 | ) | 189 | ) |
| 187 | { | 190 | { |
| 188 | HRESULT hr = S_OK; | 191 | HRESULT hr = S_OK; |
| 192 | LONGLONG llScope = 0; | ||
| 189 | 193 | ||
| 190 | hr = __super::OnCreate(pEngine, pCommand); | 194 | hr = __super::OnCreate(pEngine, pCommand); |
| 191 | BalExitOnFailure(hr, "CBootstrapperApplicationBase initialization failed."); | 195 | BalExitOnFailure(hr, "CBootstrapperApplicationBase initialization failed."); |
| @@ -197,7 +201,12 @@ public: // IBootstrapperApplication | |||
| 197 | m_hwndSplashScreen = pCommand->hwndSplashScreen; | 201 | m_hwndSplashScreen = pCommand->hwndSplashScreen; |
| 198 | 202 | ||
| 199 | hr = BalGetStringVariable(L"WixBundleVersion", &m_sczBundleVersion); | 203 | hr = BalGetStringVariable(L"WixBundleVersion", &m_sczBundleVersion); |
| 200 | BalExitOnFailure(hr, "CWixStandardBootstrapperApplication initialization failed."); | 204 | BalExitOnFailure(hr, "Failed to get WixBundleVersion."); |
| 205 | |||
| 206 | hr = BalGetNumericVariable(L"WixBundleAuthoredScope", &llScope); | ||
| 207 | BalExitOnFailure(hr, "Failed to get WixBundleAuthoredScope."); | ||
| 208 | |||
| 209 | m_bundleScope = static_cast<BOOTSTRAPPER_PACKAGE_SCOPE>(llScope); | ||
| 201 | 210 | ||
| 202 | hr = InitializeData(pCommand); | 211 | hr = InitializeData(pCommand); |
| 203 | BalExitOnFailure(hr, "Failed to initialize data in bootstrapper application."); | 212 | BalExitOnFailure(hr, "Failed to initialize data in bootstrapper application."); |
| @@ -2888,6 +2897,18 @@ private: | |||
| 2888 | } | 2897 | } |
| 2889 | } | 2898 | } |
| 2890 | 2899 | ||
| 2900 | // Set the variable matching the default theme scope-selection radio buttons | ||
| 2901 | // so the default scope is already selected. | ||
| 2902 | if (BOOTSTRAPPER_PACKAGE_SCOPE_PER_USER_OR_PER_MACHINE == m_bundleScope) | ||
| 2903 | { | ||
| 2904 | hr = BalSetStringVariable(L"WixStdBAScope", WIXSTDBA_PER_USER_SCOPE, FALSE); | ||
| 2905 | } | ||
| 2906 | else if (BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE_OR_PER_USER == m_bundleScope) | ||
| 2907 | { | ||
| 2908 | hr = BalSetStringVariable(L"WixStdBAScope", WIXSTDBA_PER_MACHINE_SCOPE, FALSE); | ||
| 2909 | } | ||
| 2910 | BalExitOnFailure(hr, "Failed to set WixStdBAScope."); | ||
| 2911 | |||
| 2891 | LExit: | 2912 | LExit: |
| 2892 | ReleaseObject(pixdManifest); | 2913 | ReleaseObject(pixdManifest); |
| 2893 | 2914 | ||
| @@ -3819,15 +3840,35 @@ private: | |||
| 3819 | ) | 3840 | ) |
| 3820 | { | 3841 | { |
| 3821 | HRESULT hr = S_OK; | 3842 | HRESULT hr = S_OK; |
| 3843 | BOOTSTRAPPER_SCOPE scope = BOOTSTRAPPER_SCOPE_DEFAULT; | ||
| 3844 | LPWSTR sczScopeValue = NULL; | ||
| 3822 | 3845 | ||
| 3823 | m_plannedAction = action; | 3846 | m_plannedAction = action; |
| 3824 | 3847 | ||
| 3848 | if (BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE_OR_PER_USER == m_bundleScope | ||
| 3849 | || BOOTSTRAPPER_PACKAGE_SCOPE_PER_USER_OR_PER_MACHINE == m_bundleScope) | ||
| 3850 | { | ||
| 3851 | hr = BalGetStringVariable(L"WixStdBAScope", &sczScopeValue); | ||
| 3852 | BalExitOnFailure(hr, "Failed to get scope value."); | ||
| 3853 | |||
| 3854 | if (CSTR_EQUAL == ::CompareStringOrdinal(sczScopeValue, -1, L"PerUser", -1, TRUE)) | ||
| 3855 | { | ||
| 3856 | scope = BOOTSTRAPPER_SCOPE_PER_USER; | ||
| 3857 | } | ||
| 3858 | else if (CSTR_EQUAL == ::CompareStringOrdinal(sczScopeValue, -1, L"PerMachine", -1, TRUE)) | ||
| 3859 | { | ||
| 3860 | scope = BOOTSTRAPPER_SCOPE_PER_MACHINE; | ||
| 3861 | } | ||
| 3862 | } | ||
| 3863 | |||
| 3825 | SetState(WIXSTDBA_STATE_PLANNING, hr); | 3864 | SetState(WIXSTDBA_STATE_PLANNING, hr); |
| 3826 | 3865 | ||
| 3827 | hr = m_pEngine->Plan(action, BOOTSTRAPPER_SCOPE_DEFAULT/*TODO*/); | 3866 | hr = m_pEngine->Plan(action, scope); |
| 3828 | BalExitOnFailure(hr, "Failed to start planning packages."); | 3867 | BalExitOnFailure(hr, "Failed to start planning packages."); |
| 3829 | 3868 | ||
| 3830 | LExit: | 3869 | LExit: |
| 3870 | ReleaseStr(sczScopeValue); | ||
| 3871 | |||
| 3831 | if (FAILED(hr)) | 3872 | if (FAILED(hr)) |
| 3832 | { | 3873 | { |
| 3833 | SetState(WIXSTDBA_STATE_PLANNING, hr); | 3874 | SetState(WIXSTDBA_STATE_PLANNING, hr); |
| @@ -5104,6 +5145,7 @@ private: | |||
| 5104 | HWND m_hwndSplashScreen; | 5145 | HWND m_hwndSplashScreen; |
| 5105 | 5146 | ||
| 5106 | BOOTSTRAPPER_ACTION m_plannedAction; | 5147 | BOOTSTRAPPER_ACTION m_plannedAction; |
| 5148 | BOOTSTRAPPER_PACKAGE_SCOPE m_bundleScope; | ||
| 5107 | 5149 | ||
| 5108 | LPWSTR m_sczAfterForcedRestartPackage; | 5150 | LPWSTR m_sczAfterForcedRestartPackage; |
| 5109 | LPWSTR m_sczBundleVersion; | 5151 | LPWSTR m_sczBundleVersion; |
