This commit is contained in:
Jamie.Rees 2017-03-10 16:30:05 +00:00
parent 706fc94eb3
commit f7f66d4c11
22 changed files with 789 additions and 41 deletions

View file

@ -35,6 +35,7 @@ using MarkdownSharp;
using Nancy;
using Nancy.ModelBinding;
using Nancy.Responses.Negotiation;
using Ombi.Common.Processes;
using Ombi.Core;
using Ombi.Core.SettingModels;
using Ombi.Core.StatusChecker;
@ -123,7 +124,7 @@ namespace Ombi.UI.Modules.Admin
var url = Request.Form["url"];
var args = (string)Request.Form["args"].ToString();
var lowered = args.ToLower();
var appPath = Path.Combine(Path.GetDirectoryName(Assembly.GetAssembly(typeof(SystemStatusModule)).Location ?? string.Empty) ?? string.Empty, "Ombi.Updater.exe");
var appPath = Path.Combine(Path.GetDirectoryName(Assembly.GetAssembly(typeof(SystemStatusModule)).Location ?? string.Empty) ?? string.Empty, Path.Combine("UpdateService", "Ombi.Updater.exe"));
if (!string.IsNullOrEmpty(lowered))
{
@ -133,7 +134,7 @@ namespace Ombi.UI.Modules.Admin
}
}
var startArgs = string.IsNullOrEmpty(lowered) ? appPath : $"{lowered} Ombi.Updater.exe";
var startArgs = string.IsNullOrEmpty(lowered) || lowered == "Nancy.DynamicDictionaryValue".ToLower() ? appPath : $"{lowered} Ombi.Updater.exe";
var startInfo = Type.GetType("Mono.Runtime") != null
? new ProcessStartInfo(startArgs) { Arguments = $"{url} {lowered}", }
@ -141,7 +142,7 @@ namespace Ombi.UI.Modules.Admin
Process.Start(startInfo);
Environment.Exit(0);
//Environment.Exit(0);
return Nancy.Response.NoBody;
}