mirror of
https://github.com/Jackett/Jackett
synced 2025-01-03 13:46:10 +00:00
Update installer so that it kills Jackett when uninstalling
This commit is contained in:
parent
44d14dc19c
commit
42728e2694
3 changed files with 22 additions and 13 deletions
|
@ -23,8 +23,8 @@ DefaultDirName={pf}\{#MyAppName}
|
|||
DefaultGroupName={#MyAppName}
|
||||
DisableProgramGroupPage=yes
|
||||
OutputBaseFilename={#MyOutputFilename}
|
||||
SetupIconFile=src\Jackett.Console\jackett.ico
|
||||
UninstallDisplayIcon={commonappdata}\Jackett\JackettConsole.exe
|
||||
SetupIconFile=src\Jackett.Tray\jackett.ico
|
||||
UninstallDisplayIcon={commonappdata}\Jackett\{#MyAppExeName}
|
||||
VersionInfoVersion={#MyAppVersion}
|
||||
UninstallDisplayName={#MyAppName}
|
||||
Compression=lzma
|
||||
|
@ -47,16 +47,16 @@ Name: "{group}\{#MyAppName}"; Filename: "{commonappdata}\Jackett\{#MyAppExeName}
|
|||
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
|
||||
Name: "{commondesktop}\{#MyAppName}"; Filename: "{commonappdata}\Jackett\{#MyAppExeName}"; Tasks: desktopicon
|
||||
|
||||
[Run]
|
||||
Filename: "{commonappdata}\Jackett\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||
|
||||
[Run]
|
||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Uninstall"; Flags: waituntilterminated runhidden;
|
||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--ReserveUrls"; Flags: waituntilterminated runhidden;
|
||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Install"; Flags: waituntilterminated runhidden; Tasks: windowsService
|
||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Start"; Flags: waituntilterminated runhidden; Tasks: windowsService
|
||||
Filename: "{commonappdata}\Jackett\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||
|
||||
[UninstallRun]
|
||||
Filename: "{commonappdata}\Jackett\JackettConsole.exe"; Parameters: "--Uninstall"; Flags: waituntilterminated skipifdoesntexist runhidden
|
||||
Filename: "{sys}\taskkill.exe"; Parameters: "/f /im {#MyAppExeName}"; Flags: waituntilterminated skipifdoesntexist runhidden
|
||||
Filename: "{sys}\taskkill.exe"; Parameters: "/f /im JackettConsole.exe"; Flags: waituntilterminated skipifdoesntexist runhidden
|
||||
|
||||
|
||||
|
|
|
@ -324,20 +324,21 @@ namespace Jackett.Common.Services
|
|||
startInfo.Arguments += " --StartTray";
|
||||
}
|
||||
|
||||
if (isWindows)
|
||||
{
|
||||
lockService.Signal();
|
||||
logger.Info("Signal sent to lock service");
|
||||
Thread.Sleep(2000);
|
||||
}
|
||||
|
||||
logger.Info($"Starting updater: {startInfo.FileName} {startInfo.Arguments}");
|
||||
var procInfo = Process.Start(startInfo);
|
||||
logger.Info($"Updater started process id: {procInfo.Id}");
|
||||
|
||||
if (!NoRestart)
|
||||
{
|
||||
if (isWindows)
|
||||
{
|
||||
logger.Info("Signal sent to lock service");
|
||||
lockService.Signal();
|
||||
Thread.Sleep(2000);
|
||||
}
|
||||
|
||||
logger.Info("Exiting Jackett..");
|
||||
|
||||
//TODO: Remove once off Owin
|
||||
if (EnvironmentUtil.IsRunningLegacyOwin)
|
||||
{
|
||||
|
|
|
@ -306,7 +306,15 @@ namespace Jackett.Updater
|
|||
UseShellExecute = true
|
||||
};
|
||||
|
||||
if (!isWindows)
|
||||
if (isWindows)
|
||||
{
|
||||
//User didn't initiate the update from Windows service and wasn't running Jackett via the tray, must have started from the console
|
||||
startInfo.Arguments = $"/K {startInfo.FileName} {startInfo.Arguments}";
|
||||
startInfo.FileName = "cmd.exe";
|
||||
startInfo.CreateNoWindow = false;
|
||||
startInfo.WindowStyle = ProcessWindowStyle.Normal;
|
||||
}
|
||||
else
|
||||
{
|
||||
startInfo.Arguments = startInfo.FileName + " " + startInfo.Arguments;
|
||||
startInfo.FileName = "mono";
|
||||
|
|
Loading…
Reference in a new issue