diff --git a/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp b/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp index 20fa952b4..1508a0dc6 100644 --- a/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp +++ b/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp @@ -350,10 +350,12 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, ::CloseHandle(processInformation.hThread); hProcess = processInformation.hProcess; } + DWORD exitCode = 0; if (hProcess) { WaitForSingleObject(hProcess, INFINITE); + ::GetExitCodeProcess(hProcess, &exitCode); ::CloseHandle(hProcess); } - return 0; + return static_cast(exitCode); }