@@ -100,6 +100,16 @@ public static string GetSystemDetails()
100
100
modDatabase . AddOrUpdateConfig ( ConfigObj ) ;
101
101
SystemDetailsJSON = SystemDetailsJSON + JsonSerializer . Serialize ( ConfigObj ) + "," ;
102
102
103
+ RegistryKey currentVersion = Registry . LocalMachine . OpenSubKey ( @"SOFTWARE\MICROSOFT\Windows NT\CurrentVersion" ) ;
104
+
105
+ ConfigObj = new modDatabase . Config { Key = "System_LastKnownWindowsVersion" , Value = currentVersion . GetValue ( "CurrentMajorVersionNumber" ) . ToString ( ) + "." + currentVersion . GetValue ( "CurrentMinorVersionNumber" ) . ToString ( ) + "." + currentVersion . GetValue ( "CurrentBuild" ) . ToString ( ) + "." + currentVersion . GetValue ( "UBR" ) . ToString ( ) } ;
106
+ modDatabase . AddOrUpdateConfig ( ConfigObj ) ;
107
+ SystemDetailsJSON = SystemDetailsJSON + JsonSerializer . Serialize ( ConfigObj ) + "," ;
108
+
109
+ ConfigObj = new modDatabase . Config { Key = "System_OSProductName" , Value = currentVersion . GetValue ( "ProductName" ) . ToString ( ) } ;
110
+ modDatabase . AddOrUpdateConfig ( ConfigObj ) ;
111
+ SystemDetailsJSON = SystemDetailsJSON + JsonSerializer . Serialize ( ConfigObj ) + "," ;
112
+
103
113
RegistryKey systemHardware = Registry . LocalMachine . OpenSubKey ( @"HARDWARE\DESCRIPTION\System\BIOS" ) ;
104
114
105
115
ConfigObj = new modDatabase . Config { Key = "System_BaseBoardManufacturer" , Value = systemHardware . GetValue ( "BaseBoardManufacturer" ) . ToString ( ) } ;
@@ -164,34 +174,6 @@ public static string GetSystemDetails()
164
174
}
165
175
}
166
176
167
- /// <summary>
168
- /// Gets a full Windows build number from the registry
169
- /// </summary>
170
- /// <returns>(string) Build number</returns>
171
- public static string GetWindowsVersion ( )
172
- {
173
- try
174
- {
175
- RegistryKey currentVersion = Registry . LocalMachine . OpenSubKey ( @"SOFTWARE\MICROSOFT\Windows NT\CurrentVersion" ) ;
176
- string currentWindowsVersion = currentVersion . GetValue ( "CurrentMajorVersionNumber" ) . ToString ( ) + "." + currentVersion . GetValue ( "CurrentMinorVersionNumber" ) . ToString ( ) + "." + currentVersion . GetValue ( "CurrentBuild" ) . ToString ( ) + "." + currentVersion . GetValue ( "UBR" ) . ToString ( ) ;
177
- string productName = currentVersion . GetValue ( "ProductName" ) . ToString ( ) ;
178
-
179
- string oldWindowsVersion = modDatabase . GetConfig ( "System_LastKnownWindowsVersion" ) ;
180
- if ( oldWindowsVersion != currentWindowsVersion )
181
- {
182
- modDatabase . AddOrUpdateConfig ( new modDatabase . Config { Key = "System_LastKnownWindowsVersion" , Value = currentWindowsVersion } ) ;
183
- modDatabase . AddOrUpdateConfig ( new modDatabase . Config { Key = "System_OSProductName" , Value = productName } ) ;
184
- }
185
-
186
- return currentWindowsVersion ;
187
- }
188
- catch ( Exception err )
189
- {
190
- modLogging . LogEvent ( "Unable to get registry information: " + err . Message + "\n \n " + err . StackTrace , EventLogEntryType . Error , 6032 ) ;
191
- return "Registry error" ;
192
- }
193
- }
194
-
195
177
/// <summary>
196
178
/// Reboots the host computer
197
179
/// </summary>
0 commit comments