diff options
Diffstat (limited to 'src/burn/engine/registration.cpp')
| -rw-r--r-- | src/burn/engine/registration.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
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"; | |||
| 29 | const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine"; | 29 | const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine"; |
| 30 | const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor"; | 30 | const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor"; |
| 31 | const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor"; | 31 | const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor"; |
| 32 | const LPCWSTR REGISTRY_BUNDLE_SCOPE = L"BundleScope"; | ||
| 33 | const LPCWSTR SWIDTAG_FOLDER = L"swidtag"; | 32 | const LPCWSTR SWIDTAG_FOLDER = L"swidtag"; |
| 34 | const LPCWSTR REGISTRY_BUNDLE_VARIABLE_KEY = L"variables"; | 33 | const LPCWSTR REGISTRY_BUNDLE_VARIABLE_KEY = L"variables"; |
| 34 | const 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 | } |
