mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
@@ -377,7 +377,11 @@ namespace ArchiSteamFarm.Core {
|
||||
return null;
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
#else
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
#endif
|
||||
string executable = Path.Combine(SharedInfo.HomeDirectory, SharedInfo.AssemblyName);
|
||||
|
||||
if (File.Exists(executable)) {
|
||||
|
||||
@@ -141,8 +141,12 @@ namespace ArchiSteamFarm.Core {
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
#if NETFRAMEWORK
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
return;
|
||||
#else
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD) && !RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
#endif
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
if (!File.Exists(path) && !Directory.Exists(path)) {
|
||||
@@ -201,7 +205,7 @@ namespace ArchiSteamFarm.Core {
|
||||
|
||||
private static void WindowsDisableQuickEditMode() {
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
|
||||
return;
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
IntPtr consoleHandle = NativeMethods.GetStdHandle(NativeMethods.StandardInputHandle);
|
||||
@@ -221,7 +225,7 @@ namespace ArchiSteamFarm.Core {
|
||||
|
||||
private static void WindowsKeepSystemActive() {
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
|
||||
return;
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
|
||||
// This function calls unmanaged API in order to tell Windows OS that it should not enter sleep state while the program is running
|
||||
|
||||
@@ -174,7 +174,11 @@ namespace ArchiSteamFarm.Helpers {
|
||||
// Non-critical, user might have no rights to manage the resource
|
||||
ASF.ArchiLogger.LogGenericDebuggingException(e);
|
||||
}
|
||||
} else {
|
||||
#if NETFRAMEWORK
|
||||
} else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
#else
|
||||
} else if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
#endif
|
||||
OS.UnixSetFileAccess(directoryPath!, OS.EUnixPermission.Combined777);
|
||||
}
|
||||
}
|
||||
@@ -195,7 +199,11 @@ namespace ArchiSteamFarm.Helpers {
|
||||
// Non-critical, user might have no rights to manage the resource
|
||||
ASF.ArchiLogger.LogGenericDebuggingException(e);
|
||||
}
|
||||
} else {
|
||||
#if NETFRAMEWORK
|
||||
} else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
#else
|
||||
} else if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
#endif
|
||||
OS.UnixSetFileAccess(FilePath, OS.EUnixPermission.Combined777);
|
||||
}
|
||||
} catch (IOException) {
|
||||
|
||||
Reference in New Issue
Block a user