Skip to content

Commit

Permalink
Fixed #898
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie.Rees authored and Jamie.Rees committed Jan 9, 2017
1 parent 98a91fa commit ba3db7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Ombi.UI/Modules/Admin/SystemStatusModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ private Response AutoUpdate()
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, "PlexRequests.Updater.exe");
var appPath = Path.Combine(Path.GetDirectoryName(Assembly.GetAssembly(typeof(SystemStatusModule)).Location ?? string.Empty) ?? string.Empty, "Ombi.Updater.exe");

if (!string.IsNullOrEmpty(lowered))
{
if (lowered.Contains("plexrequests.exe"))
if (lowered.Contains("ombi.exe"))
{
lowered = lowered.Replace("plexrequests.exe", "");
lowered = lowered.Replace("ombi.exe", "");
}
}

var startArgs = string.IsNullOrEmpty(lowered) ? appPath : $"{lowered} Plexrequests.Updater.exe";
var startArgs = string.IsNullOrEmpty(lowered) ? appPath : $"{lowered} Ombi.Updater.exe";

var startInfo = Type.GetType("Mono.Runtime") != null
? new ProcessStartInfo(startArgs) { Arguments = $"{url} {lowered}", }
Expand Down
10 changes: 5 additions & 5 deletions Ombi.Updater/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void RestoreBackup()
}
else
{
if (entry.Name.Contains("PlexRequests.Updater"))
if (entry.Name.Contains("Ombi.Updater"))
{
entry.ExtractToFile(fullPath + "_Updated", true);
continue;
Expand All @@ -75,7 +75,7 @@ public void Start(string downloadPath, string launchOptions)
{
BackupCurrentVersion();
var dir = CreateTempPath();
TempPath = Path.Combine(dir.FullName, "PlexRequestsUpdate.zip");
TempPath = Path.Combine(dir.FullName, "OmbiUpdate.zip");

CheckAndDelete(TempPath);
Console.WriteLine("Downloading new version");
Expand Down Expand Up @@ -109,7 +109,7 @@ public void Start(string downloadPath, string launchOptions)
}
else
{
if (entry.Name.Contains("PlexRequests.Updater"))
if (entry.Name.Contains("Ombi.Updater"))
{
entry.ExtractToFile(fullPath + "_Updated", true);
continue;
Expand Down Expand Up @@ -150,7 +150,7 @@ private void BackupCurrentVersion()
var dir = Directory.CreateDirectory(Path.Combine(applicationPath, "BackupSystem"));

var allfiles = Directory.GetFiles(applicationPath, "*.*", SearchOption.AllDirectories);
BackupPath = Path.Combine(dir.FullName, "PlexRequestsBackup.zip");
BackupPath = Path.Combine(dir.FullName, "OmbiBackup.zip");

CheckAndDelete(BackupPath);
using (var fileStream = new FileStream(BackupPath, FileMode.CreateNew))
Expand Down Expand Up @@ -202,7 +202,7 @@ private DirectoryInfo CreateTempPath()
private void FinishUpdate(string launchOptions)
{
var args = Error ? "-u 2" : "-u 1";
var startInfo = new ProcessStartInfo($"{launchOptions}PlexRequests.exe") { Arguments = args, UseShellExecute = true };
var startInfo = new ProcessStartInfo($"{launchOptions}Ombi.exe") { Arguments = args, UseShellExecute = true };

Process.Start(startInfo);

Expand Down

0 comments on commit ba3db7b

Please sign in to comment.