Don't search for 64-bit bundles on 32-bit OS.
Fixes 6849
Sean Hall committed
Sep 14, 2022 at 11:02 UTC
ca3bf7968865be1cb80e9d63e7cc177f92469e2f
1 file changed
+12
-3
src/libs/dutil/WixToolset.DUtil/butil.cpp
+12
-3
@@ -361,6 +361,12 @@ DAPI_(HRESULT) BundleQueryRelatedBundles(
361
{
362
HRESULT hr = S_OK;
363
BUNDLE_QUERY_CONTEXT queryContext = { };
364
+ BOOL fSearch64 = TRUE;
365
+
366
+#if !defined(_WIN64)
367
+ // On 32-bit OS's, the requested bitness of the key is ignored so need to avoid searching the same place twice.
368
+ ProcWow64(::GetCurrentProcess(), &fSearch64);
369
+#endif
370
371
queryContext.installContext = installContext;
372
queryContext.rgwzDetectCodes = rgwzDetectCodes;
@@ -379,10 +385,13 @@ DAPI_(HRESULT) BundleQueryRelatedBundles(
385
hr = QueryRelatedBundlesForScopeAndBitness(&queryContext);
386
ButilExitOnFailure(hr, "Failed to query 32-bit related bundles.");
387
382
- queryContext.regBitness = REG_KEY_64BIT;
388
+ if (fSearch64)
389
+ {
390
+ queryContext.regBitness = REG_KEY_64BIT;
391
384
- hr = QueryRelatedBundlesForScopeAndBitness(&queryContext);
385
- ButilExitOnFailure(hr, "Failed to query 64-bit related bundles.");
392
+ hr = QueryRelatedBundlesForScopeAndBitness(&queryContext);
393
+ ButilExitOnFailure(hr, "Failed to query 64-bit related bundles.");
394
+ }
395
396
LExit:
397
return hr;