mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-04 08:32:03 +00:00
Detect msysgit installation of users without admin rights
Signed-off-by: Sven Strickroth <email@cs-ware.de>
This commit is contained in:
parent
ec56af08a9
commit
c55378fce5
@ -9,8 +9,9 @@
|
|||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "findfile.h"
|
#include "findfile.h"
|
||||||
|
|
||||||
|
#define REG_MSYSGIT_INSTALL_LOCAL L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
|
||||||
#ifndef _WIN64
|
#ifndef _WIN64
|
||||||
#define REG_MSYSGIT_INSTALL L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
|
#define REG_MSYSGIT_INSTALL REG_MSYSGIT_INSTALL_LOCAL
|
||||||
#else
|
#else
|
||||||
#define REG_MSYSGIT_INSTALL L"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
|
#define REG_MSYSGIT_INSTALL L"SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
|
||||||
#endif
|
#endif
|
||||||
@ -113,10 +114,12 @@ int win32_find_system_file_using_registry(git_buf *path, const char *filename)
|
|||||||
{
|
{
|
||||||
struct win32_path root;
|
struct win32_path root;
|
||||||
|
|
||||||
|
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)) {
|
if (win32_find_msysgit_in_registry(&root, HKEY_LOCAL_MACHINE, REG_MSYSGIT_INSTALL)) {
|
||||||
giterr_set(GITERR_OS, "Cannot locate the system's msysgit directory");
|
giterr_set(GITERR_OS, "Cannot locate the system's msysgit directory");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (win32_find_file(path, &root, filename) < 0) {
|
if (win32_find_file(path, &root, filename) < 0) {
|
||||||
giterr_set(GITERR_OS, "The system file '%s' doesn't exist", filename);
|
giterr_set(GITERR_OS, "The system file '%s' doesn't exist", filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user