From d99fd722693b337d78ef71043418e2591aa36046 Mon Sep 17 00:00:00 2001 From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> Date: Tue, 18 Jan 2022 15:56:18 +0000 Subject: [PATCH] installer: switch to taskkill. resolves #12780 (#12852) --- Installer.iss | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Installer.iss b/Installer.iss index 02a8e2f6a..3f4c5ce59 100644 --- a/Installer.iss +++ b/Installer.iss @@ -19,9 +19,6 @@ AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} -CloseApplications=yes -CloseApplicationsFilter=*.chm -RestartApplications=no DefaultDirName={commonappdata}\{#MyAppName} DefaultGroupName={#MyAppName} DisableProgramGroupPage=yes @@ -52,11 +49,13 @@ Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" Name: "{commondesktop}\{#MyAppName}"; Filename: "{commonappdata}\Jackett\{#MyAppExeName}"; Tasks: desktopicon [Code] -Procedure RegisterExtraCloseApplicationsResources(); -Begin - RegisterExtraCloseApplicationsResource(False, ExpandConstant('{app}\JackettService.exe')); - RegisterExtraCloseApplicationsResource(False, ExpandConstant('{app}\{#MyAppExeName}')); -End; +function PrepareToInstall(var NeedsRestart: Boolean): String; +var +ErrorCode: Integer; +begin + ShellExec('open', 'taskkill.exe', '/f /im {#MyAppExeName}', '', SW_HIDE, ewNoWait, ErrorCode); + ShellExec('open', 'taskkill.exe', '/f /im JackettConsole.exe', '', SW_HIDE, ewNoWait, ErrorCode); +end; [Run] Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Uninstall"; Flags: waituntilterminated runhidden;