aboutsummaryrefslogtreecommitdiff
path: root/src/burn
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn')
-rw-r--r--src/burn/engine/core.cpp2
-rw-r--r--src/burn/engine/core.h5
-rw-r--r--src/burn/engine/engine.mc9
-rw-r--r--src/burn/engine/plan.cpp57
-rw-r--r--src/burn/engine/plan.h3
-rw-r--r--src/burn/engine/registration.cpp18
-rw-r--r--src/burn/engine/registration.h5
-rw-r--r--src/burn/engine/relatedbundle.cpp12
-rw-r--r--src/burn/test/BurnUnitTest/RelatedBundleTest.cpp3
9 files changed, 98 insertions, 16 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp
index dc0af8ce..5483e46f 100644
--- a/src/burn/engine/core.cpp
+++ b/src/burn/engine/core.cpp
@@ -469,7 +469,7 @@ extern "C" HRESULT CorePlan(
469 pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action; 469 pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action;
470 pEngineState->plan.fPlanPackageCacheRollback = BOOTSTRAPPER_REGISTRATION_TYPE_NONE == pEngineState->registration.detectedRegistrationType; 470 pEngineState->plan.fPlanPackageCacheRollback = BOOTSTRAPPER_REGISTRATION_TYPE_NONE == pEngineState->registration.detectedRegistrationType;
471 471
472 hr = PlanPackagesAndBundleScope(pEngineState->packages.rgPackages, pEngineState->packages.cPackages, pEngineState->plan.plannedScope, pEngineState->registration.scope, pEngineState->command.commandLineScope, pEngineState->registration.detectedScope, &pEngineState->plan.plannedScope, &pEngineState->registration.fPerMachine); 472 hr = PlanPackagesAndBundleScope(pEngineState->packages.rgPackages, pEngineState->packages.cPackages, pEngineState->registration.sczPrimaryUpgradeCode, pEngineState->registration.relatedBundles.rgRelatedBundles, pEngineState->registration.relatedBundles.cRelatedBundles, pEngineState->plan.plannedScope, pEngineState->registration.scope, pEngineState->command.commandLineScope, pEngineState->registration.detectedScope, &pEngineState->plan.plannedScope, &pEngineState->registration.fPerMachine);
473 ExitOnFailure(hr, "Failed to determine packages and bundle scope."); 473 ExitOnFailure(hr, "Failed to determine packages and bundle scope.");
474 474
475 if (BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE_OR_PER_USER == pEngineState->registration.scope || BOOTSTRAPPER_PACKAGE_SCOPE_PER_USER_OR_PER_MACHINE == pEngineState->registration.scope) 475 if (BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE_OR_PER_USER == pEngineState->registration.scope || BOOTSTRAPPER_PACKAGE_SCOPE_PER_USER_OR_PER_MACHINE == pEngineState->registration.scope)
diff --git a/src/burn/engine/core.h b/src/burn/engine/core.h
index 520fdcd5..2ad9111f 100644
--- a/src/burn/engine/core.h
+++ b/src/burn/engine/core.h
@@ -235,11 +235,6 @@ HRESULT CoreSerializeEngineState(
235HRESULT CoreQueryRegistration( 235HRESULT CoreQueryRegistration(
236 __in BURN_ENGINE_STATE* pEngineState 236 __in BURN_ENGINE_STATE* pEngineState
237 ); 237 );
238//HRESULT CoreDeserializeEngineState(
239// __in BURN_ENGINE_STATE* pEngineState,
240// __in_bcount(cbBuffer) BYTE* pbBuffer,
241// __in SIZE_T cbBuffer
242// );
243HRESULT CoreDetect( 238HRESULT CoreDetect(
244 __in BURN_ENGINE_STATE* pEngineState, 239 __in BURN_ENGINE_STATE* pEngineState,
245 __in_opt HWND hwndParent 240 __in_opt HWND hwndParent
diff --git a/src/burn/engine/engine.mc b/src/burn/engine/engine.mc
index f7ec0359..edafef97 100644
--- a/src/burn/engine/engine.mc
+++ b/src/burn/engine/engine.mc
@@ -418,7 +418,14 @@ MessageId=227
418Severity=Success 418Severity=Success
419SymbolicName=MSG_PLAN_INSTALLED_SCOPE 419SymbolicName=MSG_PLAN_INSTALLED_SCOPE
420Language=English 420Language=English
421Bundle was already installed with scope: %1!hs! 421Bundle was already installed with scope: %1!hs!. Scope cannot change during maintenance.
422.
423
424MessageId=228
425Severity=Success
426SymbolicName=MSG_PLAN_UPGRADE_SCOPE
427Language=English
428Upgraded bundle %1!ls! was already installed with scope: %2!hs!. Scope cannot change during upgrade.
422. 429.
423 430
424MessageId=201 431MessageId=201
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp
index 889ad68c..2257b28c 100644
--- a/src/burn/engine/plan.cpp
+++ b/src/burn/engine/plan.cpp
@@ -144,6 +144,12 @@ static BOOL ForceCache(
144 __in BURN_PLAN* pPlan, 144 __in BURN_PLAN* pPlan,
145 __in BURN_PACKAGE* pPackage 145 __in BURN_PACKAGE* pPackage
146 ); 146 );
147static HRESULT GetUpgradedBundleScope(
148 __in DWORD cRelatedBundles,
149 __in BURN_RELATED_BUNDLE* rgRelatedBundles,
150 __in_z LPCWSTR wzUpgradeCode,
151 __inout BOOTSTRAPPER_SCOPE* pScope
152);
147 153
148// function definitions 154// function definitions
149 155
@@ -823,6 +829,9 @@ LExit:
823extern "C" HRESULT PlanPackagesAndBundleScope( 829extern "C" HRESULT PlanPackagesAndBundleScope(
824 __in BURN_PACKAGE* rgPackages, 830 __in BURN_PACKAGE* rgPackages,
825 __in DWORD cPackages, 831 __in DWORD cPackages,
832 __in_z LPCWSTR wzUpgradeCode,
833 __in BURN_RELATED_BUNDLE* rgRelatedBundles,
834 __in DWORD cRelatedBundles,
826 __in BOOTSTRAPPER_SCOPE scope, 835 __in BOOTSTRAPPER_SCOPE scope,
827 __in BOOTSTRAPPER_PACKAGE_SCOPE authoredScope, 836 __in BOOTSTRAPPER_PACKAGE_SCOPE authoredScope,
828 __in BOOTSTRAPPER_SCOPE commandLineScope, 837 __in BOOTSTRAPPER_SCOPE commandLineScope,
@@ -855,7 +864,11 @@ extern "C" HRESULT PlanPackagesAndBundleScope(
855 } 864 }
856 } 865 }
857 866
858 if (BOOTSTRAPPER_SCOPE_DEFAULT != detectedScope) 867 // If we're upgrading, lock the scope to that of the upgraded bundle.
868 hr = GetUpgradedBundleScope(cRelatedBundles, rgRelatedBundles, wzUpgradeCode, &scope);
869
870 // If we're in maintenance mode instead, lock the scope to the original scope.
871 if (S_FALSE == hr && BOOTSTRAPPER_SCOPE_DEFAULT != detectedScope)
859 { 872 {
860 scope = detectedScope; 873 scope = detectedScope;
861 874
@@ -888,6 +901,48 @@ extern "C" HRESULT PlanPackagesAndBundleScope(
888} 901}
889 902
890 903
904static HRESULT GetUpgradedBundleScope(
905 __in DWORD cRelatedBundles,
906 __in BURN_RELATED_BUNDLE* rgRelatedBundles,
907 __in_z LPCWSTR wzUpgradeCode,
908 __inout BOOTSTRAPPER_SCOPE* pScope
909 )
910{
911 HRESULT hr = S_OK;
912
913 for (DWORD i = 0; i < cRelatedBundles; ++i)
914 {
915 BURN_RELATED_BUNDLE* pRelatedBundle = rgRelatedBundles + i;
916
917 if (BOOTSTRAPPER_RELATION_UPGRADE == pRelatedBundle->detectRelationType)
918 {
919 for (DWORD j = 0; j < pRelatedBundle->package.Bundle.cUpgradeCodes; ++j)
920 {
921 LPCWSTR wzRelatedUpgradeCode = *(pRelatedBundle->package.Bundle.rgsczUpgradeCodes + j);
922
923 // Is the related bundle's upgrade code the same as ours?
924 // If so, lock our scope to the "original" bundle's scope.
925 if (CSTR_EQUAL == ::CompareStringOrdinal(wzRelatedUpgradeCode, -1, wzUpgradeCode, -1, FALSE))
926 if (CSTR_EQUAL == ::CompareStringOrdinal(wzRelatedUpgradeCode, -1, wzUpgradeCode, -1, TRUE))
927 {
928 *pScope = pRelatedBundle->detectedScope;
929
930 LogId(REPORT_STANDARD, MSG_PLAN_UPGRADE_SCOPE, pRelatedBundle->package.Bundle.sczBundleCode, LoggingBundleScopeToString(*pScope));
931
932 ExitFunction();
933 }
934 }
935 }
936 }
937
938 // No upgrade codes or none match, which is fine. But note it via S_FALSE
939 // so we can distinguish the upgrade case from the maintenance case.
940 hr = S_FALSE;
941
942LExit:
943 return hr;
944}
945
891static HRESULT PlanPackagesHelper( 946static HRESULT PlanPackagesHelper(
892 __in BURN_PACKAGE* rgPackages, 947 __in BURN_PACKAGE* rgPackages,
893 __in DWORD cPackages, 948 __in DWORD cPackages,
diff --git a/src/burn/engine/plan.h b/src/burn/engine/plan.h
index f9996ac0..09918440 100644
--- a/src/burn/engine/plan.h
+++ b/src/burn/engine/plan.h
@@ -485,6 +485,9 @@ void PlanDump(
485HRESULT PlanPackagesAndBundleScope( 485HRESULT PlanPackagesAndBundleScope(
486 __in BURN_PACKAGE* rgPackages, 486 __in BURN_PACKAGE* rgPackages,
487 __in DWORD cPackages, 487 __in DWORD cPackages,
488 __in_z LPCWSTR wzUpgradeCode,
489 __in BURN_RELATED_BUNDLE* rgRelatedBundles,
490 __in DWORD cRelatedBundles,
488 __in BOOTSTRAPPER_SCOPE scope, 491 __in BOOTSTRAPPER_SCOPE scope,
489 __in BOOTSTRAPPER_PACKAGE_SCOPE authoredScope, 492 __in BOOTSTRAPPER_PACKAGE_SCOPE authoredScope,
490 __in BOOTSTRAPPER_SCOPE commandLineScope, 493 __in BOOTSTRAPPER_SCOPE commandLineScope,
diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp
index e588bef0..7c9ca182 100644
--- a/src/burn/engine/registration.cpp
+++ b/src/burn/engine/registration.cpp
@@ -29,9 +29,10 @@ const LPCWSTR REGISTRY_BUNDLE_UNINSTALL_STRING = L"UninstallString";
29const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine"; 29const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine";
30const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor"; 30const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor";
31const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor"; 31const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor";
32const LPCWSTR REGISTRY_BUNDLE_SCOPE = L"BundleScope";
33const LPCWSTR SWIDTAG_FOLDER = L"swidtag"; 32const LPCWSTR SWIDTAG_FOLDER = L"swidtag";
34const LPCWSTR REGISTRY_BUNDLE_VARIABLE_KEY = L"variables"; 33const LPCWSTR REGISTRY_BUNDLE_VARIABLE_KEY = L"variables";
34const LPCWSTR REGISTRY_BUNDLE_INSTALLED = L"Installed";
35
35 36
36// internal function declarations 37// internal function declarations
37 38
@@ -146,6 +147,10 @@ extern "C" HRESULT RegistrationParseFromXml(
146 hr = XmlGetAttributeEx(pixnRegistrationNode, L"Tag", &pRegistration->sczTag); 147 hr = XmlGetAttributeEx(pixnRegistrationNode, L"Tag", &pRegistration->sczTag);
147 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Tag."); 148 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Tag.");
148 149
150 // @PrimaryUpgradeCode
151 hr = XmlGetAttributeEx(pixnRegistrationNode, L"PrimaryUpgradeCode", &pRegistration->sczPrimaryUpgradeCode);
152 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @PrimaryUpgradeCode.");
153
149 hr = BundlePackageEngineParseRelatedCodes(pixnBundle, &pRegistration->rgsczDetectCodes, &pRegistration->cDetectCodes, &pRegistration->rgsczUpgradeCodes, &pRegistration->cUpgradeCodes, &pRegistration->rgsczAddonCodes, &pRegistration->cAddonCodes, &pRegistration->rgsczPatchCodes, &pRegistration->cPatchCodes); 154 hr = BundlePackageEngineParseRelatedCodes(pixnBundle, &pRegistration->rgsczDetectCodes, &pRegistration->cDetectCodes, &pRegistration->rgsczUpgradeCodes, &pRegistration->cUpgradeCodes, &pRegistration->rgsczAddonCodes, &pRegistration->cAddonCodes, &pRegistration->rgsczPatchCodes, &pRegistration->cPatchCodes);
150 ExitOnFailure(hr, "Failed to parse related bundles"); 155 ExitOnFailure(hr, "Failed to parse related bundles");
151 156
@@ -327,7 +332,8 @@ extern "C" void RegistrationUninitialize(
327{ 332{
328 ReleaseStr(pRegistration->sczCode); 333 ReleaseStr(pRegistration->sczCode);
329 ReleaseStr(pRegistration->sczTag); 334 ReleaseStr(pRegistration->sczTag);
330 335 ReleaseStr(pRegistration->sczPrimaryUpgradeCode);
336
331 for (DWORD i = 0; i < pRegistration->cDetectCodes; ++i) 337 for (DWORD i = 0; i < pRegistration->cDetectCodes; ++i)
332 { 338 {
333 ReleaseStr(pRegistration->rgsczDetectCodes[i]); 339 ReleaseStr(pRegistration->rgsczDetectCodes[i]);
@@ -666,8 +672,8 @@ extern "C" HRESULT RegistrationSessionBegin(
666 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_DISPLAY_ICON, L"%s,0", pRegistration->sczCacheExecutablePath); 672 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_DISPLAY_ICON, L"%s,0", pRegistration->sczCacheExecutablePath);
667 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_DISPLAY_ICON); 673 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_DISPLAY_ICON);
668 674
669 hr = RegWriteNumber(hkRegistration, REGISTRY_BUNDLE_SCOPE, pRegistration->fPerMachine ? BOOTSTRAPPER_SCOPE_PER_MACHINE : BOOTSTRAPPER_SCOPE_PER_USER); 675 hr = RegWriteNumber(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE, pRegistration->fPerMachine ? BOOTSTRAPPER_SCOPE_PER_MACHINE : BOOTSTRAPPER_SCOPE_PER_USER);
670 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_SCOPE); 676 ExitOnFailure(hr, "Failed to write %ls value.", BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE);
671 677
672 // update display name 678 // update display name
673 hr = UpdateBundleNameRegistration(pRegistration, pVariables, hkRegistration, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS == registrationType); 679 hr = UpdateBundleNameRegistration(pRegistration, pVariables, hkRegistration, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS == registrationType);
@@ -1780,8 +1786,8 @@ static HRESULT DetectInstalled(
1780 1786
1781 pRegistration->detectedRegistrationType = (1 == dwInstalled) ? BOOTSTRAPPER_REGISTRATION_TYPE_FULL : BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS; 1787 pRegistration->detectedRegistrationType = (1 == dwInstalled) ? BOOTSTRAPPER_REGISTRATION_TYPE_FULL : BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS;
1782 1788
1783 hr = RegReadNumber(hkRegistration, REGISTRY_BUNDLE_SCOPE, &dwScope); 1789 hr = RegReadNumber(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE, &dwScope);
1784 ExitOnFailure(hr, "Failed to read registration %ls@%ls.", pRegistration->sczRegistrationKey, REGISTRY_BUNDLE_SCOPE); 1790 ExitOnFailure(hr, "Failed to read registration %ls@%ls.", pRegistration->sczRegistrationKey, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE);
1785 1791
1786 pRegistration->detectedScope = static_cast<BOOTSTRAPPER_SCOPE>(dwScope); 1792 pRegistration->detectedScope = static_cast<BOOTSTRAPPER_SCOPE>(dwScope);
1787 } 1793 }
diff --git a/src/burn/engine/registration.h b/src/burn/engine/registration.h
index f340999a..97c6951b 100644
--- a/src/burn/engine/registration.h
+++ b/src/burn/engine/registration.h
@@ -21,8 +21,7 @@ const LPCWSTR BURN_REGISTRATION_REGISTRY_ENGINE_VERSION = L"EngineVersion";
21const LPCWSTR BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION = L"EngineProtocolVersion"; 21const LPCWSTR BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION = L"EngineProtocolVersion";
22const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY = L"BundleProviderKey"; 22const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY = L"BundleProviderKey";
23const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_TAG = L"BundleTag"; 23const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_TAG = L"BundleTag";
24 24const LPCWSTR BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE = L"BundleScope";
25const LPCWSTR REGISTRY_BUNDLE_INSTALLED = L"Installed";
26 25
27enum BURN_RESUME_MODE 26enum BURN_RESUME_MODE
28{ 27{
@@ -69,6 +68,7 @@ typedef struct _BURN_RELATED_BUNDLE
69 BOOTSTRAPPER_REQUEST_STATE defaultRequestedRestore; 68 BOOTSTRAPPER_REQUEST_STATE defaultRequestedRestore;
70 BOOTSTRAPPER_REQUEST_STATE requestedRestore; 69 BOOTSTRAPPER_REQUEST_STATE requestedRestore;
71 BOOTSTRAPPER_ACTION_STATE restore; 70 BOOTSTRAPPER_ACTION_STATE restore;
71 BOOTSTRAPPER_SCOPE detectedScope;
72} BURN_RELATED_BUNDLE; 72} BURN_RELATED_BUNDLE;
73 73
74typedef struct _BURN_RELATED_BUNDLES 74typedef struct _BURN_RELATED_BUNDLES
@@ -106,6 +106,7 @@ typedef struct _BURN_REGISTRATION
106 BOOTSTRAPPER_PACKAGE_SCOPE scope; 106 BOOTSTRAPPER_PACKAGE_SCOPE scope;
107 LPWSTR sczCode; 107 LPWSTR sczCode;
108 LPWSTR sczTag; 108 LPWSTR sczTag;
109 LPWSTR sczPrimaryUpgradeCode;
109 110
110 LPWSTR *rgsczDetectCodes; 111 LPWSTR *rgsczDetectCodes;
111 DWORD cDetectCodes; 112 DWORD cDetectCodes;
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(
325 BOOL fExists = FALSE; 325 BOOL fExists = FALSE;
326 BURN_DEPENDENCY_PROVIDER dependencyProvider = { }; 326 BURN_DEPENDENCY_PROVIDER dependencyProvider = { };
327 BURN_DEPENDENCY_PROVIDER* pBundleDependencyProvider = NULL; 327 BURN_DEPENDENCY_PROVIDER* pBundleDependencyProvider = NULL;
328 DWORD dwScope = 0;
328 329
329 // Only support progress from engines that are compatible. 330 // Only support progress from engines that are compatible.
330 hr = RegReadNumber(hkBundleCode, BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION, &dwEngineProtocolVersion); 331 hr = RegReadNumber(hkBundleCode, BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION, &dwEngineProtocolVersion);
@@ -355,6 +356,11 @@ static HRESULT LoadRelatedBundleFromKey(
355 LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleCode, sczBundleVersion); 356 LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleCode, sczBundleVersion);
356 } 357 }
357 358
359 hr = RegReadNumber(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE, &dwScope);
360 ExitOnFailure(hr, "Failed to read registration %ls for bundle %ls.", wzRelatedBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE);
361
362 pRelatedBundle->detectedScope = static_cast<BOOTSTRAPPER_SCOPE>(dwScope);
363
358 hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath); 364 hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath);
359 ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleCode); 365 ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleCode);
360 366
@@ -390,6 +396,12 @@ static HRESULT LoadRelatedBundleFromKey(
390 396
391 pRelatedBundle->detectRelationType = relationType; 397 pRelatedBundle->detectRelationType = relationType;
392 398
399 hr = StrAllocString(&pRelatedBundle->package.Bundle.sczBundleCode, wzRelatedBundleCode, 0);
400 ExitOnFailure(hr, "Failed to bundle code to related bundle.");
401
402 hr = RegReadStringArray(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_UPGRADE_CODE, &pRelatedBundle->package.Bundle.rgsczUpgradeCodes, &pRelatedBundle->package.Bundle.cUpgradeCodes);
403 ExitOnFailure(hr, "Failed to read upgrade codes.");
404
393 hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, fSupportsBurnProtocol, fPerMachine, wzRelatedBundleCode, 405 hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, fSupportsBurnProtocol, fPerMachine, wzRelatedBundleCode,
394#ifdef DEBUG 406#ifdef DEBUG
395 pRelatedBundle->detectRelationType, 407 pRelatedBundle->detectRelationType,
diff --git a/src/burn/test/BurnUnitTest/RelatedBundleTest.cpp b/src/burn/test/BurnUnitTest/RelatedBundleTest.cpp
index dcccc589..38c99121 100644
--- a/src/burn/test/BurnUnitTest/RelatedBundleTest.cpp
+++ b/src/burn/test/BurnUnitTest/RelatedBundleTest.cpp
@@ -178,6 +178,9 @@ namespace Bootstrapper
178 178
179 hr = RegWriteString(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, wzVersion); 179 hr = RegWriteString(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, wzVersion);
180 NativeAssert::Succeeded(hr, "Failed to write %ls value.", BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION); 180 NativeAssert::Succeeded(hr, "Failed to write %ls value.", BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION);
181
182 hr = RegWriteNumber(hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE, fPerMachine ? BOOTSTRAPPER_SCOPE_PER_MACHINE : BOOTSTRAPPER_SCOPE_PER_USER);
183 NativeAssert::Succeeded(hr, "Failed to write %ls value.", BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE);
181 } 184 }
182 finally 185 finally
183 { 186 {