From: Sven Strickroth Date: Thu, 31 Jan 2013 15:47:15 +0000 (+0100) Subject: Detect msysgit installation with user-rights X-Git-Tag: REL_1.8.2.0_EXTERNAL~243^2~1 X-Git-Url: https://repo.or.cz/w/TortoiseGit.git/commitdiff_plain/7633c5dc49fbf59e32e366d5ae062375b8562f72 Detect msysgit installation with user-rights Signed-off-by: Sven Strickroth --- diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index f6b2d950d..f751e96a5 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -1691,9 +1691,15 @@ BOOL CGit::CheckMsysGitDir() str=msysdir; if(str.IsEmpty() || !FileExists(str + _T("\\git.exe"))) { - CRegString msysinstalldir=CRegString(REG_MSYSGIT_INSTALL,_T(""),FALSE,HKEY_LOCAL_MACHINE); - str=msysinstalldir; + CRegString msyslocalinstalldir = CRegString(REG_MSYSGIT_INSTALL32, _T(""), FALSE, HKEY_CURRENT_USER); + str = msyslocalinstalldir; str.TrimRight(_T("\\")); + if (str.IsEmpty()) + { + CRegString msysinstalldir = CRegString(REG_MSYSGIT_INSTALL, _T(""), FALSE, HKEY_LOCAL_MACHINE); + str = msysinstalldir; + str.TrimRight(_T("\\")); + } if ( !str.IsEmpty() ) { str += "\\bin"; diff --git a/src/Git/GitConfig.h b/src/Git/GitConfig.h index 4c1ce872b..150272335 100644 --- a/src/Git/GitConfig.h +++ b/src/Git/GitConfig.h @@ -1,6 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2008-2011 - TortoiseGit +// Copyright (C) 2008-2011,2013 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -32,5 +32,6 @@ public: #ifndef WIN64 #define REG_MSYSGIT_INSTALL _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1\\InstallLocation") #else +#define REG_MSYSGIT_INSTALL32 _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1\\InstallLocation") #define REG_MSYSGIT_INSTALL _T("SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1\\InstallLocation") #endif \ No newline at end of file