From 57c4765fab512d6586ca0fd81f72b0cf3c654229 Mon Sep 17 00:00:00 2001 From: flightlevel Date: Fri, 20 Nov 2015 20:58:13 +1100 Subject: [PATCH] Autoupdater: Mono fix Autoupdater: Mono fix --- src/Jackett/Services/UpdateService.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Jackett/Services/UpdateService.cs b/src/Jackett/Services/UpdateService.cs index 7c85a02c9..6b6c718f8 100644 --- a/src/Jackett/Services/UpdateService.cs +++ b/src/Jackett/Services/UpdateService.cs @@ -235,18 +235,25 @@ namespace Jackett.Services var exe = Path.GetFileName(ExePath()).ToLowerInvariant(); var args = string.Join(" ", Environment.GetCommandLineArgs().Skip(1)); - if (!isWindows) + var startInfo = new ProcessStartInfo(); + + if (isWindows) + { + startInfo.Arguments = $"--Path \"{installLocation}\" --Type \"{exe}\" --Args \"{args}\""; + startInfo.FileName = Path.Combine(updaterExePath); + } + else { // Wrap mono args = exe + " " + args; exe = "mono"; + + startInfo.Arguments = $"{Path.Combine(updaterExePath)} --Path \"{installLocation}\" --Type \"{exe}\" --Args \"{args}\""; + startInfo.FileName = "mono"; + startInfo.UseShellExecute = false; + startInfo.CreateNoWindow = true; } - var startInfo = new ProcessStartInfo() - { - Arguments = $"--Path \"{installLocation}\" --Type \"{exe}\" --Args \"{args}\"", - FileName = Path.Combine(updaterExePath) - }; var procInfo = Process.Start(startInfo); logger.Info($"Updater started process id: {procInfo.Id}");