Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/InstallationValidator.Core/Domain/OperatingSystemInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Comment thread
Yuri05 marked this conversation as resolved.
Comment thread
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

Copilot AI Sep 1, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows 11 name construction logic doesn't handle the edition information (e.g., 'Pro', 'Home') that might be present in the original productName. Consider extracting and preserving the edition part from productName to maintain consistency with the existing behavior for Windows 10 systems.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows 11 name construction logic doesn't handle the edition information (e.g., 'Pro', 'Home') that might be present in the original productName. Consider extracting and preserving the edition part from productName to maintain consistency with the existing behavior for Windows 10 systems.

@copilot Copilot, implement this suggestion

}

var info = new[]
{
productName,
Expand Down
Loading