+BOOL CTortoiseProcApp::CheckMsysGitDir()\r
+{\r
+ CRegString msysdir=CRegString(_T("Software\\TortoiseGit\\MSysGit"),_T(""),FALSE,HKEY_LOCAL_MACHINE);\r
+ CString str=msysdir;\r
+ if(str.IsEmpty())\r
+ {\r
+ CRegString msysinstalldir=CRegString(_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1\\InstallLocation"),_T(""),FALSE,HKEY_LOCAL_MACHINE);\r
+ str=msysinstalldir;\r
+ str+="\\bin";\r
+ msysdir=str;\r
+ msysdir.write();\r
+\r
+ }\r
+ CGit::m_MsysGitPath=str;\r
+\r
+ TCHAR *oldpath;\r
+ size_t size;\r
+ \r
+ _tdupenv_s(&oldpath,&size,_T("PATH")); \r
+\r
+ CString path;\r
+ path.Format(_T("%s;"),str);\r
+ path+=oldpath;\r
+\r
+ _tputenv_s(_T("PATH"),path);\r
+\r
+ CString cmd,out;\r
+ cmd=_T("git.exe --version");\r
+ if(g_Git.Run(cmd,&out))\r
+ {\r
+ return false;\r
+ }\r
+ else\r
+ return true;\r
+ \r
+}\r