From e8d9158a537c20fe92d45495d10db2b9b051944c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Mon, 21 Sep 2026 18:46:25 +0200 Subject: [PATCH] [Windows] Verify the force close and abort if the process survived --- cmake/NSIS.template.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmake/NSIS.template.in b/cmake/NSIS.template.in index d044cfd81..79f858cfd 100644 --- a/cmake/NSIS.template.in +++ b/cmake/NSIS.template.in @@ -298,6 +298,15 @@ Function WaitForAppToClose DetailPrint "Force closing $R1 ..." Call ForceCloseMatchingApps Sleep 500 + ; verify the force close actually worked; a process that cannot be + ; terminated (e.g. one owned by another user session) would otherwise + ; leave locked files that silently reproduce the very mixed-Qt-DLL bug + ; this guard exists to prevent. + Call IsAppRunning + ${If} $R0 = 1 + DetailPrint "WARNING: $R1 is still running; aborting before any files are replaced." + Abort + ${EndIf} ${Else} ck_wait_prompt: MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION|MB_DEFBUTTON1 \ @@ -387,6 +396,15 @@ Function un.WaitForAppToClose DetailPrint "Force closing $R1 ..." Call un.ForceCloseMatchingApps Sleep 500 + ; verify the force close actually worked; a process that cannot be + ; terminated (e.g. one owned by another user session) would otherwise + ; leave locked files that silently reproduce the very mixed-Qt-DLL bug + ; this guard exists to prevent. + Call un.IsAppRunning + ${If} $R0 = 1 + DetailPrint "WARNING: $R1 is still running; aborting before any files are replaced." + Abort + ${EndIf} ${Else} un_ck_wait_prompt: MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION|MB_DEFBUTTON1 \