Removed unused (incorrect for Mac) code in the reboot class

This commit is contained in:
Vova 2025-02-24 19:27:29 +10:00
parent 5b84231dbb
commit 422c2279be

View File

@ -42,52 +42,33 @@ namespace Ryujinx.Ava
List<string> arguments = CommandLineState.Arguments.ToList(); List<string> arguments = CommandLineState.Arguments.ToList();
string executableDirectory = AppDomain.CurrentDomain.BaseDirectory; string executableDirectory = AppDomain.CurrentDomain.BaseDirectory;
// On macOS we perform the update at relaunch. var dialogTask = taskDialog.ShowAsync(true);
if (OperatingSystem.IsMacOS()) await Task.Delay(500);
// Find the process name.
string ryuName = Path.GetFileName(Environment.ProcessPath) ?? string.Empty;
// Fallback if the executable could not be found.
if (ryuName.Length == 0 || !Path.Exists(Path.Combine(executableDirectory, ryuName)))
{ {
string baseBundlePath = Path.GetFullPath(Path.Combine(executableDirectory, "..", "..")); ryuName = OperatingSystem.IsWindows() ? "Ryujinx.exe" : "Ryujinx";
string newBundlePath = Path.Combine(_updateDir, "Ryujinx.app");
string updaterScriptPath = Path.Combine(newBundlePath, "Contents", "Resources", "updater.sh");
string currentPid = Environment.ProcessId.ToString();
arguments.InsertRange(0, new List<string> { updaterScriptPath, baseBundlePath, newBundlePath, currentPid });
Process.Start("/bin/bash", arguments);
} }
else
ProcessStartInfo processStart = new(ryuName)
{ {
var dialogTask = taskDialog.ShowAsync(true); UseShellExecute = true,
await Task.Delay(500); WorkingDirectory = executableDirectory,
};
// Find the process name. foreach (var arg in args)
string ryuName = Path.GetFileName(Environment.ProcessPath) ?? string.Empty; {
processStart.ArgumentList.Add(arg);
// Some operating systems can see the renamed executable, so strip off the .ryuold if found.
if (ryuName.EndsWith(".ryuold"))
{
ryuName = ryuName[..^7];
}
// Fallback if the executable could not be found.
if (ryuName.Length == 0 || !Path.Exists(Path.Combine(executableDirectory, ryuName)))
{
ryuName = OperatingSystem.IsWindows() ? "Ryujinx.exe" : "Ryujinx";
}
ProcessStartInfo processStart = new(ryuName)
{
UseShellExecute = true,
WorkingDirectory = executableDirectory,
};
foreach (var arg in args)
{
processStart.ArgumentList.Add(arg);
}
processStart.ArgumentList.Add(gamePath);
Process.Start(processStart);
} }
processStart.ArgumentList.Add(gamePath);
Process.Start(processStart);
Environment.Exit(0); Environment.Exit(0);
} }
} }