@@ -29,9 +29,10 @@ const LPCWSTR REGISTRY_BUNDLE_UNINSTALL_STRING = L"UninstallString";
2929const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L" BundleResumeCommandLine" ;
3030const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L" VersionMajor" ;
3131const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L" VersionMinor" ;
32- const LPCWSTR REGISTRY_BUNDLE_SCOPE = L" BundleScope" ;
3332const LPCWSTR SWIDTAG_FOLDER = L" swidtag" ;
3433const LPCWSTR REGISTRY_BUNDLE_VARIABLE_KEY = L" variables" ;
34+ const LPCWSTR REGISTRY_BUNDLE_INSTALLED = L" Installed" ;
35+
3536
3637// internal function declarations
3738
@@ -146,6 +147,10 @@ extern "C" HRESULT RegistrationParseFromXml(
146147 hr = XmlGetAttributeEx (pixnRegistrationNode, L" Tag" , &pRegistration->sczTag );
147148 ExitOnRequiredXmlQueryFailure (hr, " Failed to get @Tag." );
148149
150+ // @PrimaryUpgradeCode
151+ hr = XmlGetAttributeEx (pixnRegistrationNode, L" PrimaryUpgradeCode" , &pRegistration->sczPrimaryUpgradeCode );
152+ ExitOnOptionalXmlQueryFailure (hr, fFoundXml , " Failed to get @PrimaryUpgradeCode." );
153+
149154 hr = BundlePackageEngineParseRelatedCodes (pixnBundle, &pRegistration->rgsczDetectCodes , &pRegistration->cDetectCodes , &pRegistration->rgsczUpgradeCodes , &pRegistration->cUpgradeCodes , &pRegistration->rgsczAddonCodes , &pRegistration->cAddonCodes , &pRegistration->rgsczPatchCodes , &pRegistration->cPatchCodes );
150155 ExitOnFailure (hr, " Failed to parse related bundles" );
151156
@@ -327,7 +332,8 @@ extern "C" void RegistrationUninitialize(
327332{
328333 ReleaseStr (pRegistration->sczCode );
329334 ReleaseStr (pRegistration->sczTag );
330-
335+ ReleaseStr (pRegistration->sczPrimaryUpgradeCode );
336+
331337 for (DWORD i = 0 ; i < pRegistration->cDetectCodes ; ++i)
332338 {
333339 ReleaseStr (pRegistration->rgsczDetectCodes [i]);
@@ -666,8 +672,8 @@ extern "C" HRESULT RegistrationSessionBegin(
666672 hr = RegWriteStringFormatted (hkRegistration, REGISTRY_BUNDLE_DISPLAY_ICON, L" %s,0" , pRegistration->sczCacheExecutablePath );
667673 ExitOnFailure (hr, " Failed to write %ls value." , REGISTRY_BUNDLE_DISPLAY_ICON);
668674
669- hr = RegWriteNumber (hkRegistration, REGISTRY_BUNDLE_SCOPE , pRegistration->fPerMachine ? BOOTSTRAPPER_SCOPE_PER_MACHINE : BOOTSTRAPPER_SCOPE_PER_USER);
670- ExitOnFailure (hr, " Failed to write %ls value." , REGISTRY_BUNDLE_SCOPE );
675+ hr = RegWriteNumber (hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE , pRegistration->fPerMachine ? BOOTSTRAPPER_SCOPE_PER_MACHINE : BOOTSTRAPPER_SCOPE_PER_USER);
676+ ExitOnFailure (hr, " Failed to write %ls value." , BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE );
671677
672678 // update display name
673679 hr = UpdateBundleNameRegistration (pRegistration, pVariables, hkRegistration, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS == registrationType);
@@ -1780,8 +1786,8 @@ static HRESULT DetectInstalled(
17801786
17811787 pRegistration->detectedRegistrationType = (1 == dwInstalled) ? BOOTSTRAPPER_REGISTRATION_TYPE_FULL : BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS;
17821788
1783- hr = RegReadNumber (hkRegistration, REGISTRY_BUNDLE_SCOPE , &dwScope);
1784- ExitOnFailure (hr, " Failed to read registration %ls@%ls." , pRegistration->sczRegistrationKey , REGISTRY_BUNDLE_SCOPE );
1789+ hr = RegReadNumber (hkRegistration, BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE , &dwScope);
1790+ ExitOnFailure (hr, " Failed to read registration %ls@%ls." , pRegistration->sczRegistrationKey , BURN_REGISTRATION_REGISTRY_BUNDLE_SCOPE );
17851791
17861792 pRegistration->detectedScope = static_cast <BOOTSTRAPPER_SCOPE>(dwScope);
17871793 }
0 commit comments