w32: Fallback to 2.1 reg key for gpgconf search

* src/w32-util.c (_gpgme_get_gpgconf_path): Fallback to 2.1 installer
 registry key.

--
Finding gpgconf is utterly important so we should be as compatible
as possible.
This commit is contained in:
Andre Heinecke 2016-03-01 13:11:13 +01:00
parent 329ab93f7e
commit 72b83ffc4d

View File

@ -563,15 +563,26 @@ _gpgme_get_gpgconf_path (void)
gpgconf = find_program_at_standard_place (name2); gpgconf = find_program_at_standard_place (name2);
} }
/* 3. Try to find gpgconf.exe using that ancient registry key. This /* 3. Try to find gpgconf.exe using the Windows registry. */
should eventually be removed. */
if (!gpgconf) if (!gpgconf)
{ {
char *dir; char *dir;
dir = read_w32_registry_string ("HKEY_LOCAL_MACHINE", dir = read_w32_registry_string (NULL,
"Software\\GNU\\GnuPG", "Software\\GNU\\GnuPG",
"Install Directory"); "Install Directory");
if (!dir)
{
char *tmp = read_w32_registry_string (NULL,
"Software\\GnuPG",
"Install Directory");
if (tmp)
{
if (gpgrt_asprintf (&dir, "%s\\bin", tmp) == -1)
return NULL;
free (tmp);
}
}
if (dir) if (dir)
{ {
gpgconf = find_program_in_dir (dir, name); gpgconf = find_program_in_dir (dir, name);