aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/bundlepackageengine.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2024-12-29 18:01:20 -0800
committerRob Mensching <rob@firegiant.com>2024-12-30 06:45:49 -0800
commit523c66a62a619e6aa9f30070173ea33edfb5e328 (patch)
tree04fa3146250b7eeaa6864b0f71e37905a2d77be1 /src/burn/engine/bundlepackageengine.cpp
parent6edc5d1e2a289eac50c6d59a29e195353bb023cb (diff)
downloadwix-523c66a62a619e6aa9f30070173ea33edfb5e328.tar.gz
wix-523c66a62a619e6aa9f30070173ea33edfb5e328.tar.bz2
wix-523c66a62a619e6aa9f30070173ea33edfb5e328.zip
Rename "bundle id" concept to "bundle code"
The "bundle id" always had more in common with the PackageCode from the Windows Installer. With the introduction of an actual Id attribute on the Bundle element, there is potential for confusion, so there is finally real motivation to rename "bundle id" to "bundle code".
Diffstat (limited to 'src/burn/engine/bundlepackageengine.cpp')
-rw-r--r--src/burn/engine/bundlepackageengine.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/burn/engine/bundlepackageengine.cpp b/src/burn/engine/bundlepackageengine.cpp
index 90262638..612da389 100644
--- a/src/burn/engine/bundlepackageengine.cpp
+++ b/src/burn/engine/bundlepackageengine.cpp
@@ -52,8 +52,8 @@ extern "C" HRESULT BundlePackageEngineParsePackageFromXml(
52 LPWSTR scz = NULL; 52 LPWSTR scz = NULL;
53 53
54 // @DetectCondition 54 // @DetectCondition
55 hr = XmlGetAttributeEx(pixnBundlePackage, L"BundleId", &pPackage->Bundle.sczBundleId); 55 hr = XmlGetAttributeEx(pixnBundlePackage, L"BundleCode", &pPackage->Bundle.sczBundleCode);
56 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @BundleId."); 56 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @BundleCode.");
57 57
58 // @Version 58 // @Version
59 hr = XmlGetAttributeEx(pixnBundlePackage, L"Version", &scz); 59 hr = XmlGetAttributeEx(pixnBundlePackage, L"Version", &scz);
@@ -100,7 +100,7 @@ extern "C" HRESULT BundlePackageEngineParsePackageFromXml(
100 hr = ExeEngineParseCommandLineArgumentsFromXml(pixnBundlePackage, &pPackage->Bundle.rgCommandLineArguments, &pPackage->Bundle.cCommandLineArguments); 100 hr = ExeEngineParseCommandLineArgumentsFromXml(pixnBundlePackage, &pPackage->Bundle.rgCommandLineArguments, &pPackage->Bundle.cCommandLineArguments);
101 ExitOnFailure(hr, "Failed to parse command lines."); 101 ExitOnFailure(hr, "Failed to parse command lines.");
102 102
103 hr = StrAllocFormatted(&pPackage->Bundle.sczRegistrationKey, L"%ls\\%ls", BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY, pPackage->Bundle.sczBundleId); 103 hr = StrAllocFormatted(&pPackage->Bundle.sczRegistrationKey, L"%ls\\%ls", BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY, pPackage->Bundle.sczBundleCode);
104 ExitOnFailure(hr, "Failed to build uninstall registry key path."); 104 ExitOnFailure(hr, "Failed to build uninstall registry key path.");
105 105
106LExit: 106LExit:
@@ -126,7 +126,7 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes(
126 IXMLDOMNodeList* pixnNodes = NULL; 126 IXMLDOMNodeList* pixnNodes = NULL;
127 IXMLDOMNode* pixnElement = NULL; 127 IXMLDOMNode* pixnElement = NULL;
128 LPWSTR sczAction = NULL; 128 LPWSTR sczAction = NULL;
129 LPWSTR sczId = NULL; 129 LPWSTR sczCode = NULL;
130 DWORD cElements = 0; 130 DWORD cElements = 0;
131 131
132 hr = XmlSelectNodes(pixnBundle, L"RelatedBundle", &pixnNodes); 132 hr = XmlSelectNodes(pixnBundle, L"RelatedBundle", &pixnNodes);
@@ -143,16 +143,16 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes(
143 hr = XmlGetAttributeEx(pixnElement, L"Action", &sczAction); 143 hr = XmlGetAttributeEx(pixnElement, L"Action", &sczAction);
144 ExitOnFailure(hr, "Failed to get @Action."); 144 ExitOnFailure(hr, "Failed to get @Action.");
145 145
146 hr = XmlGetAttributeEx(pixnElement, L"Id", &sczId); 146 hr = XmlGetAttributeEx(pixnElement, L"Code", &sczCode);
147 ExitOnFailure(hr, "Failed to get @Id."); 147 ExitOnFailure(hr, "Failed to get @Code.");
148 148
149 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Detect", -1)) 149 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Detect", -1))
150 { 150 {
151 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczDetectCodes), *pcDetectCodes, 1, sizeof(LPWSTR), 5); 151 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczDetectCodes), *pcDetectCodes, 1, sizeof(LPWSTR), 5);
152 ExitOnFailure(hr, "Failed to resize Detect code array"); 152 ExitOnFailure(hr, "Failed to resize Detect code array");
153 153
154 (*prgsczDetectCodes)[*pcDetectCodes] = sczId; 154 (*prgsczDetectCodes)[*pcDetectCodes] = sczCode;
155 sczId = NULL; 155 sczCode = NULL;
156 *pcDetectCodes += 1; 156 *pcDetectCodes += 1;
157 } 157 }
158 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Upgrade", -1)) 158 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Upgrade", -1))
@@ -160,8 +160,8 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes(
160 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczUpgradeCodes), *pcUpgradeCodes, 1, sizeof(LPWSTR), 5); 160 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczUpgradeCodes), *pcUpgradeCodes, 1, sizeof(LPWSTR), 5);
161 ExitOnFailure(hr, "Failed to resize Upgrade code array"); 161 ExitOnFailure(hr, "Failed to resize Upgrade code array");
162 162
163 (*prgsczUpgradeCodes)[*pcUpgradeCodes] = sczId; 163 (*prgsczUpgradeCodes)[*pcUpgradeCodes] = sczCode;
164 sczId = NULL; 164 sczCode = NULL;
165 *pcUpgradeCodes += 1; 165 *pcUpgradeCodes += 1;
166 } 166 }
167 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Addon", -1)) 167 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Addon", -1))
@@ -169,8 +169,8 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes(
169 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczAddonCodes), *pcAddonCodes, 1, sizeof(LPWSTR), 5); 169 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczAddonCodes), *pcAddonCodes, 1, sizeof(LPWSTR), 5);
170 ExitOnFailure(hr, "Failed to resize Addon code array"); 170 ExitOnFailure(hr, "Failed to resize Addon code array");
171 171
172 (*prgsczAddonCodes)[*pcAddonCodes] = sczId; 172 (*prgsczAddonCodes)[*pcAddonCodes] = sczCode;
173 sczId = NULL; 173 sczCode = NULL;
174 *pcAddonCodes += 1; 174 *pcAddonCodes += 1;
175 } 175 }
176 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Patch", -1)) 176 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Patch", -1))
@@ -178,8 +178,8 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes(
178 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczPatchCodes), *pcPatchCodes, 1, sizeof(LPWSTR), 5); 178 hr = MemEnsureArraySizeForNewItems(reinterpret_cast<LPVOID*>(prgsczPatchCodes), *pcPatchCodes, 1, sizeof(LPWSTR), 5);
179 ExitOnFailure(hr, "Failed to resize Patch code array"); 179 ExitOnFailure(hr, "Failed to resize Patch code array");
180 180
181 (*prgsczPatchCodes)[*pcPatchCodes] = sczId; 181 (*prgsczPatchCodes)[*pcPatchCodes] = sczCode;
182 sczId = NULL; 182 sczCode = NULL;
183 *pcPatchCodes += 1; 183 *pcPatchCodes += 1;
184 } 184 }
185 else 185 else
@@ -193,7 +193,7 @@ LExit:
193 ReleaseObject(pixnNodes); 193 ReleaseObject(pixnNodes);
194 ReleaseObject(pixnElement); 194 ReleaseObject(pixnElement);
195 ReleaseStr(sczAction); 195 ReleaseStr(sczAction);
196 ReleaseStr(sczId); 196 ReleaseStr(sczCode);
197 197
198 return hr; 198 return hr;
199} 199}
@@ -202,7 +202,7 @@ extern "C" void BundlePackageEnginePackageUninitialize(
202 __in BURN_PACKAGE* pPackage 202 __in BURN_PACKAGE* pPackage
203 ) 203 )
204{ 204{
205 ReleaseStr(pPackage->Bundle.sczBundleId); 205 ReleaseStr(pPackage->Bundle.sczBundleCode);
206 ReleaseStr(pPackage->Bundle.sczArpKeyPath); 206 ReleaseStr(pPackage->Bundle.sczArpKeyPath);
207 ReleaseVerutilVersion(pPackage->Bundle.pVersion); 207 ReleaseVerutilVersion(pPackage->Bundle.pVersion);
208 ReleaseStr(pPackage->Bundle.sczRegistrationKey); 208 ReleaseStr(pPackage->Bundle.sczRegistrationKey);
@@ -457,7 +457,7 @@ extern "C" HRESULT BundlePackageEnginePlanAddPackage(
457 pAction->bundlePackage.pPackage = pPackage; 457 pAction->bundlePackage.pPackage = pPackage;
458 pAction->bundlePackage.action = pPackage->rollback; 458 pAction->bundlePackage.action = pPackage->rollback;
459 459
460 hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleId, 0); 460 hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleCode, 0);
461 ExitOnFailure(hr, "Failed to allocate the parent."); 461 ExitOnFailure(hr, "Failed to allocate the parent.");
462 462
463 if (pPackage->Bundle.wzAncestors) 463 if (pPackage->Bundle.wzAncestors)
@@ -488,7 +488,7 @@ extern "C" HRESULT BundlePackageEnginePlanAddPackage(
488 pAction->bundlePackage.pPackage = pPackage; 488 pAction->bundlePackage.pPackage = pPackage;
489 pAction->bundlePackage.action = pPackage->execute; 489 pAction->bundlePackage.action = pPackage->execute;
490 490
491 hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleId, 0); 491 hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleCode, 0);
492 ExitOnFailure(hr, "Failed to allocate the parent."); 492 ExitOnFailure(hr, "Failed to allocate the parent.");
493 493
494 if (pPackage->Bundle.wzAncestors) 494 if (pPackage->Bundle.wzAncestors)
@@ -686,7 +686,7 @@ static BUNDLE_QUERY_CALLBACK_RESULT CALLBACK QueryRelatedBundlesCallback(
686 BOOTSTRAPPER_RELATION_TYPE relationType = RelatedBundleConvertRelationType(pBundle->relationType); 686 BOOTSTRAPPER_RELATION_TYPE relationType = RelatedBundleConvertRelationType(pBundle->relationType);
687 BOOL fPerMachine = BUNDLE_INSTALL_CONTEXT_MACHINE == pBundle->installContext; 687 BOOL fPerMachine = BUNDLE_INSTALL_CONTEXT_MACHINE == pBundle->installContext;
688 688
689 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pBundle->wzBundleId, -1, pPackage->Bundle.sczBundleId, -1) && 689 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pBundle->wzBundleCode, -1, pPackage->Bundle.sczBundleCode, -1) &&
690 pPackage->Bundle.fWin64 == (REG_KEY_64BIT == pBundle->regBitness)) 690 pPackage->Bundle.fWin64 == (REG_KEY_64BIT == pBundle->regBitness))
691 { 691 {
692 Assert(BOOTSTRAPPER_RELATION_UPGRADE == relationType); 692 Assert(BOOTSTRAPPER_RELATION_UPGRADE == relationType);
@@ -695,14 +695,14 @@ static BUNDLE_QUERY_CALLBACK_RESULT CALLBACK QueryRelatedBundlesCallback(
695 } 695 }
696 696
697 hr = RegReadString(pBundle->hkBundle, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, &sczBundleVersion); 697 hr = RegReadString(pBundle->hkBundle, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, &sczBundleVersion);
698 ExitOnFailure(hr, "Failed to read version from registry for related bundle package: %ls", pBundle->wzBundleId); 698 ExitOnFailure(hr, "Failed to read version from registry for related bundle package: %ls", pBundle->wzBundleCode);
699 699
700 hr = VerParseVersion(sczBundleVersion, 0, FALSE, &pVersion); 700 hr = VerParseVersion(sczBundleVersion, 0, FALSE, &pVersion);
701 ExitOnFailure(hr, "Failed to parse related bundle package version: %ls", sczBundleVersion); 701 ExitOnFailure(hr, "Failed to parse related bundle package version: %ls", sczBundleVersion);
702 702
703 if (pVersion->fInvalid) 703 if (pVersion->fInvalid)
704 { 704 {
705 LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, pBundle->wzBundleId, sczBundleVersion); 705 LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, pBundle->wzBundleCode, sczBundleVersion);
706 } 706 }
707 707
708 if (BOOTSTRAPPER_RELATION_UPGRADE == relationType) 708 if (BOOTSTRAPPER_RELATION_UPGRADE == relationType)
@@ -719,7 +719,7 @@ static BUNDLE_QUERY_CALLBACK_RESULT CALLBACK QueryRelatedBundlesCallback(
719 result = BUNDLE_QUERY_CALLBACK_RESULT_CANCEL; 719 result = BUNDLE_QUERY_CALLBACK_RESULT_CANCEL;
720 720
721 // Pass to BA. 721 // Pass to BA.
722 hr = BACallbackOnDetectRelatedBundlePackage(pContext->pUserExperience, pPackage->sczId, pBundle->wzBundleId, relationType, fPerMachine, pVersion); 722 hr = BACallbackOnDetectRelatedBundlePackage(pContext->pUserExperience, pPackage->sczId, pBundle->wzBundleCode, relationType, fPerMachine, pVersion);
723 ExitOnRootFailure(hr, "BA aborted detect related BUNDLE package."); 723 ExitOnRootFailure(hr, "BA aborted detect related BUNDLE package.");
724 724
725 result = BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE; 725 result = BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE;
@@ -1064,7 +1064,7 @@ static HRESULT DetectArpEntry(
1064 1064
1065 if (!pPackage->Bundle.sczArpKeyPath) 1065 if (!pPackage->Bundle.sczArpKeyPath)
1066 { 1066 {
1067 hr = PathConcatRelativeToBase(L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\", pPackage->Bundle.sczBundleId, &pPackage->Bundle.sczArpKeyPath); 1067 hr = PathConcatRelativeToBase(L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\", pPackage->Bundle.sczBundleCode, &pPackage->Bundle.sczArpKeyPath);
1068 ExitOnFailure(hr, "Failed to build full key path."); 1068 ExitOnFailure(hr, "Failed to build full key path.");
1069 } 1069 }
1070 1070