diff --git a/Ryujinx/Modules/Updater/UpdateDialog.cs b/Ryujinx/Modules/Updater/UpdateDialog.cs index 193b9bc3..81727769 100644 --- a/Ryujinx/Modules/Updater/UpdateDialog.cs +++ b/Ryujinx/Modules/Updater/UpdateDialog.cs @@ -42,7 +42,7 @@ namespace Ryujinx.Modules YesButton.Clicked += YesButton_Clicked; NoButton.Clicked += NoButton_Clicked; } - + private void YesButton_Clicked(object sender, EventArgs args) { if (_restartQuery) @@ -51,12 +51,6 @@ namespace Ryujinx.Modules string ryuExe = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ryuName); string ryuArg = string.Join(" ", Environment.GetCommandLineArgs().AsEnumerable().Skip(1).ToArray()); - if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - UnixFileInfo unixFileInfo = new UnixFileInfo(ryuExe); - unixFileInfo.FileAccessPermissions |= FileAccessPermissions.UserExecute; - } - Process.Start(ryuExe, ryuArg); Environment.Exit(0); diff --git a/Ryujinx/Modules/Updater/Updater.cs b/Ryujinx/Modules/Updater/Updater.cs index b4fe3351..c7def960 100644 --- a/Ryujinx/Modules/Updater/Updater.cs +++ b/Ryujinx/Modules/Updater/Updater.cs @@ -2,6 +2,7 @@ using Gtk; using ICSharpCode.SharpZipLib.GZip; using ICSharpCode.SharpZipLib.Tar; using ICSharpCode.SharpZipLib.Zip; +using Mono.Unix; using Newtonsoft.Json.Linq; using Ryujinx.Common.Logging; using Ryujinx.Ui; @@ -325,6 +326,17 @@ namespace Ryujinx.Modules } } + private static void SetUnixPermissions() + { + string ryuBin = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ryujinx"); + + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + UnixFileInfo unixFileInfo = new UnixFileInfo(ryuBin); + unixFileInfo.FileAccessPermissions |= FileAccessPermissions.UserExecute; + } + } + private static async void InstallUpdate(UpdateDialog updateDialog, string updateFile) { // Extract Update @@ -444,6 +456,8 @@ namespace Ryujinx.Modules Directory.Delete(UpdateDir, true); + SetUnixPermissions(); + updateDialog.MainText.Text = "Update Complete!"; updateDialog.SecondaryText.Text = "Do you want to restart Ryujinx now?"; updateDialog.Modal = true;