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