@@ -51,7 +51,15 @@ export type DependencyInstallationResult =
5151 | { kind : 'Cancelled' }
5252 | { kind : 'PendingInstall' }
5353
54- const gitInstallDir = path . join ( 'c:' , 'Program Files' , 'Git' , 'cmd' )
54+ function windowsGitInstallDirs ( ) : string [ ] {
55+ const dirs = [ ]
56+ const localAppDataDir = process . env . LOCALAPPDATA
57+ if ( localAppDataDir !== undefined ) {
58+ dirs . push ( path . join ( localAppDataDir , 'Programs' , 'Git' , 'cmd' ) )
59+ }
60+ dirs . push ( path . join ( 'c:' , 'Program Files' , 'Git' , 'cmd' ) )
61+ return dirs
62+ }
5563
5664export function depInstallationLocations ( ) : string [ ] {
5765 switch ( os . type ( ) ) {
@@ -63,7 +71,7 @@ export function depInstallationLocations(): string[] {
6371 // with the real executable when Apple Command Line Tools is installed.
6472 return [ ]
6573 case 'Windows_NT' :
66- return [ gitInstallDir ]
74+ return windowsGitInstallDirs ( )
6775 }
6876 return [ ]
6977}
@@ -359,7 +367,7 @@ function dependencyInstallationMethod(p: MissingDependencyInstallationProcedure)
359367 shell : 'Windows' ,
360368 script : windowsRawGitInstallScript ,
361369 manualBackupScript : undefined ,
362- pathExtensions : [ gitInstallDir ] ,
370+ pathExtensions : windowsGitInstallDirs ( ) ,
363371 }
364372 }
365373 const windowsWingetGitInstallScript =
@@ -369,7 +377,7 @@ function dependencyInstallationMethod(p: MissingDependencyInstallationProcedure)
369377 shell : 'Windows' ,
370378 script : windowsWingetGitInstallScript ,
371379 manualBackupScript : windowsWingetGitInstallScript ,
372- pathExtensions : [ gitInstallDir ] ,
380+ pathExtensions : windowsGitInstallDirs ( ) ,
373381 }
374382
375383 case 'Other' :
0 commit comments