From fe146860d6888b1eb60a4e3ae7f830b9ba725d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Silva?= Date: Wed, 2 Sep 2026 17:53:01 +0100 Subject: [PATCH] On SFX, Return the launched app return value. When running applications with SFX, it is good to have the return value of the application itself, so this fixes that. --- CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }