updater: Removed admin rights requirement to start service on Windows when Jackett updates. (#9320)

This commit is contained in:
ultnrg
2020-09-12 10:25:27 +10:00
committed by GitHub
parent b6fab0b78b
commit 25f2b8534b

View File

@@ -480,12 +480,13 @@ namespace Jackett.Updater
{ {
logger.Info("Starting Windows service"); logger.Info("Starting Windows service");
if (ServerUtil.IsUserAdministrator()) try
{ {
windowsService.Start(); windowsService.Start();
} }
else catch
{ {
logger.Info("Failed to start service. Attempting to start console.");
try try
{ {
var consolePath = Path.Combine(options.Path, "JackettConsole.exe"); var consolePath = Path.Combine(options.Path, "JackettConsole.exe");
@@ -493,7 +494,7 @@ namespace Jackett.Updater
} }
catch catch
{ {
logger.Error("Failed to get admin rights to start the service."); logger.Error("Failed to start the service or console.");
} }
} }
} }