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 17
17
using Application = System . Windows . Forms . Application ;
18
18
using Rubberduck . SettingsProvider ;
19
19
using System . IO . Abstractions ;
20
+ using Microsoft . Win32 ;
20
21
21
22
namespace Rubberduck
22
23
{
@@ -231,11 +232,22 @@ public void LogRubberduckStart()
231
232
{
232
233
var version = _version . CurrentVersion ;
233
234
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
+ }
234
246
235
247
var headers = new List < string >
236
248
{
237
249
$ "\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 } ) "
239
251
} ;
240
252
try
241
253
{
You can’t perform that action at this time.
0 commit comments