Skip to content

Commit

Permalink
Also get OS product name
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdtrekkie committed Jul 7, 2024
1 parent 1f82ea4 commit bb05f67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ public static string GetWindowsVersion()
{
RegistryKey currentVersion = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\MICROSOFT\Windows NT\CurrentVersion");
string currentWindowsVersion = currentVersion.GetValue("CurrentMajorVersionNumber").ToString() + "." + currentVersion.GetValue("CurrentMinorVersionNumber").ToString() + "." + currentVersion.GetValue("CurrentBuild").ToString() + "." + currentVersion.GetValue("UBR").ToString();
string productName = currentVersion.GetValue("ProductName").ToString();

string oldWindowsVersion = modDatabase.GetConfig("System_LastKnownWindowsVersion");
if (oldWindowsVersion != currentWindowsVersion)
{
modDatabase.AddOrUpdateConfig(new modDatabase.Config { Key = "System_LastKnownWindowsVersion", Value = currentWindowsVersion });
modDatabase.AddOrUpdateConfig(new modDatabase.Config { Key = "System_OSProductName", Value = productName });
}

return currentWindowsVersion;
Expand Down

0 comments on commit bb05f67

Please sign in to comment.