Skip to content

Commit

Permalink
I would love to leave this as a Registry only app but as there is no …
Browse files Browse the repository at this point in the history
…mention of "Windows 11" anywhere in the Registry on the Insider Preview builds and msinfo32 is picking it up correctly, I'm hedging for now. If retleased Windows 11 updates the ProductName in the registry, I'll revert this change
  • Loading branch information
randyrants committed Sep 10, 2021
1 parent 1875cce commit 12ccbf5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions WinVerEx/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
11 changes: 9 additions & 2 deletions WinVerEx/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Management;
using Microsoft.Win32;

namespace WinVerEx
Expand All @@ -8,8 +9,14 @@ class Program
static void Main(string[] args)
{
// Get the friendly name of Windows
String queriedOSName = System.Environment.OSVersion.Platform.ToString();

String queriedOSName = String.Empty;
ManagementObjectSearcher managementObjectSearcher = new ManagementObjectSearcher("SELECT Caption FROM Win32_OperatingSystem");
foreach (ManagementObject managementObject in managementObjectSearcher.Get())
{
queriedOSName = managementObject["Caption"].ToString();
break;
}

// All of the data we're looking for lives under the same Registry Key
RegistryKey currentVersion = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows NT\CurrentVersion");

Expand Down

0 comments on commit 12ccbf5

Please sign in to comment.