summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Strickroth <email@cs-ware.de>2013-01-31 17:43:59 +0100
committerSven Strickroth <email@cs-ware.de>2013-01-31 19:47:35 +0100
commitc55378fce5d0164c87ccf3a6dba2f56b4ade9341 (patch)
treec2eae81ee045b102e66e2f16acb4b67373484c4c
parentec56af08a9aa9ae261325f5037ec0d5114517d55 (diff)
downloadlibgit2-c55378fce5d0164c87ccf3a6dba2f56b4ade9341.tar.gz
Detect msysgit installation of users without admin rights
Signed-off-by: Sven Strickroth <email@cs-ware.de>
-rw-r--r--src/win32/findfile.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/win32/findfile.c b/src/win32/findfile.c
index c93b0727e..10a1c4d40 100644
--- a/src/win32/findfile.c
+++ b/src/win32/findfile.c
@@ -9,8 +9,9 @@
#include "path.h"
#include "findfile.h"
+#define REG_MSYSGIT_INSTALL_LOCAL L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
#ifndef _WIN64
-#define REG_MSYSGIT_INSTALL L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
+#define REG_MSYSGIT_INSTALL REG_MSYSGIT_INSTALL_LOCAL
#else
#define REG_MSYSGIT_INSTALL L"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
#endif
@@ -113,9 +114,11 @@ int win32_find_system_file_using_registry(git_buf *path, const char *filename)
{
struct win32_path root;
- if (win32_find_msysgit_in_registry(&root, HKEY_LOCAL_MACHINE, REG_MSYSGIT_INSTALL)) {
- giterr_set(GITERR_OS, "Cannot locate the system's msysgit directory");
- return -1;
+ if (win32_find_msysgit_in_registry(&root, HKEY_CURRENT_USER, REG_MSYSGIT_INSTALL_LOCAL)) {
+ if (win32_find_msysgit_in_registry(&root, HKEY_LOCAL_MACHINE, REG_MSYSGIT_INSTALL)) {
+ giterr_set(GITERR_OS, "Cannot locate the system's msysgit directory");
+ return -1;
+ }
}
if (win32_find_file(path, &root, filename) < 0) {