From 912d9d8c00aa7d1539de4d969cd43a1b0686e4a8 Mon Sep 17 00:00:00 2001 From: Vxrtrauter <101264710+Vxrtrauter@users.noreply.github.com> Date: Tue, 7 Apr 2026 02:26:15 +0200 Subject: [PATCH] fix: Add shutdown helper call and modify exit behavior in updater --- installer.iss | 9 +++++++++ src/utils/network/updater.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/installer.iss b/installer.iss index 8d58c9e..cc2bd38 100644 --- a/installer.iss +++ b/installer.iss @@ -66,6 +66,15 @@ Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon +[Code] +function PrepareToInstall(var NeedsRestart: Boolean): String; +var + ResultCode: Integer; +begin + Exec('taskkill', '/F /IM {#MyAppExeName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); + Result := ''; +end; + [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Filename: "{app}\{#MyAppExeName}"; Flags: nowait skipifnotsilent diff --git a/src/utils/network/updater.py b/src/utils/network/updater.py index 118cb4d..c07b585 100644 --- a/src/utils/network/updater.py +++ b/src/utils/network/updater.py @@ -1,4 +1,5 @@ from network.direct_download.handle import DirectDownloadHandle +from utils.general.shutdown import closehelper from utils.logging.logs import consoleLog from utils.data.state import state from PySide6.QtCore import Qt @@ -91,6 +92,7 @@ def download_update(assets: list): progress.setValue(100) QtWidgets.QApplication.processEvents() + closehelper() subprocess.Popen([installer_path, "/VERYSILENT", "/SUPPRESSMSGBOXES", "/SP-", "/CLOSEAPPLICATIONS"]) time.sleep(1) - sys.exit(0) \ No newline at end of file + os._exit(0) \ No newline at end of file