@@ -327,19 +327,59 @@ public void LoadSettings()
327
327
Object obj = ObjectSerializer . Deserialize ( this . settingFilename , settingObject ) ;
328
328
settingObject = ( Settings ) obj ;
329
329
}
330
+
331
+ #region Detect Git
332
+
333
+ // Try to find git path from program files
334
+ if ( settingObject . GITPath == "git.exe" )
335
+ {
336
+ String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
337
+ String gitPath = Path . Combine ( programFiles , @"Git\bin\git.exe" ) ;
338
+ if ( File . Exists ( gitPath ) ) settingObject . GITPath = gitPath ;
339
+
340
+ }
341
+ // Try to find TortoiseProc path from program files
342
+ if ( settingObject . TortoiseGITProcPath == "TortoiseGitProc.exe" )
343
+ {
344
+ String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
345
+ String torProcPath = Path . Combine ( programFiles , @"TortoiseGit\bin\TortoiseGitProc.exe" ) ;
346
+ if ( File . Exists ( torProcPath ) ) settingObject . TortoiseGITProcPath = torProcPath ;
347
+ }
348
+
349
+ #endregion
350
+
351
+ #region Detect SVN
352
+
330
353
// Try to find svn path from: Tools/sliksvn/
331
354
if ( settingObject . SVNPath == "svn.exe" )
332
355
{
333
356
String svnCmdPath = @"Tools\sliksvn\bin\svn.exe" ;
334
357
if ( PathHelper . ResolvePath ( svnCmdPath ) != null ) settingObject . SVNPath = svnCmdPath ;
335
358
}
359
+ // Try to find sliksvn path from program files
360
+ if ( settingObject . SVNPath == "svn.exe" )
361
+ {
362
+ String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
363
+ String slSvnPath = Path . Combine ( programFiles , @"SlikSVN\bin\svn.exe" ) ;
364
+ if ( File . Exists ( slSvnPath ) ) settingObject . SVNPath = slSvnPath ;
365
+ }
366
+ // Try to find svn from TortoiseSVN
367
+ if ( settingObject . SVNPath == "svn.exe" )
368
+ {
369
+ String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
370
+ String torSvnPath = Path . Combine ( programFiles , @"TortoiseSVN\bin\svn.exe" ) ;
371
+ if ( File . Exists ( torSvnPath ) ) settingObject . SVNPath = torSvnPath ;
372
+ }
336
373
// Try to find TortoiseProc path from program files
337
374
if ( settingObject . TortoiseSVNProcPath == "TortoiseProc.exe" )
338
375
{
339
376
String programFiles = Environment . GetEnvironmentVariable ( "ProgramFiles" ) ;
340
377
String torProcPath = Path . Combine ( programFiles , @"TortoiseSVN\bin\TortoiseProc.exe" ) ;
341
378
if ( File . Exists ( torProcPath ) ) settingObject . TortoiseSVNProcPath = torProcPath ;
342
379
}
380
+
381
+ #endregion
382
+
343
383
CheckPathExists ( settingObject . SVNPath , "TortoiseSVN (svn)" ) ;
344
384
CheckPathExists ( settingObject . TortoiseSVNProcPath , "TortoiseSVN (Proc)" ) ;
345
385
CheckPathExists ( settingObject . GITPath , "TortoiseGit (git)" ) ;
0 commit comments