From d03e47aeeb51d90e9fedd97ea6890426bf30c4a3 Mon Sep 17 00:00:00 2001 From: Jacob McSwain Date: Fri, 1 Sep 2023 15:10:58 -0500 Subject: [PATCH] Fix other erroneous casts of UnixFileMode --- StabilityMatrix.Avalonia/Program.cs | 6 +++++- .../ViewModels/Dialogs/UpdateViewModel.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/StabilityMatrix.Avalonia/Program.cs b/StabilityMatrix.Avalonia/Program.cs index c693b2243..0c2ba3864 100644 --- a/StabilityMatrix.Avalonia/Program.cs +++ b/StabilityMatrix.Avalonia/Program.cs @@ -107,7 +107,11 @@ private static void HandleUpdateReplacement() // Ensure permissions are set for unix if (Compat.IsUnix) { - File.SetUnixFileMode(targetExe, (UnixFileMode) 0x755); + File.SetUnixFileMode(targetExe, // 0755 + UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute); } // Start the new app diff --git a/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs index 22a6b9ab0..02e4d213c 100644 --- a/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/Dialogs/UpdateViewModel.cs @@ -97,7 +97,11 @@ private async Task InstallUpdate() // On unix, we need to set the executable bit if (Compat.IsUnix) { - File.SetUnixFileMode(UpdateHelper.ExecutablePath, (UnixFileMode) 0x755); + File.SetUnixFileMode(UpdateHelper.ExecutablePath, // 0755 + UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute); } UpdateText = "Update complete. Restarting Stability Matrix in 3 seconds...";