using Pilz.Runtime; using System.Diagnostics; namespace Pilz.Win32; 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; } }