summaryrefslogtreecommitdiff
path: root/setup_native
diff options
context:
space:
mode:
Diffstat (limited to 'setup_native')
-rw-r--r--setup_native/source/win32/customactions/inst_msu/inst_msu.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
index 6ce517f2f863..26f7668ff069 100644
--- a/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
+++ b/setup_native/source/win32/customactions/inst_msu/inst_msu.cxx
@@ -604,13 +604,21 @@ extern "C" __declspec(dllexport) UINT __stdcall InstallMSU(MSIHANDLE hInstall)
if (!GetExitCodeProcess(pi.hProcess, &nExitCode))
ThrowLastError("GetExitCodeProcess");
- switch (HRESULT hr = static_cast<HRESULT>(nExitCode))
+ HRESULT hr = static_cast<HRESULT>(nExitCode);
+
+ // HRESULT_FROM_WIN32 is defined as an inline function in SDK 8.1 without the constexpr
+ // And it won't work to place it inside the switch statement.
+ if (HRESULT_FROM_WIN32(ERROR_SUCCESS_REBOOT_REQUIRED) == hr)
+ {
+ hr = ERROR_SUCCESS_REBOOT_REQUIRED;
+ }
+
+ switch (hr)
{
case S_OK:
case WU_S_ALREADY_INSTALLED:
case WU_E_NOT_APPLICABLE: // Windows could lie us about its version, etc.
case ERROR_SUCCESS_REBOOT_REQUIRED:
- case HRESULT_FROM_WIN32(ERROR_SUCCESS_REBOOT_REQUIRED):
case WU_S_REBOOT_REQUIRED:
WriteLog(hInstall, "wusa.exe succeeded with exit code", Num2Hex(nExitCode));
return ERROR_SUCCESS;