mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 09:00:13 +00:00
Fix Windows builds
This commit is contained in:
@@ -33,7 +33,6 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using ArchiSteamFarm.JSON;
|
||||
using ArchiSteamFarm.Localization;
|
||||
using Mono.Unix;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class ASF {
|
||||
@@ -214,11 +213,7 @@ namespace ArchiSteamFarm {
|
||||
if (IsUnixVersion(version)) {
|
||||
string executable = Path.Combine(targetDirectory, SharedInfo.AssemblyName);
|
||||
if (File.Exists(executable)) {
|
||||
if (UnixFileSystemInfo.TryGetFileSystemEntry(executable, out UnixFileSystemInfo entry)) {
|
||||
if (!entry.FileAccessPermissions.HasFlag(FileAccessPermissions.UserExecute)) {
|
||||
entry.FileAccessPermissions = entry.FileAccessPermissions | FileAccessPermissions.UserExecute;
|
||||
}
|
||||
}
|
||||
OS.UnixSetFileAccessExecutable(executable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ArchiSteamFarm.Localization;
|
||||
using Mono.Unix;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class OS {
|
||||
@@ -44,6 +46,16 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
internal static void UnixSetFileAccessExecutable(string path) {
|
||||
if (!File.Exists(path) || !UnixFileSystemInfo.TryGetFileSystemEntry(path, out UnixFileSystemInfo entry)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!entry.FileAccessPermissions.HasFlag(FileAccessPermissions.UserExecute)) {
|
||||
entry.FileAccessPermissions = entry.FileAccessPermissions | FileAccessPermissions.UserExecute;
|
||||
}
|
||||
}
|
||||
|
||||
private static void DisableQuickEditMode() {
|
||||
// http://stackoverflow.com/questions/30418886/how-and-why-does-quickedit-mode-in-command-prompt-freeze-applications
|
||||
IntPtr consoleHandle = NativeMethods.GetStdHandle(NativeMethods.StandardInputHandle);
|
||||
|
||||
Reference in New Issue
Block a user