diff --git a/src/Ryujinx/Modules/Updater/Updater.cs b/src/Ryujinx/Modules/Updater/Updater.cs index 2f0bd8b3b..b87751b4e 100644 --- a/src/Ryujinx/Modules/Updater/Updater.cs +++ b/src/Ryujinx/Modules/Updater/Updater.cs @@ -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); } } }