make some projects compatible with netframework4.8 again

This commit is contained in:
2025-02-11 07:18:14 +01:00
parent f08c94908a
commit 07ab60666a
32 changed files with 57 additions and 55 deletions

View File

@@ -8,8 +8,10 @@ public static class NativeTools
[Obsolete("Use \"Environment.ProcessPath\" instead.")]
public static string GetExecutablePath(bool checkRealOS = false)
{
#if NET8_0_OR_GREATER
if (RuntimeInformationsEx.IsOSPlatform(OSType.Windows, checkRealOS))
return Environment.ProcessPath;
#endif
return Process.GetCurrentProcess().MainModule.FileName;
}
}