mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-11-21 17:40:52 +01:00
UI: Updater: Remove Avalonia migration code.
This commit is contained in:
parent
75035b3231
commit
a09d314817
1 changed files with 3 additions and 41 deletions
|
@ -1,6 +1,7 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Threading;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
using Gommon;
|
||||
using ICSharpCode.SharpZipLib.GZip;
|
||||
using ICSharpCode.SharpZipLib.Tar;
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
|
@ -763,47 +764,8 @@ namespace Ryujinx.Modules
|
|||
|
||||
public static void CleanupUpdate()
|
||||
{
|
||||
foreach (string file in Directory.GetFiles(_homeDir, "*.ryuold", SearchOption.AllDirectories))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
Directory.GetFiles(_homeDir, "*.ryuold", SearchOption.AllDirectories)
|
||||
.ForEach(File.Delete);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue