From cb06f75799d845eeb78d326d4b1295921acd0bad Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 1 Apr 2026 16:06:45 -0400 Subject: Handle lack of scope for pre-v7 bundles. Fixes https://github.com/wixtoolset/issues/issues/9274 --- src/burn/engine/relatedbundle.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/burn/engine/relatedbundle.cpp') diff --git a/src/burn/engine/relatedbundle.cpp b/src/burn/engine/relatedbundle.cpp index 166c4ae8..2d95111f 100644 --- a/src/burn/engine/relatedbundle.cpp +++ b/src/burn/engine/relatedbundle.cpp @@ -356,10 +356,19 @@ static HRESULT LoadRelatedBundleFromKey( LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleCode, sczBundleVersion); } + // Look for v7+ scope registration. hr = RegReadNumber(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE, &dwScope); - ExitOnFailure(hr, "Failed to read registration %ls for bundle %ls.", wzRelatedBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE); + if (SUCCEEDED(hr)) + { + pRelatedBundle->detectedScope = static_cast(dwScope); + } + else if (E_FILENOTFOUND == hr) + { + hr = S_OK; - pRelatedBundle->detectedScope = static_cast(dwScope); + pRelatedBundle->detectedScope = fPerMachine ? BOOTSTRAPPER_SCOPE_PER_MACHINE : BOOTSTRAPPER_SCOPE_PER_USER; + } + ExitOnFailure(hr, "Failed to read registration %ls for bundle %ls.", wzRelatedBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE); hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath); ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleCode); -- cgit v1.2.3-55-g6feb