From 5f51a9b4589200486b2833124cbd93455f6ce208 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Fri, 12 Aug 2022 15:16:36 +0200 Subject: [PATCH] w32: Add another fallback to look for gpgconf.exe * src/w32-util.c (_gpgme_get_gpgconf_path): Add fallback for GnuPG VS-Desktop install scheme. -- GnuPG VS-Desktop has the install layout: %PROGRAMFILES%\GnuPG VS-Desktop\bin\libgpgme.dll %PROGRAMFILES%\GnuPG VS-Desktop\GnuPG\bin\gpgconf.exe This fallback is of course only required if the registry string pointing to the correct install directory is broken. GnuPG-Bug-Id: T6131 --- src/w32-util.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/w32-util.c b/src/w32-util.c index e4757a21..02058e70 100644 --- a/src/w32-util.c +++ b/src/w32-util.c @@ -645,7 +645,7 @@ _gpgme_get_gpgconf_path (void) gpgconf = find_program_at_standard_place ("GNU\\GnuPG\\gpgconf.exe"); } - /* 5. Try to find gpgconf.exe relative to us. */ + /* 5. Try to find gpgconf.exe relative to us as Gpg4win installs it. */ if (!gpgconf && inst_dir) { char *dir = _gpgme_strconcat (inst_dir, "\\..\\..\\GnuPG\\bin", NULL); @@ -653,7 +653,15 @@ _gpgme_get_gpgconf_path (void) free (dir); } - /* 5. Print a debug message if not found. */ + /* 6. Try to find gpgconf.exe relative to us as GnuPG VSD installs it. */ + if (!gpgconf && inst_dir) + { + char *dir = _gpgme_strconcat (inst_dir, "\\..\\GnuPG\\bin", NULL); + gpgconf = find_program_in_dir (dir, name); + free (dir); + } + + /* Print a debug message if not found. */ if (!gpgconf) _gpgme_debug (NULL, DEBUG_ENGINE, -1, NULL, NULL, NULL, "_gpgme_get_gpgconf_path: '%s' not found",name);