Fix tray blocking updates

This commit is contained in:
WhatFox
2015-11-10 22:18:58 +00:00
parent ee8464219f
commit a134a77b9f
2 changed files with 8 additions and 7 deletions

View File

@@ -21,8 +21,8 @@ namespace Jackett.Updater
private void Run(string[] args) private void Run(string[] args)
{ {
Console.WriteLine("Jackett Updater v" + GetCurrentVersion()); Engine.Logger.Info("Jackett Updater v" + GetCurrentVersion());
Console.WriteLine("Waiting for Jackett to close.."); Engine.Logger.Info("Waiting for Jackett to close..");
Thread.Sleep(2000); Thread.Sleep(2000);
try { try {
@@ -33,14 +33,13 @@ namespace Jackett.Updater
} }
else else
{ {
Console.WriteLine("Failed to process update arguments!: " + string.Join(" ", args)); Engine.Logger.Error("Failed to process update arguments!: " + string.Join(" ", args));
Console.ReadKey(); Console.ReadKey();
} }
} }
catch (Exception e) catch (Exception e)
{ {
Console.WriteLine("Exception applying update: " + e.Message); Engine.Logger.Error(e, "Exception applying update!");
Console.ReadKey();
} }
} }
@@ -70,7 +69,7 @@ namespace Jackett.Updater
{ {
try try
{ {
Console.WriteLine("Killing tray process " + proc.Id); Engine.Logger.Info("Killing tray process " + proc.Id);
proc.Kill(); proc.Kill();
trayRunning = true; trayRunning = true;
} }
@@ -91,7 +90,7 @@ namespace Jackett.Updater
continue; continue;
} }
Console.WriteLine("Copying " + fileName); Engine.Logger.Info("Copying " + fileName);
var dest = Path.Combine(options.Path, file.Substring(updateLocation.Length)); var dest = Path.Combine(options.Path, file.Substring(updateLocation.Length));
File.Copy(file, dest, true); File.Copy(file, dest, true);
} }
@@ -130,6 +129,7 @@ namespace Jackett.Updater
startInfo.FileName = "mono"; startInfo.FileName = "mono";
} }
Engine.Logger.Info("Starting Jackett: " + startInfo.FileName + " " + startInfo.Arguments);
Process.Start(startInfo); Process.Start(startInfo);
} }
} }

View File

@@ -223,6 +223,7 @@ namespace Jackett.Services
var procInfo = Process.Start(startInfo); var procInfo = Process.Start(startInfo);
logger.Info($"Updater started process id: {procInfo.Id}"); logger.Info($"Updater started process id: {procInfo.Id}");
logger.Info("Exiting Jackett..");
Environment.Exit(0); Environment.Exit(0);
} }
} }