2 #include "systeminfo.h"
4 static TCHAR msysPath
[MAX_PATH
];
6 static int get_msys_path_from_registry(HKEY root
)
9 DWORD path_len
= sizeof(msysPath
);
11 LONG result
= RegOpenKeyEx(root
, GIT_CHEETAH_REG_PATH
,
12 0, KEY_QUERY_VALUE
, &key
);
13 if (ERROR_SUCCESS
!= result
)
16 result
= RegQueryValueEx(key
,
17 GIT_CHEETAH_REG_PATHTOMSYS
,
18 NULL
, NULL
, (LPBYTE
)msysPath
, &path_len
);
22 return ERROR_SUCCESS
== result
;
25 TCHAR
*msys_path(void)
27 static int found_path
= 0;
29 /* try to find user-specific settings first */
31 found_path
= get_msys_path_from_registry(HKEY_CURRENT_USER
);
33 /* if not found in user settings, try machine-wide */
35 found_path
= get_msys_path_from_registry(HKEY_LOCAL_MACHINE
);