installer: switch to taskkill. resolves #12780 (#12852)

This commit is contained in:
ilike2burnthing 2022-01-18 15:56:18 +00:00 committed by GitHub
parent cd2198bfe1
commit d99fd72269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 8 deletions

View File

@ -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;