File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1717using Application = System . Windows . Forms . Application ;
1818using Rubberduck . SettingsProvider ;
1919using System . IO . Abstractions ;
20+ using Microsoft . Win32 ;
2021
2122namespace Rubberduck
2223{
@@ -231,11 +232,22 @@ public void LogRubberduckStart()
231232 {
232233 var version = _version . CurrentVersion ;
233234 GlobalDiagnosticsContext . Set ( "RubberduckVersion" , version . ToString ( ) ) ;
235+ string osProductName = "" ;
236+ string osReleaseId = "" ;
237+ try
238+ {
239+ osProductName = Registry . GetValue ( @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" , "ProductName" , "" ) . ToString ( ) ;
240+ osReleaseId = Registry . GetValue ( @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" , "ReleaseId" , "" ) . ToString ( ) ;
241+ }
242+ catch
243+ {
244+ Logger . Debug ( "Failure to read OS version from registry. Logged version will be incomplete." ) ;
245+ }
234246
235247 var headers = new List < string >
236248 {
237249 $ "\r \n \t Rubberduck version { version } loading:",
238- $ "\t Operating System: { Environment . OSVersion . VersionString } { ( Environment . Is64BitOperatingSystem ? "x64" : "x86" ) } "
250+ $ "\t Operating System: { osProductName } { osReleaseId } { ( Environment . Is64BitOperatingSystem ? "x64" : "x86" ) } ( { Environment . OSVersion . VersionString } ) "
239251 } ;
240252 try
241253 {
You can’t perform that action at this time.
0 commit comments