mirror of
https://github.com/4sval/FModel.git
synced 2026-07-02 00:02:32 -05:00
Adjust windows version name detection
Fixes Windows 11 being improperly identified as Windows 10
This commit is contained in:
parent
b88f288a11
commit
75f8681043
|
|
@ -26,6 +26,10 @@ namespace FModel
|
|||
[DllImport("kernel32.dll")]
|
||||
private static extern bool AttachConsole(int dwProcessId);
|
||||
|
||||
[DllImport("winbrand.dll", CharSet = CharSet.Unicode)]
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
|
||||
static extern string BrandingFormatString(string format);
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
#if DEBUG
|
||||
|
|
@ -133,7 +137,7 @@ namespace FModel
|
|||
var productName = string.Empty;
|
||||
try
|
||||
{
|
||||
productName = GetRegistryValue(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName", RegistryHive.LocalMachine);
|
||||
productName = BrandingFormatString("%WINDOWS_LONG%");
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user