merged in default ENGINE-209
authorKrista Bennett <krista@pep-project.org>
Fri, 19 May 2017 14:56:44 +0200
branchENGINE-209
changeset 180073f28d6a45ac
parent 1799 1e46b8759248
parent 1796 51a507ac30e0
child 1805 f8990716f387
merged in default
     1.1 --- a/src/platform_windows.cpp	Fri May 19 14:56:20 2017 +0200
     1.2 +++ b/src/platform_windows.cpp	Fri May 19 14:56:44 2017 +0200
     1.3 @@ -139,9 +139,15 @@
     1.4      assert(filename);
     1.5  	assert(flag == RTLD_LAZY); // only lazy binding is implemented
     1.6  
     1.7 -    bool result = readRegistryString(HKEY_LOCAL_MACHINE,
     1.8 -            TEXT("SOFTWARE\\GNU\\GnuPG"), TEXT("Install Directory"), path,
     1.9 -            PATH_BUF_SIZE, NULL);
    1.10 +	// Look up GnuPG installation in current user scope
    1.11 +	bool result = readRegistryString(HKEY_CURRENT_USER,
    1.12 +		TEXT("SOFTWARE\\GNU\\GnuPG"), TEXT("Install Directory"), path,
    1.13 +		PATH_BUF_SIZE, NULL);
    1.14 +	// If not found in current user, look up in local machine
    1.15 +	if (!result)
    1.16 +		result = readRegistryString(HKEY_LOCAL_MACHINE,
    1.17 +			TEXT("SOFTWARE\\GNU\\GnuPG"), TEXT("Install Directory"), path,
    1.18 +			PATH_BUF_SIZE, NULL);
    1.19  	assert(result);
    1.20  	if (!result)
    1.21  		return NULL;