-
Notifications
You must be signed in to change notification settings - Fork 2
Fix Windows 11 OS detection and Windows Server compatibility in validation reports #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,10 +36,28 @@ public string FriendlyName | |
| { | ||
| var productName = registryHKLMValue(WINDOWS_REG_KEY, "ProductName"); | ||
| var version = registryHKLMValue(WINDOWS_REG_KEY, "CSDVersion"); | ||
| var currentBuildNumber = registryHKLMValue(WINDOWS_REG_KEY, "CurrentBuildNumber"); | ||
| var displayVersion = registryHKLMValue(WINDOWS_REG_KEY, "DisplayVersion"); | ||
|
|
||
| if (string.IsNullOrEmpty(productName)) | ||
| return Environment.OSVersion.VersionString; | ||
|
|
||
| // Windows 11 detection: Build number 22000 and above indicates Windows 11 | ||
| // But only apply this to client Windows, not Windows Server editions | ||
| if (!string.IsNullOrEmpty(currentBuildNumber) && int.TryParse(currentBuildNumber, out var buildNumber) && buildNumber >= 22000 | ||
| && !productName.ToLower().Contains("server")) | ||
|
Yuri05 marked this conversation as resolved.
|
||
| { | ||
| var windows11Name = "Windows 11"; | ||
|
|
||
| // Use DisplayVersion for Windows 11 version info if available | ||
| if (!string.IsNullOrEmpty(displayVersion)) | ||
| { | ||
| windows11Name += $" {displayVersion}"; | ||
| } | ||
|
|
||
| return windows11Name; | ||
|
Comment on lines
+50
to
+58
|
||
| } | ||
|
|
||
| var info = new[] | ||
| { | ||
| productName, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.