Adjust windows version name detection

Fixes Windows 11 being improperly identified as Windows 10
This commit is contained in:
GMatrixGames 2022-05-19 23:05:22 -04:00
parent b88f288a11
commit 75f8681043

View File

@ -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
{