@@ -127,23 +127,17 @@ public string FindGitExecutable()
127127 Microsoft . Win32 . RegistryHive . LocalMachine ,
128128 Microsoft . Win32 . RegistryView . Registry64 ) ;
129129
130- var git = reg . OpenSubKey ( "SOFTWARE\ \ GitForWindows" ) ;
130+ var git = reg . OpenSubKey ( @ "SOFTWARE\GitForWindows") ;
131131 if ( git ? . GetValue ( "InstallPath" ) is string installPath )
132- {
133132 return Path . Combine ( installPath , "bin" , "git.exe" ) ;
134- }
135133
136134 var builder = new StringBuilder ( "git.exe" , 259 ) ;
137135 if ( ! PathFindOnPath ( builder , null ) )
138- {
139136 return null ;
140- }
141137
142138 var exePath = builder . ToString ( ) ;
143139 if ( ! string . IsNullOrEmpty ( exePath ) )
144- {
145140 return exePath ;
146- }
147141
148142 return null ;
149143 }
@@ -299,9 +293,7 @@ private string FindVSCode()
299293 // VSCode (system)
300294 var systemVScode = localMachine . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EA457B21-F73E-494C-ACAB-524FDE069978}_is1" ) ;
301295 if ( systemVScode != null )
302- {
303296 return systemVScode . GetValue ( "DisplayIcon" ) as string ;
304- }
305297
306298 var currentUser = Microsoft . Win32 . RegistryKey . OpenBaseKey (
307299 Microsoft . Win32 . RegistryHive . CurrentUser ,
@@ -310,9 +302,7 @@ private string FindVSCode()
310302 // VSCode (user)
311303 var vscode = currentUser . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{771FD6B0-FA20-440A-A002-3B3BAC16DC50}_is1" ) ;
312304 if ( vscode != null )
313- {
314305 return vscode . GetValue ( "DisplayIcon" ) as string ;
315- }
316306
317307 return string . Empty ;
318308 }
@@ -326,9 +316,7 @@ private string FindVSCodeInsiders()
326316 // VSCode - Insiders (system)
327317 var systemVScodeInsiders = localMachine . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1287CAD5-7C8D-410D-88B9-0D1EE4A83FF2}_is1" ) ;
328318 if ( systemVScodeInsiders != null )
329- {
330319 return systemVScodeInsiders . GetValue ( "DisplayIcon" ) as string ;
331- }
332320
333321 var currentUser = Microsoft . Win32 . RegistryKey . OpenBaseKey (
334322 Microsoft . Win32 . RegistryHive . CurrentUser ,
@@ -337,9 +325,7 @@ private string FindVSCodeInsiders()
337325 // VSCode - Insiders (user)
338326 var vscodeInsiders = currentUser . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{217B4C08-948D-4276-BFBB-BEE930AE5A2C}_is1" ) ;
339327 if ( vscodeInsiders != null )
340- {
341328 return vscodeInsiders . GetValue ( "DisplayIcon" ) as string ;
342- }
343329
344330 return string . Empty ;
345331 }
@@ -353,9 +339,7 @@ private string FindVSCodium()
353339 // VSCodium (system)
354340 var systemVSCodium = localMachine . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{88DA3577-054F-4CA1-8122-7D820494CFFB}_is1" ) ;
355341 if ( systemVSCodium != null )
356- {
357342 return systemVSCodium . GetValue ( "DisplayIcon" ) as string ;
358- }
359343
360344 var currentUser = Microsoft . Win32 . RegistryKey . OpenBaseKey (
361345 Microsoft . Win32 . RegistryHive . CurrentUser ,
@@ -364,9 +348,7 @@ private string FindVSCodium()
364348 // VSCodium (user)
365349 var vscodium = currentUser . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2E1F05D1-C245-4562-81EE-28188DB6FD17}_is1" ) ;
366350 if ( vscodium != null )
367- {
368351 return vscodium . GetValue ( "DisplayIcon" ) as string ;
369- }
370352
371353 return string . Empty ;
372354 }
@@ -409,9 +391,7 @@ private string FindVisualStudio()
409391 if ( launcher . GetValue ( string . Empty ) is string CLSID &&
410392 localMachine . OpenSubKey ( @$ "SOFTWARE\Classes\CLSID\{ CLSID } \LocalServer32") is Microsoft . Win32 . RegistryKey devenv &&
411393 devenv . GetValue ( string . Empty ) is string localServer32 )
412- {
413394 return localServer32 ! . Trim ( '\" ' ) ;
414- }
415395 }
416396
417397 return string . Empty ;
0 commit comments