@@ -333,16 +333,14 @@ public void LoadSettings()
333
333
// Try to find git path from program files
334
334
if ( settingObject . GITPath == "git.exe" )
335
335
{
336
- String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
337
- String gitPath = Path . Combine ( programFiles , @"Git\bin\git.exe" ) ;
336
+ String gitPath = PathHelper . FindFromProgramFiles ( @"Git\bin\git.exe" ) ;
338
337
if ( File . Exists ( gitPath ) ) settingObject . GITPath = gitPath ;
339
338
340
339
}
341
340
// Try to find TortoiseProc path from program files
342
341
if ( settingObject . TortoiseGITProcPath == "TortoiseGitProc.exe" )
343
342
{
344
- String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
345
- String torProcPath = Path . Combine ( programFiles , @"TortoiseGit\bin\TortoiseGitProc.exe" ) ;
343
+ String torProcPath = PathHelper . FindFromProgramFiles ( @"TortoiseGit\bin\TortoiseGitProc.exe" ) ;
346
344
if ( File . Exists ( torProcPath ) ) settingObject . TortoiseGITProcPath = torProcPath ;
347
345
}
348
346
@@ -359,22 +357,19 @@ public void LoadSettings()
359
357
// Try to find sliksvn path from program files
360
358
if ( settingObject . SVNPath == "svn.exe" )
361
359
{
362
- String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
363
- String slSvnPath = Path . Combine ( programFiles , @"SlikSvn\bin\svn.exe" ) ;
360
+ String slSvnPath = PathHelper . FindFromProgramFiles ( @"SlikSvn\bin\svn.exe" ) ;
364
361
if ( File . Exists ( slSvnPath ) ) settingObject . SVNPath = slSvnPath ;
365
362
}
366
363
// Try to find svn from TortoiseSVN
367
364
if ( settingObject . SVNPath == "svn.exe" )
368
365
{
369
- String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
370
- String torSvnPath = Path . Combine ( programFiles , @"TortoiseSVN\bin\svn.exe" ) ;
366
+ String torSvnPath = PathHelper . FindFromProgramFiles ( @"TortoiseSVN\bin\svn.exe" ) ;
371
367
if ( File . Exists ( torSvnPath ) ) settingObject . SVNPath = torSvnPath ;
372
368
}
373
369
// Try to find TortoiseProc path from program files
374
370
if ( settingObject . TortoiseSVNProcPath == "TortoiseProc.exe" )
375
371
{
376
- String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
377
- String torProcPath = Path . Combine ( programFiles , @"TortoiseSVN\bin\TortoiseProc.exe" ) ;
372
+ String torProcPath = PathHelper . FindFromProgramFiles ( @"TortoiseSVN\bin\TortoiseProc.exe" ) ;
378
373
if ( File . Exists ( torProcPath ) ) settingObject . TortoiseSVNProcPath = torProcPath ;
379
374
}
380
375
0 commit comments