aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32-util.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-10-28 15:26:03 +0000
committerWerner Koch <[email protected]>2015-10-28 15:28:48 +0000
commita82e9b182f62966207cad0972be6fa284329a5a1 (patch)
tree83879bb9ac34741c985dde79a79a41e771118219 /src/w32-util.c
parentw32: Add new global flag "w32-inst-dir". (diff)
downloadgpgme-a82e9b182f62966207cad0972be6fa284329a5a1.tar.gz
gpgme-a82e9b182f62966207cad0972be6fa284329a5a1.zip
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 <[email protected]>
Diffstat (limited to 'src/w32-util.c')
-rw-r--r--src/w32-util.c9
1 files 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)