AdvancedLauncher.Tools.OsVersionInfo.IsWindows10OrGreater C# (CSharp) Method

IsWindows10OrGreater() public static method

public static IsWindows10OrGreater ( ) : bool
return bool
        public static bool IsWindows10OrGreater()
        {
            try {
                var wmi = new ManagementObjectSearcher("select * from Win32_OperatingSystem").Get().Cast<ManagementObject>().First();
                Version version = new Version((string)wmi["Version"]);
                return version.Major >= 10;
            } catch (Exception) {
                return false;
            }
        }