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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-10-28 16:26:03 +01:00
parent bb600aa8fd
commit a82e9b182f
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -409,8 +409,13 @@ find_program_at_standard_place (const char *name)
char path[MAX_PATH]; char path[MAX_PATH];
char *result = NULL; char *result = NULL;
/* See http://wiki.tcl.tk/17492 for details on compatibility. */ /* See http://wiki.tcl.tk/17492 for details on compatibility.
if (SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILES, 0))
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); result = malloc (strlen (path) + 1 + strlen (name) + 1);
if (result) if (result)