diff --git a/StabilityMatrix.Avalonia/Assets.cs b/StabilityMatrix.Avalonia/Assets.cs index 8e11c868b..c5d6def85 100644 --- a/StabilityMatrix.Avalonia/Assets.cs +++ b/StabilityMatrix.Avalonia/Assets.cs @@ -25,6 +25,11 @@ internal static class Assets public static AvaloniaResource LicensesJson => new( "avares://StabilityMatrix.Avalonia/Assets/licenses.json"); + private const UnixFileMode unix755 = UnixFileMode.UserRead | UnixFileMode.UserWrite | + UnixFileMode.UserExecute | UnixFileMode.GroupRead | + UnixFileMode.GroupExecute | UnixFileMode.OtherRead | + UnixFileMode.OtherExecute; + [SupportedOSPlatform("windows")] [SupportedOSPlatform("linux")] [SupportedOSPlatform("macos")] @@ -32,9 +37,9 @@ internal static class Assets (PlatformKind.Windows, new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/win-x64/7za.exe")), (PlatformKind.Linux | PlatformKind.X64, - new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs", (UnixFileMode) 0777)), + new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/linux-x64/7zzs", unix755)), (PlatformKind.MacOS | PlatformKind.Arm, - new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/macos-arm64/7zz", (UnixFileMode) 0x777))); + new AvaloniaResource("avares://StabilityMatrix.Avalonia/Assets/macos-arm64/7zz", unix755))); [SupportedOSPlatform("windows")] [SupportedOSPlatform("linux")] 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...";