mirror of
https://github.com/4sval/FModel.git
synced 2026-09-13 12:06:39 -05:00
Adjust windows version name detection
Fixes Windows 11 being improperly identified as Windows 10
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user