diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-11-08 15:24:46 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-11-10 17:33:25 -0600 |
commit | 9d3af7547bb790d39157dd36dfa862a1abf47beb (patch) | |
tree | 410e6e46daf244dd4e087c658b827fea6231119a | |
parent | b49ab4e082127e450b266c25218905c94495892e (diff) | |
download | wix-9d3af7547bb790d39157dd36dfa862a1abf47beb.tar.gz wix-9d3af7547bb790d39157dd36dfa862a1abf47beb.tar.bz2 wix-9d3af7547bb790d39157dd36dfa862a1abf47beb.zip |
Go back to thmutil not interfering with wixstdba controls.
-rw-r--r-- | src/api/burn/balutil/inc/BAFunctions.h | 1 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/BalBaseBAFunctions.h | 3 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h | 2 | ||||
-rw-r--r-- | src/api/burn/balutil/inc/IBAFunctions.h | 3 | ||||
-rw-r--r-- | src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | 28 | ||||
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/inc/thmutil.h | 5 | ||||
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/thmutil.cpp | 38 | ||||
-rw-r--r-- | src/samples/thmviewer/display.cpp | 7 | ||||
-rw-r--r-- | src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | 3 |
9 files changed, 61 insertions, 29 deletions
diff --git a/src/api/burn/balutil/inc/BAFunctions.h b/src/api/burn/balutil/inc/BAFunctions.h index 149a12f8..21cace1f 100644 --- a/src/api/burn/balutil/inc/BAFunctions.h +++ b/src/api/burn/balutil/inc/BAFunctions.h | |||
@@ -141,6 +141,7 @@ struct BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS | |||
141 | DWORD cbSize; | 141 | DWORD cbSize; |
142 | BOOL fProcessed; | 142 | BOOL fProcessed; |
143 | WORD wId; | 143 | WORD wId; |
144 | BOOL fDisableAutomaticFunctionality; | ||
144 | }; | 145 | }; |
145 | 146 | ||
146 | struct BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_ARGS | 147 | struct BA_FUNCTIONS_ONTHEMECONTROLWMCOMMAND_ARGS |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctions.h b/src/api/burn/balutil/inc/BalBaseBAFunctions.h index 1493253b..2866f6b0 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctions.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctions.h | |||
@@ -835,7 +835,8 @@ public: // IBAFunctions | |||
835 | virtual STDMETHODIMP OnThemeControlLoading( | 835 | virtual STDMETHODIMP OnThemeControlLoading( |
836 | __in LPCWSTR /*wzName*/, | 836 | __in LPCWSTR /*wzName*/, |
837 | __inout BOOL* /*pfProcessed*/, | 837 | __inout BOOL* /*pfProcessed*/, |
838 | __inout WORD* /*pwId*/ | 838 | __inout WORD* /*pwId*/, |
839 | __inout BOOL* /*pfDisableAutomaticFunctionality*/ | ||
839 | ) | 840 | ) |
840 | { | 841 | { |
841 | return S_OK; | 842 | return S_OK; |
diff --git a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h index 135f7c76..e841c660 100644 --- a/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h +++ b/src/api/burn/balutil/inc/BalBaseBAFunctionsProc.h | |||
@@ -30,7 +30,7 @@ static HRESULT BalBaseBAFunctionsProcOnThemeControlLoading( | |||
30 | __inout BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS* pResults | 30 | __inout BA_FUNCTIONS_ONTHEMECONTROLLOADING_RESULTS* pResults |
31 | ) | 31 | ) |
32 | { | 32 | { |
33 | return pBAFunctions->OnThemeControlLoading(pArgs->wzName, &pResults->fProcessed, &pResults->wId); | 33 | return pBAFunctions->OnThemeControlLoading(pArgs->wzName, &pResults->fProcessed, &pResults->wId, &pResults->fDisableAutomaticFunctionality); |
34 | } | 34 | } |
35 | 35 | ||
36 | static HRESULT BalBaseBAFunctionsProcOnThemeControlWmCommand( | 36 | static HRESULT BalBaseBAFunctionsProcOnThemeControlWmCommand( |
diff --git a/src/api/burn/balutil/inc/IBAFunctions.h b/src/api/burn/balutil/inc/IBAFunctions.h index 50126ba1..ea6c116b 100644 --- a/src/api/burn/balutil/inc/IBAFunctions.h +++ b/src/api/burn/balutil/inc/IBAFunctions.h | |||
@@ -35,7 +35,8 @@ DECLARE_INTERFACE_IID_(IBAFunctions, IBootstrapperApplication, "0FB445ED-17BD-49 | |||
35 | STDMETHOD(OnThemeControlLoading)( | 35 | STDMETHOD(OnThemeControlLoading)( |
36 | __in LPCWSTR wzName, | 36 | __in LPCWSTR wzName, |
37 | __inout BOOL* pfProcessed, | 37 | __inout BOOL* pfProcessed, |
38 | __inout WORD* pwId | 38 | __inout WORD* pwId, |
39 | __inout BOOL* pfDisableAutomaticFunctionality | ||
39 | ) = 0; | 40 | ) = 0; |
40 | 41 | ||
41 | // OnThemeControlWmCommand - Called when WM_COMMAND is received for a control. | 42 | // OnThemeControlWmCommand - Called when WM_COMMAND is received for a control. |
diff --git a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp index 4d819c7d..6a8bb2b8 100644 --- a/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/src/ext/Bal/wixstdba/WixStandardBootstrapperApplication.cpp | |||
@@ -2927,6 +2927,7 @@ private: | |||
2927 | 2927 | ||
2928 | fProcessed = TRUE; | 2928 | fProcessed = TRUE; |
2929 | pResults->wId = pAssignControl->wId; | 2929 | pResults->wId = pAssignControl->wId; |
2930 | pResults->fDisableAutomaticFunctionality = pAssignControl->fDisableAutomaticFunctionality; | ||
2930 | ExitFunction(); | 2931 | ExitFunction(); |
2931 | } | 2932 | } |
2932 | } | 2933 | } |
@@ -2938,6 +2939,7 @@ private: | |||
2938 | 2939 | ||
2939 | themeControlLoadingResults.cbSize = sizeof(themeControlLoadingResults); | 2940 | themeControlLoadingResults.cbSize = sizeof(themeControlLoadingResults); |
2940 | themeControlLoadingResults.wId = pResults->wId; | 2941 | themeControlLoadingResults.wId = pResults->wId; |
2942 | themeControlLoadingResults.fDisableAutomaticFunctionality = pResults->fDisableAutomaticFunctionality; | ||
2941 | 2943 | ||
2942 | hr = m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING, &themeControlLoadingArgs, &themeControlLoadingResults, m_pvBAFunctionsProcContext); | 2944 | hr = m_pfnBAFunctionsProc(BA_FUNCTIONS_MESSAGE_ONTHEMECONTROLLOADING, &themeControlLoadingArgs, &themeControlLoadingResults, m_pvBAFunctionsProcContext); |
2943 | 2945 | ||
@@ -2953,6 +2955,7 @@ private: | |||
2953 | { | 2955 | { |
2954 | fProcessed = TRUE; | 2956 | fProcessed = TRUE; |
2955 | pResults->wId = themeControlLoadingResults.wId; | 2957 | pResults->wId = themeControlLoadingResults.wId; |
2958 | pResults->fDisableAutomaticFunctionality = themeControlLoadingResults.fDisableAutomaticFunctionality; | ||
2956 | } | 2959 | } |
2957 | } | 2960 | } |
2958 | } | 2961 | } |
@@ -4040,7 +4043,7 @@ LExit: | |||
4040 | BalExitOnNullWithLastError(pfnBAFunctionsCreate, hr, "Failed to get BAFunctionsCreate entry-point from: %ls", sczBafPath); | 4043 | BalExitOnNullWithLastError(pfnBAFunctionsCreate, hr, "Failed to get BAFunctionsCreate entry-point from: %ls", sczBafPath); |
4041 | 4044 | ||
4042 | bafCreateArgs.cbSize = sizeof(bafCreateArgs); | 4045 | bafCreateArgs.cbSize = sizeof(bafCreateArgs); |
4043 | bafCreateArgs.qwBAFunctionsAPIVersion = MAKEQWORDVERSION(2021, 9, 20, 0); | 4046 | bafCreateArgs.qwBAFunctionsAPIVersion = MAKEQWORDVERSION(2021, 11, 8, 0); |
4044 | bafCreateArgs.pBootstrapperCreateArgs = &m_createArgs; | 4047 | bafCreateArgs.pBootstrapperCreateArgs = &m_createArgs; |
4045 | 4048 | ||
4046 | bafCreateResults.cbSize = sizeof(bafCreateResults); | 4049 | bafCreateResults.cbSize = sizeof(bafCreateResults); |
@@ -4138,138 +4141,161 @@ public: | |||
4138 | pAssignControl->wId = WIXSTDBA_CONTROL_INSTALL_BUTTON; | 4141 | pAssignControl->wId = WIXSTDBA_CONTROL_INSTALL_BUTTON; |
4139 | pAssignControl->wzName = L"InstallButton"; | 4142 | pAssignControl->wzName = L"InstallButton"; |
4140 | pAssignControl->ppControl = &m_pControlInstallButton; | 4143 | pAssignControl->ppControl = &m_pControlInstallButton; |
4144 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4141 | m_pControlInstallButton = NULL; | 4145 | m_pControlInstallButton = NULL; |
4142 | ++pAssignControl; | 4146 | ++pAssignControl; |
4143 | 4147 | ||
4144 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_RICHEDIT; | 4148 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_RICHEDIT; |
4145 | pAssignControl->wzName = L"EulaRichedit"; | 4149 | pAssignControl->wzName = L"EulaRichedit"; |
4146 | pAssignControl->ppControl = &m_pControlEulaRichedit; | 4150 | pAssignControl->ppControl = &m_pControlEulaRichedit; |
4151 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4147 | m_pControlEulaRichedit = NULL; | 4152 | m_pControlEulaRichedit = NULL; |
4148 | ++pAssignControl; | 4153 | ++pAssignControl; |
4149 | 4154 | ||
4150 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_LINK; | 4155 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_LINK; |
4151 | pAssignControl->wzName = L"EulaHyperlink"; | 4156 | pAssignControl->wzName = L"EulaHyperlink"; |
4152 | pAssignControl->ppControl = &m_pControlEulaHyperlink; | 4157 | pAssignControl->ppControl = &m_pControlEulaHyperlink; |
4158 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4153 | m_pControlEulaHyperlink = NULL; | 4159 | m_pControlEulaHyperlink = NULL; |
4154 | ++pAssignControl; | 4160 | ++pAssignControl; |
4155 | 4161 | ||
4156 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX; | 4162 | pAssignControl->wId = WIXSTDBA_CONTROL_EULA_ACCEPT_CHECKBOX; |
4157 | pAssignControl->wzName = L"EulaAcceptCheckbox"; | 4163 | pAssignControl->wzName = L"EulaAcceptCheckbox"; |
4158 | pAssignControl->ppControl = &m_pControlEulaAcceptCheckbox; | 4164 | pAssignControl->ppControl = &m_pControlEulaAcceptCheckbox; |
4165 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4159 | m_pControlEulaAcceptCheckbox = NULL; | 4166 | m_pControlEulaAcceptCheckbox = NULL; |
4160 | ++pAssignControl; | 4167 | ++pAssignControl; |
4161 | 4168 | ||
4162 | pAssignControl->wId = WIXSTDBA_CONTROL_REPAIR_BUTTON; | 4169 | pAssignControl->wId = WIXSTDBA_CONTROL_REPAIR_BUTTON; |
4163 | pAssignControl->wzName = L"RepairButton"; | 4170 | pAssignControl->wzName = L"RepairButton"; |
4164 | pAssignControl->ppControl = &m_pControlRepairButton; | 4171 | pAssignControl->ppControl = &m_pControlRepairButton; |
4172 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4165 | m_pControlRepairButton = NULL; | 4173 | m_pControlRepairButton = NULL; |
4166 | ++pAssignControl; | 4174 | ++pAssignControl; |
4167 | 4175 | ||
4168 | pAssignControl->wId = WIXSTDBA_CONTROL_UNINSTALL_BUTTON; | 4176 | pAssignControl->wId = WIXSTDBA_CONTROL_UNINSTALL_BUTTON; |
4169 | pAssignControl->wzName = L"UninstallButton"; | 4177 | pAssignControl->wzName = L"UninstallButton"; |
4170 | pAssignControl->ppControl = &m_pControlUninstallButton; | 4178 | pAssignControl->ppControl = &m_pControlUninstallButton; |
4179 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4171 | m_pControlUninstallButton = NULL; | 4180 | m_pControlUninstallButton = NULL; |
4172 | ++pAssignControl; | 4181 | ++pAssignControl; |
4173 | 4182 | ||
4174 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_PACKAGE_TEXT; | 4183 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_PACKAGE_TEXT; |
4175 | pAssignControl->wzName = L"CacheProgressPackageText"; | 4184 | pAssignControl->wzName = L"CacheProgressPackageText"; |
4176 | pAssignControl->ppControl = &m_pControlCacheProgressPackageText; | 4185 | pAssignControl->ppControl = &m_pControlCacheProgressPackageText; |
4186 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4177 | m_pControlCacheProgressPackageText = NULL; | 4187 | m_pControlCacheProgressPackageText = NULL; |
4178 | ++pAssignControl; | 4188 | ++pAssignControl; |
4179 | 4189 | ||
4180 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_BAR; | 4190 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_BAR; |
4181 | pAssignControl->wzName = L"CacheProgressbar"; | 4191 | pAssignControl->wzName = L"CacheProgressbar"; |
4182 | pAssignControl->ppControl = &m_pControlCacheProgressbar; | 4192 | pAssignControl->ppControl = &m_pControlCacheProgressbar; |
4193 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4183 | m_pControlCacheProgressbar = NULL; | 4194 | m_pControlCacheProgressbar = NULL; |
4184 | ++pAssignControl; | 4195 | ++pAssignControl; |
4185 | 4196 | ||
4186 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_TEXT; | 4197 | pAssignControl->wId = WIXSTDBA_CONTROL_CACHE_PROGRESS_TEXT; |
4187 | pAssignControl->wzName = L"CacheProgressText"; | 4198 | pAssignControl->wzName = L"CacheProgressText"; |
4188 | pAssignControl->ppControl = &m_pControlCacheProgressText; | 4199 | pAssignControl->ppControl = &m_pControlCacheProgressText; |
4200 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4189 | m_pControlCacheProgressText = NULL; | 4201 | m_pControlCacheProgressText = NULL; |
4190 | ++pAssignControl; | 4202 | ++pAssignControl; |
4191 | 4203 | ||
4192 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT; | 4204 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_PACKAGE_TEXT; |
4193 | pAssignControl->wzName = L"ExecuteProgressPackageText"; | 4205 | pAssignControl->wzName = L"ExecuteProgressPackageText"; |
4194 | pAssignControl->ppControl = &m_pControlExecuteProgressPackageText; | 4206 | pAssignControl->ppControl = &m_pControlExecuteProgressPackageText; |
4207 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4195 | m_pControlExecuteProgressPackageText = NULL; | 4208 | m_pControlExecuteProgressPackageText = NULL; |
4196 | ++pAssignControl; | 4209 | ++pAssignControl; |
4197 | 4210 | ||
4198 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_BAR; | 4211 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_BAR; |
4199 | pAssignControl->wzName = L"ExecuteProgressbar"; | 4212 | pAssignControl->wzName = L"ExecuteProgressbar"; |
4200 | pAssignControl->ppControl = &m_pControlExecuteProgressbar; | 4213 | pAssignControl->ppControl = &m_pControlExecuteProgressbar; |
4214 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4201 | m_pControlExecuteProgressbar = NULL; | 4215 | m_pControlExecuteProgressbar = NULL; |
4202 | ++pAssignControl; | 4216 | ++pAssignControl; |
4203 | 4217 | ||
4204 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_TEXT; | 4218 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_TEXT; |
4205 | pAssignControl->wzName = L"ExecuteProgressText"; | 4219 | pAssignControl->wzName = L"ExecuteProgressText"; |
4206 | pAssignControl->ppControl = &m_pControlExecuteProgressText; | 4220 | pAssignControl->ppControl = &m_pControlExecuteProgressText; |
4221 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4207 | m_pControlExecuteProgressText = NULL; | 4222 | m_pControlExecuteProgressText = NULL; |
4208 | ++pAssignControl; | 4223 | ++pAssignControl; |
4209 | 4224 | ||
4210 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT; | 4225 | pAssignControl->wId = WIXSTDBA_CONTROL_EXECUTE_PROGRESS_ACTIONDATA_TEXT; |
4211 | pAssignControl->wzName = L"ExecuteProgressActionDataText"; | 4226 | pAssignControl->wzName = L"ExecuteProgressActionDataText"; |
4212 | pAssignControl->ppControl = &m_pControlExecuteProgressActionDataText; | 4227 | pAssignControl->ppControl = &m_pControlExecuteProgressActionDataText; |
4228 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4213 | m_pControlExecuteProgressActionDataText = NULL; | 4229 | m_pControlExecuteProgressActionDataText = NULL; |
4214 | ++pAssignControl; | 4230 | ++pAssignControl; |
4215 | 4231 | ||
4216 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT; | 4232 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_PACKAGE_TEXT; |
4217 | pAssignControl->wzName = L"OverallProgressPackageText"; | 4233 | pAssignControl->wzName = L"OverallProgressPackageText"; |
4218 | pAssignControl->ppControl = &m_pControlOverallProgressPackageText; | 4234 | pAssignControl->ppControl = &m_pControlOverallProgressPackageText; |
4235 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4219 | m_pControlOverallProgressPackageText = NULL; | 4236 | m_pControlOverallProgressPackageText = NULL; |
4220 | ++pAssignControl; | 4237 | ++pAssignControl; |
4221 | 4238 | ||
4222 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_BAR; | 4239 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_BAR; |
4223 | pAssignControl->wzName = L"OverallProgressbar"; | 4240 | pAssignControl->wzName = L"OverallProgressbar"; |
4224 | pAssignControl->ppControl = &m_pControlOverallProgressbar; | 4241 | pAssignControl->ppControl = &m_pControlOverallProgressbar; |
4242 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4225 | m_pControlOverallProgressbar = NULL; | 4243 | m_pControlOverallProgressbar = NULL; |
4226 | ++pAssignControl; | 4244 | ++pAssignControl; |
4227 | 4245 | ||
4228 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_CALCULATED_PROGRESS_BAR; | 4246 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_CALCULATED_PROGRESS_BAR; |
4229 | pAssignControl->wzName = L"OverallCalculatedProgressbar"; | 4247 | pAssignControl->wzName = L"OverallCalculatedProgressbar"; |
4230 | pAssignControl->ppControl = &m_pControlOverallCalculatedProgressbar; | 4248 | pAssignControl->ppControl = &m_pControlOverallCalculatedProgressbar; |
4249 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4231 | m_pControlOverallCalculatedProgressbar = NULL; | 4250 | m_pControlOverallCalculatedProgressbar = NULL; |
4232 | ++pAssignControl; | 4251 | ++pAssignControl; |
4233 | 4252 | ||
4234 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_TEXT; | 4253 | pAssignControl->wId = WIXSTDBA_CONTROL_OVERALL_PROGRESS_TEXT; |
4235 | pAssignControl->wzName = L"OverallProgressText"; | 4254 | pAssignControl->wzName = L"OverallProgressText"; |
4236 | pAssignControl->ppControl = &m_pControlOverallProgressText; | 4255 | pAssignControl->ppControl = &m_pControlOverallProgressText; |
4256 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4237 | m_pControlOverallProgressText = NULL; | 4257 | m_pControlOverallProgressText = NULL; |
4238 | ++pAssignControl; | 4258 | ++pAssignControl; |
4239 | 4259 | ||
4240 | pAssignControl->wId = WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON; | 4260 | pAssignControl->wId = WIXSTDBA_CONTROL_PROGRESS_CANCEL_BUTTON; |
4241 | pAssignControl->wzName = L"ProgressCancelButton"; | 4261 | pAssignControl->wzName = L"ProgressCancelButton"; |
4242 | pAssignControl->ppControl = &m_pControlProgressCancelButton; | 4262 | pAssignControl->ppControl = &m_pControlProgressCancelButton; |
4263 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4243 | m_pControlProgressCancelButton = NULL; | 4264 | m_pControlProgressCancelButton = NULL; |
4244 | ++pAssignControl; | 4265 | ++pAssignControl; |
4245 | 4266 | ||
4246 | pAssignControl->wId = WIXSTDBA_CONTROL_LAUNCH_BUTTON; | 4267 | pAssignControl->wId = WIXSTDBA_CONTROL_LAUNCH_BUTTON; |
4247 | pAssignControl->wzName = L"LaunchButton"; | 4268 | pAssignControl->wzName = L"LaunchButton"; |
4248 | pAssignControl->ppControl = &m_pControlLaunchButton; | 4269 | pAssignControl->ppControl = &m_pControlLaunchButton; |
4270 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4249 | m_pControlLaunchButton = NULL; | 4271 | m_pControlLaunchButton = NULL; |
4250 | ++pAssignControl; | 4272 | ++pAssignControl; |
4251 | 4273 | ||
4252 | pAssignControl->wId = WIXSTDBA_CONTROL_SUCCESS_RESTART_BUTTON; | 4274 | pAssignControl->wId = WIXSTDBA_CONTROL_SUCCESS_RESTART_BUTTON; |
4253 | pAssignControl->wzName = L"SuccessRestartButton"; | 4275 | pAssignControl->wzName = L"SuccessRestartButton"; |
4254 | pAssignControl->ppControl = &m_pControlSuccessRestartButton; | 4276 | pAssignControl->ppControl = &m_pControlSuccessRestartButton; |
4277 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4255 | m_pControlSuccessRestartButton = NULL; | 4278 | m_pControlSuccessRestartButton = NULL; |
4256 | ++pAssignControl; | 4279 | ++pAssignControl; |
4257 | 4280 | ||
4258 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_LOGFILE_LINK; | 4281 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_LOGFILE_LINK; |
4259 | pAssignControl->wzName = L"FailureLogFileLink"; | 4282 | pAssignControl->wzName = L"FailureLogFileLink"; |
4260 | pAssignControl->ppControl = &m_pControlFailureLogFileLink; | 4283 | pAssignControl->ppControl = &m_pControlFailureLogFileLink; |
4284 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4261 | m_pControlFailureLogFileLink = NULL; | 4285 | m_pControlFailureLogFileLink = NULL; |
4262 | ++pAssignControl; | 4286 | ++pAssignControl; |
4263 | 4287 | ||
4264 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_MESSAGE_TEXT; | 4288 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_MESSAGE_TEXT; |
4265 | pAssignControl->wzName = L"FailureMessageText"; | 4289 | pAssignControl->wzName = L"FailureMessageText"; |
4266 | pAssignControl->ppControl = &m_pControlFailureMessageText; | 4290 | pAssignControl->ppControl = &m_pControlFailureMessageText; |
4291 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4267 | m_pControlFailureMessageText = NULL; | 4292 | m_pControlFailureMessageText = NULL; |
4268 | ++pAssignControl; | 4293 | ++pAssignControl; |
4269 | 4294 | ||
4270 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON; | 4295 | pAssignControl->wId = WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON; |
4271 | pAssignControl->wzName = L"FailureRestartButton"; | 4296 | pAssignControl->wzName = L"FailureRestartButton"; |
4272 | pAssignControl->ppControl = &m_pControlFailureRestartButton; | 4297 | pAssignControl->ppControl = &m_pControlFailureRestartButton; |
4298 | pAssignControl->fDisableAutomaticFunctionality = TRUE; | ||
4273 | m_pControlFailureRestartButton = NULL; | 4299 | m_pControlFailureRestartButton = NULL; |
4274 | 4300 | ||
4275 | C_ASSERT(LAST_WIXSTDBA_CONTROL == WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON + 1); | 4301 | C_ASSERT(LAST_WIXSTDBA_CONTROL == WIXSTDBA_CONTROL_FAILURE_RESTART_BUTTON + 1); |
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h b/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h index 2f0bfeac..8cf7dc92 100644 --- a/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h +++ b/src/libs/dutil/WixToolset.DUtil/inc/thmutil.h | |||
@@ -196,6 +196,7 @@ struct THEME_ASSIGN_CONTROL_ID | |||
196 | WORD wId; // id to apply to control | 196 | WORD wId; // id to apply to control |
197 | LPCWSTR wzName; // name of control to match | 197 | LPCWSTR wzName; // name of control to match |
198 | const THEME_CONTROL** ppControl; | 198 | const THEME_CONTROL** ppControl; |
199 | BOOL fDisableAutomaticFunctionality; // prevent declarative functionality from interfering with the application's imperative code | ||
199 | }; | 200 | }; |
200 | 201 | ||
201 | const WORD THEME_FIRST_ASSIGN_CONTROL_ID = 0x4000; // Recommended first control id to be assigned. | 202 | const WORD THEME_FIRST_ASSIGN_CONTROL_ID = 0x4000; // Recommended first control id to be assigned. |
@@ -223,7 +224,7 @@ typedef struct _THEME_CONTROL | |||
223 | 224 | ||
224 | LPWSTR sczEnableCondition; | 225 | LPWSTR sczEnableCondition; |
225 | LPWSTR sczVisibleCondition; | 226 | LPWSTR sczVisibleCondition; |
226 | BOOL fDisableVariableFunctionality; | 227 | BOOL fDisableAutomaticFunctionality; |
227 | 228 | ||
228 | union | 229 | union |
229 | { | 230 | { |
@@ -470,6 +471,8 @@ typedef struct _THEME_LOADINGCONTROL_RESULTS | |||
470 | // The values [100, THEME_FIRST_ASSIGN_CONTROL_ID) are reserved for thmutil. | 471 | // The values [100, THEME_FIRST_ASSIGN_CONTROL_ID) are reserved for thmutil. |
471 | // Due to this value being packed into 16 bits for many system window messages, this is restricted to a WORD. | 472 | // Due to this value being packed into 16 bits for many system window messages, this is restricted to a WORD. |
472 | WORD wId; | 473 | WORD wId; |
474 | // Used to prevent declarative functionality from interfering with the application's imperative code. | ||
475 | BOOL fDisableAutomaticFunctionality; | ||
473 | } THEME_LOADINGCONTROL_RESULTS; | 476 | } THEME_LOADINGCONTROL_RESULTS; |
474 | 477 | ||
475 | 478 | ||
diff --git a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp index 74c1a8b0..b76d6483 100644 --- a/src/libs/dutil/WixToolset.DUtil/thmutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/thmutil.cpp | |||
@@ -295,7 +295,8 @@ static void UnloadThemeControls( | |||
295 | static HRESULT OnLoadingControl( | 295 | static HRESULT OnLoadingControl( |
296 | __in THEME* pTheme, | 296 | __in THEME* pTheme, |
297 | __in const THEME_CONTROL* pControl, | 297 | __in const THEME_CONTROL* pControl, |
298 | __inout WORD* pwId | 298 | __inout WORD* pwId, |
299 | __inout BOOL* pfDisableAutomaticFunctionality | ||
299 | ); | 300 | ); |
300 | static HRESULT LoadControls( | 301 | static HRESULT LoadControls( |
301 | __in THEME* pTheme, | 302 | __in THEME* pTheme, |
@@ -3432,9 +3433,6 @@ static HRESULT ParseControl( | |||
3432 | pControl->dwInternalStyle |= INTERNAL_CONTROL_STYLE_HIDE_WHEN_DISABLED; | 3433 | pControl->dwInternalStyle |= INTERNAL_CONTROL_STYLE_HIDE_WHEN_DISABLED; |
3433 | } | 3434 | } |
3434 | 3435 | ||
3435 | hr = XmlGetYesNoAttribute(pixn, L"DisableAutomaticBehavior", &pControl->fDisableVariableFunctionality); | ||
3436 | ThmExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed when querying control DisableAutomaticBehavior attribute."); | ||
3437 | |||
3438 | hr = ParseActions(pixn, pControl); | 3436 | hr = ParseActions(pixn, pControl); |
3439 | ThmExitOnFailure(hr, "Failed to parse action nodes of the control."); | 3437 | ThmExitOnFailure(hr, "Failed to parse action nodes of the control."); |
3440 | 3438 | ||
@@ -5002,6 +5000,7 @@ static void OnBrowseDirectory( | |||
5002 | { | 5000 | { |
5003 | // Since editbox changes aren't immediately saved off, we have to treat them differently. | 5001 | // Since editbox changes aren't immediately saved off, we have to treat them differently. |
5004 | THEME_CONTROL* pTargetControl = NULL; | 5002 | THEME_CONTROL* pTargetControl = NULL; |
5003 | BOOL fSetVariable = NULL != pTheme->pfnSetStringVariable; | ||
5005 | 5004 | ||
5006 | for (DWORD i = 0; i < pTheme->cControls; ++i) | 5005 | for (DWORD i = 0; i < pTheme->cControls; ++i) |
5007 | { | 5006 | { |
@@ -5015,21 +5014,18 @@ static void OnBrowseDirectory( | |||
5015 | } | 5014 | } |
5016 | } | 5015 | } |
5017 | 5016 | ||
5018 | if (pTargetControl && THEME_CONTROL_TYPE_EDITBOX == pTargetControl->type && !pTargetControl->fDisableVariableFunctionality) | 5017 | if (pTargetControl && !pTargetControl->fDisableAutomaticFunctionality && (!fSetVariable || THEME_CONTROL_TYPE_EDITBOX == pTargetControl->type)) |
5019 | { | 5018 | { |
5019 | fSetVariable = FALSE; | ||
5020 | hr = ThemeSetTextControl(pTargetControl, wzPath); | 5020 | hr = ThemeSetTextControl(pTargetControl, wzPath); |
5021 | ThmExitOnFailure(hr, "Failed to set text on editbox: %ls", pTargetControl->sczName); | 5021 | ThmExitOnFailure(hr, "Failed to set text on control: %ls", pTargetControl->sczName); |
5022 | } | 5022 | } |
5023 | else if (pTheme->pfnSetStringVariable) | 5023 | |
5024 | if (fSetVariable) | ||
5024 | { | 5025 | { |
5025 | hr = pTheme->pfnSetStringVariable(pAction->BrowseDirectory.sczVariableName, wzPath, FALSE, pTheme->pvVariableContext); | 5026 | hr = pTheme->pfnSetStringVariable(pAction->BrowseDirectory.sczVariableName, wzPath, FALSE, pTheme->pvVariableContext); |
5026 | ThmExitOnFailure(hr, "Failed to set variable: %ls", pAction->BrowseDirectory.sczVariableName); | 5027 | ThmExitOnFailure(hr, "Failed to set variable: %ls", pAction->BrowseDirectory.sczVariableName); |
5027 | } | 5028 | } |
5028 | else if (pTargetControl) | ||
5029 | { | ||
5030 | hr = ThemeSetTextControl(pTargetControl, wzPath); | ||
5031 | ThmExitOnFailure(hr, "Failed to set text on control: %ls", pTargetControl->sczName); | ||
5032 | } | ||
5033 | 5029 | ||
5034 | ThemeShowPageEx(pTheme, pTheme->dwCurrentPageId, SW_SHOW, THEME_SHOW_PAGE_REASON_REFRESH); | 5030 | ThemeShowPageEx(pTheme, pTheme->dwCurrentPageId, SW_SHOW, THEME_SHOW_PAGE_REASON_REFRESH); |
5035 | } | 5031 | } |
@@ -5051,7 +5047,7 @@ static BOOL OnButtonClicked( | |||
5051 | 5047 | ||
5052 | if (THEME_CONTROL_TYPE_BUTTON == pControl->type || THEME_CONTROL_TYPE_COMMANDLINK == pControl->type) | 5048 | if (THEME_CONTROL_TYPE_BUTTON == pControl->type || THEME_CONTROL_TYPE_COMMANDLINK == pControl->type) |
5053 | { | 5049 | { |
5054 | if (pControl->cActions) | 5050 | if (!pControl->fDisableAutomaticFunctionality && pControl->cActions) |
5055 | { | 5051 | { |
5056 | fHandled = TRUE; | 5052 | fHandled = TRUE; |
5057 | THEME_ACTION* pChosenAction = pControl->pDefaultAction; | 5053 | THEME_ACTION* pChosenAction = pControl->pDefaultAction; |
@@ -5109,7 +5105,7 @@ static BOOL OnButtonClicked( | |||
5109 | } | 5105 | } |
5110 | } | 5106 | } |
5111 | } | 5107 | } |
5112 | else if (!pControl->fDisableVariableFunctionality && (pTheme->pfnSetNumericVariable || pTheme->pfnSetStringVariable)) | 5108 | else if (!pControl->fDisableAutomaticFunctionality && (pTheme->pfnSetNumericVariable || pTheme->pfnSetStringVariable)) |
5113 | { | 5109 | { |
5114 | BOOL fRefresh = FALSE; | 5110 | BOOL fRefresh = FALSE; |
5115 | 5111 | ||
@@ -5564,7 +5560,7 @@ static HRESULT ShowControl( | |||
5564 | THEME_PAGE* pPage = ThemeGetPage(pTheme, dwPageId); | 5560 | THEME_PAGE* pPage = ThemeGetPage(pTheme, dwPageId); |
5565 | 5561 | ||
5566 | // Save the editbox value if necessary (other control types save their values immediately). | 5562 | // Save the editbox value if necessary (other control types save their values immediately). |
5567 | if (pTheme->pfnSetStringVariable && !pControl->fDisableVariableFunctionality && | 5563 | if (pTheme->pfnSetStringVariable && !pControl->fDisableAutomaticFunctionality && |
5568 | fSaveEditboxes && THEME_CONTROL_TYPE_EDITBOX == pControl->type && pControl->sczName && *pControl->sczName) | 5564 | fSaveEditboxes && THEME_CONTROL_TYPE_EDITBOX == pControl->type && pControl->sczName && *pControl->sczName) |
5569 | { | 5565 | { |
5570 | hr = ThemeGetTextControl(pControl, &sczText); | 5566 | hr = ThemeGetTextControl(pControl, &sczText); |
@@ -5591,7 +5587,7 @@ static HRESULT ShowControl( | |||
5591 | BOOL fEnabled = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_DISABLED); | 5587 | BOOL fEnabled = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_DISABLED); |
5592 | BOOL fVisible = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDDEN); | 5588 | BOOL fVisible = !(pControl->dwInternalStyle & INTERNAL_CONTROL_STYLE_HIDDEN); |
5593 | 5589 | ||
5594 | if (!pControl->fDisableVariableFunctionality) | 5590 | if (!pControl->fDisableAutomaticFunctionality) |
5595 | { | 5591 | { |
5596 | if (pTheme->pfnEvaluateCondition) | 5592 | if (pTheme->pfnEvaluateCondition) |
5597 | { | 5593 | { |
@@ -6017,7 +6013,8 @@ static LRESULT CALLBACK StaticOwnerDrawWndProc( | |||
6017 | static HRESULT OnLoadingControl( | 6013 | static HRESULT OnLoadingControl( |
6018 | __in THEME* pTheme, | 6014 | __in THEME* pTheme, |
6019 | __in const THEME_CONTROL* pControl, | 6015 | __in const THEME_CONTROL* pControl, |
6020 | __inout WORD* pwId | 6016 | __inout WORD* pwId, |
6017 | __inout BOOL* pfDisableAutomaticFunctionality | ||
6021 | ) | 6018 | ) |
6022 | { | 6019 | { |
6023 | HRESULT hr = S_OK; | 6020 | HRESULT hr = S_OK; |
@@ -6037,6 +6034,7 @@ static HRESULT OnLoadingControl( | |||
6037 | if (SUCCEEDED(hr)) | 6034 | if (SUCCEEDED(hr)) |
6038 | { | 6035 | { |
6039 | *pwId = loadingControlResults.wId; | 6036 | *pwId = loadingControlResults.wId; |
6037 | *pfDisableAutomaticFunctionality = loadingControlResults.fDisableAutomaticFunctionality; | ||
6040 | } | 6038 | } |
6041 | } | 6039 | } |
6042 | 6040 | ||
@@ -6238,7 +6236,7 @@ static HRESULT LoadControls( | |||
6238 | 6236 | ||
6239 | // Default control ids to the next id, unless there is a specific id to assign to a control. | 6237 | // Default control ids to the next id, unless there is a specific id to assign to a control. |
6240 | WORD wControlId = THEME_FIRST_AUTO_ASSIGN_CONTROL_ID; | 6238 | WORD wControlId = THEME_FIRST_AUTO_ASSIGN_CONTROL_ID; |
6241 | hr = OnLoadingControl(pTheme, pControl, &wControlId); | 6239 | hr = OnLoadingControl(pTheme, pControl, &wControlId, &pControl->fDisableAutomaticFunctionality); |
6242 | ThmExitOnFailure(hr, "ThmLoadingControl failed."); | 6240 | ThmExitOnFailure(hr, "ThmLoadingControl failed."); |
6243 | 6241 | ||
6244 | // This range is reserved for thmutil. The process will run out of available window handles before reaching the end of the range. | 6242 | // This range is reserved for thmutil. The process will run out of available window handles before reaching the end of the range. |
@@ -6256,7 +6254,7 @@ static HRESULT LoadControls( | |||
6256 | BOOL fDisabled = pControl->dwStyle & WS_DISABLED; | 6254 | BOOL fDisabled = pControl->dwStyle & WS_DISABLED; |
6257 | 6255 | ||
6258 | // If the control is supposed to be initially visible and it has a VisibleCondition, check if it's true. | 6256 | // If the control is supposed to be initially visible and it has a VisibleCondition, check if it's true. |
6259 | if (fVisible && pControl->sczVisibleCondition && pTheme->pfnEvaluateCondition && !pControl->fDisableVariableFunctionality) | 6257 | if (fVisible && pControl->sczVisibleCondition && pTheme->pfnEvaluateCondition && !pControl->fDisableAutomaticFunctionality) |
6260 | { | 6258 | { |
6261 | hr = pTheme->pfnEvaluateCondition(pControl->sczVisibleCondition, &fVisible, pTheme->pvVariableContext); | 6259 | hr = pTheme->pfnEvaluateCondition(pControl->sczVisibleCondition, &fVisible, pTheme->pvVariableContext); |
6262 | ThmExitOnFailure(hr, "Failed to evaluate VisibleCondition: %ls", pControl->sczVisibleCondition); | 6260 | ThmExitOnFailure(hr, "Failed to evaluate VisibleCondition: %ls", pControl->sczVisibleCondition); |
@@ -6275,7 +6273,7 @@ static HRESULT LoadControls( | |||
6275 | } | 6273 | } |
6276 | 6274 | ||
6277 | // If the control is supposed to be initially enabled and it has an EnableCondition, check if it's true. | 6275 | // If the control is supposed to be initially enabled and it has an EnableCondition, check if it's true. |
6278 | if (!fDisabled && pControl->sczEnableCondition && pTheme->pfnEvaluateCondition && !pControl->fDisableVariableFunctionality) | 6276 | if (!fDisabled && pControl->sczEnableCondition && pTheme->pfnEvaluateCondition && !pControl->fDisableAutomaticFunctionality) |
6279 | { | 6277 | { |
6280 | BOOL fEnable = TRUE; | 6278 | BOOL fEnable = TRUE; |
6281 | 6279 | ||
diff --git a/src/samples/thmviewer/display.cpp b/src/samples/thmviewer/display.cpp index f40b50b5..444c6cfb 100644 --- a/src/samples/thmviewer/display.cpp +++ b/src/samples/thmviewer/display.cpp | |||
@@ -327,9 +327,10 @@ static BOOL DisplayOnThmLoadedControl( | |||
327 | } | 327 | } |
328 | else if (THEME_CONTROL_TYPE_PROGRESSBAR == pControl->type) | 328 | else if (THEME_CONTROL_TYPE_PROGRESSBAR == pControl->type) |
329 | { | 329 | { |
330 | DWORD dwId = ::SetTimer(pTheme->hwndParent, reinterpret_cast<UINT_PTR>(pControl), 500, NULL); | 330 | UINT_PTR timerId = reinterpret_cast<UINT_PTR>(pControl); |
331 | dwId = dwId; // prevents warning in "ship" build. | 331 | UINT_PTR id = ::SetTimer(pTheme->hwndParent, timerId, 500, NULL); |
332 | Assert(dwId == pControl->wId); | 332 | id = id; // prevents warning in "ship" build. |
333 | Assert(id == timerId); | ||
333 | } | 334 | } |
334 | 335 | ||
335 | LExit: | 336 | LExit: |
diff --git a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp index 6c37fbd8..7c533fea 100644 --- a/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp +++ b/src/test/burn/TestData/Manual/BafThmutilTesting/BafThmUtilTesting.cpp | |||
@@ -46,7 +46,8 @@ public: // IBAFunctions | |||
46 | virtual STDMETHODIMP OnThemeControlLoading( | 46 | virtual STDMETHODIMP OnThemeControlLoading( |
47 | __in LPCWSTR wzName, | 47 | __in LPCWSTR wzName, |
48 | __inout BOOL* pfProcessed, | 48 | __inout BOOL* pfProcessed, |
49 | __inout WORD* pwId | 49 | __inout WORD* pwId, |
50 | __inout BOOL* /*pfDisableAutomaticFunctionality*/ | ||
50 | ) | 51 | ) |
51 | { | 52 | { |
52 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzName, -1, L"InstallTestButton", -1)) | 53 | if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, 0, wzName, -1, L"InstallTestButton", -1)) |