From 5658492062bf28ffb670ede15cbd1413bf1182d8 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Tue, 17 Feb 2026 19:41:03 -0500 Subject: Lock upgrade bundles to original bundle's scope. Fixes https://github.com/wixtoolset/issues/issues/9236 --- src/burn/engine/relatedbundle.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/burn/engine/relatedbundle.cpp') diff --git a/src/burn/engine/relatedbundle.cpp b/src/burn/engine/relatedbundle.cpp index d0b97af0..166c4ae8 100644 --- a/src/burn/engine/relatedbundle.cpp +++ b/src/burn/engine/relatedbundle.cpp @@ -325,6 +325,7 @@ static HRESULT LoadRelatedBundleFromKey( BOOL fExists = FALSE; BURN_DEPENDENCY_PROVIDER dependencyProvider = { }; BURN_DEPENDENCY_PROVIDER* pBundleDependencyProvider = NULL; + DWORD dwScope = 0; // Only support progress from engines that are compatible. hr = RegReadNumber(hkBundleCode, BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION, &dwEngineProtocolVersion); @@ -355,6 +356,11 @@ static HRESULT LoadRelatedBundleFromKey( LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleCode, sczBundleVersion); } + 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); + + pRelatedBundle->detectedScope = static_cast(dwScope); + hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath); ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleCode); @@ -390,6 +396,12 @@ static HRESULT LoadRelatedBundleFromKey( pRelatedBundle->detectRelationType = relationType; + hr = StrAllocString(&pRelatedBundle->package.Bundle.sczBundleCode, wzRelatedBundleCode, 0); + ExitOnFailure(hr, "Failed to bundle code to related bundle."); + + hr = RegReadStringArray(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_UPGRADE_CODE, &pRelatedBundle->package.Bundle.rgsczUpgradeCodes, &pRelatedBundle->package.Bundle.cUpgradeCodes); + ExitOnFailure(hr, "Failed to read upgrade codes."); + hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, fSupportsBurnProtocol, fPerMachine, wzRelatedBundleCode, #ifdef DEBUG pRelatedBundle->detectRelationType, -- cgit v1.2.3-55-g6feb