From a82e9b182f62966207cad0972be6fa284329a5a1 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 28 Oct 2015 16:26:03 +0100 Subject: [PATCH] w32: Improve locating gpgconf on 64 bit systems. * src/w32-util.c (find_program_at_standard_place): Fallback to CSIDL_PROGRAM_FILESX86. Signed-off-by: Werner Koch --- src/w32-util.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/w32-util.c b/src/w32-util.c index f611b6c0..3600b28a 100644 --- a/src/w32-util.c +++ b/src/w32-util.c @@ -409,8 +409,13 @@ find_program_at_standard_place (const char *name) char path[MAX_PATH]; char *result = NULL; - /* See http://wiki.tcl.tk/17492 for details on compatibility. */ - if (SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILES, 0)) + /* See http://wiki.tcl.tk/17492 for details on compatibility. + + We First try the generic place and then fallback to the x86 + (i.e. 32 bit) place. This will prefer a 64 bit of the program + over a 32 bit version on 64 bit Windows if installed. */ + if (SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILES, 0) + || SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILESX86, 0)) { result = malloc (strlen (path) + 1 + strlen (name) + 1); if (result)