Detect msysgit installation with user-rights
authorSven Strickroth <email@cs-ware.de>
Thu, 31 Jan 2013 15:47:15 +0000 (31 16:47 +0100)
committerSven Strickroth <email@cs-ware.de>
Thu, 31 Jan 2013 15:47:15 +0000 (31 16:47 +0100)
Signed-off-by: Sven Strickroth <email@cs-ware.de>
src/Git/Git.cpp
src/Git/GitConfig.h

index f6b2d95..f751e96 100644 (file)
@@ -1691,9 +1691,15 @@ BOOL CGit::CheckMsysGitDir()
        str=msysdir;\r
        if(str.IsEmpty() || !FileExists(str + _T("\\git.exe")))\r
        {\r
-               CRegString msysinstalldir=CRegString(REG_MSYSGIT_INSTALL,_T(""),FALSE,HKEY_LOCAL_MACHINE);\r
-               str=msysinstalldir;\r
+               CRegString msyslocalinstalldir = CRegString(REG_MSYSGIT_INSTALL32, _T(""), FALSE, HKEY_CURRENT_USER);\r
+               str = msyslocalinstalldir;\r
                str.TrimRight(_T("\\"));\r
+               if (str.IsEmpty())\r
+               {\r
+                       CRegString msysinstalldir = CRegString(REG_MSYSGIT_INSTALL, _T(""), FALSE, HKEY_LOCAL_MACHINE);\r
+                       str = msysinstalldir;\r
+                       str.TrimRight(_T("\\"));\r
+               }\r
                if ( !str.IsEmpty() )\r
                {\r
                        str += "\\bin";\r
index 4c1ce87..1502723 100644 (file)
@@ -1,6 +1,6 @@
 // TortoiseGit - a Windows shell extension for easy version control\r
 \r
-// Copyright (C) 2008-2011 - TortoiseGit\r
+// Copyright (C) 2008-2011,2013 - TortoiseGit\r
 \r
 // This program is free software; you can redistribute it and/or\r
 // modify it under the terms of the GNU General Public License\r
@@ -32,5 +32,6 @@ public:
 #ifndef WIN64\r
 #define REG_MSYSGIT_INSTALL _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1\\InstallLocation")\r
 #else\r
+#define REG_MSYSGIT_INSTALL32 _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1\\InstallLocation")\r
 #define REG_MSYSGIT_INSTALL    _T("SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1\\InstallLocation")\r
 #endif
\ No newline at end of file