0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2024-12-22 23:55:47 +00:00

UI: Updater: Remove Avalonia migration code.

This commit is contained in:
Evan Husted 2024-10-26 03:26:09 -05:00
parent 75035b3231
commit a09d314817

View file

@ -1,6 +1,7 @@
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Threading; using Avalonia.Threading;
using FluentAvalonia.UI.Controls; using FluentAvalonia.UI.Controls;
using Gommon;
using ICSharpCode.SharpZipLib.GZip; using ICSharpCode.SharpZipLib.GZip;
using ICSharpCode.SharpZipLib.Tar; using ICSharpCode.SharpZipLib.Tar;
using ICSharpCode.SharpZipLib.Zip; using ICSharpCode.SharpZipLib.Zip;
@ -763,47 +764,8 @@ namespace Ryujinx.Modules
public static void CleanupUpdate() public static void CleanupUpdate()
{ {
foreach (string file in Directory.GetFiles(_homeDir, "*.ryuold", SearchOption.AllDirectories)) Directory.GetFiles(_homeDir, "*.ryuold", SearchOption.AllDirectories)
{ .ForEach(File.Delete);
File.Delete(file);
}
// Migration: Delete old Ryujinx binary.
// TODO: Remove this in a future update.
if (!OperatingSystem.IsMacOS())
{
string[] oldRyuFiles = Directory.GetFiles(_homeDir, "Ryujinx.Ava*", SearchOption.TopDirectoryOnly);
// Assume we are running the new one if the process path is not available.
// This helps to prevent an infinite loop of restarts.
string currentRyuName = Path.GetFileName(Environment.ProcessPath) ?? (OperatingSystem.IsWindows() ? "Ryujinx.exe" : "Ryujinx");
string newRyuName = Path.Combine(_homeDir, currentRyuName.Replace(".Ava", ""));
if (!currentRyuName.Contains("Ryujinx.Ava"))
{
foreach (string oldRyuFile in oldRyuFiles)
{
File.Delete(oldRyuFile);
}
}
// Should we be running the old binary, start the new one if possible.
else if (File.Exists(newRyuName))
{
ProcessStartInfo processStart = new(newRyuName)
{
UseShellExecute = true,
WorkingDirectory = _homeDir,
};
foreach (string argument in CommandLineState.Arguments)
{
processStart.ArgumentList.Add(argument);
}
Process.Start(processStart);
Environment.Exit(0);
}
}
} }
} }
} }