aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/relatedbundle.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/relatedbundle.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/relatedbundle.cpp')
-rw-r--r--src/burn/engine/relatedbundle.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/burn/engine/relatedbundle.cpp b/src/burn/engine/relatedbundle.cpp
index 23e0f352..938b24d7 100644
--- a/src/burn/engine/relatedbundle.cpp
+++ b/src/burn/engine/relatedbundle.cpp
@@ -30,8 +30,8 @@ static HRESULT LoadIfRelatedBundle(
30 __in BURN_RELATED_BUNDLES* pRelatedBundles 30 __in BURN_RELATED_BUNDLES* pRelatedBundles
31 ); 31 );
32static HRESULT LoadRelatedBundleFromKey( 32static HRESULT LoadRelatedBundleFromKey(
33 __in_z LPCWSTR wzRelatedBundleId, 33 __in_z LPCWSTR wzRelatedBundleCode,
34 __in HKEY hkBundleId, 34 __in HKEY hkBundleCode,
35 __in BOOL fPerMachine, 35 __in BOOL fPerMachine,
36 __in BOOTSTRAPPER_RELATION_TYPE relationType, 36 __in BOOTSTRAPPER_RELATION_TYPE relationType,
37 __in BURN_RELATED_BUNDLE *pRelatedBundle 37 __in BURN_RELATED_BUNDLE *pRelatedBundle
@@ -108,7 +108,7 @@ extern "C" HRESULT RelatedBundleFindById(
108 HRESULT hr = S_OK; 108 HRESULT hr = S_OK;
109 BURN_RELATED_BUNDLE* pRelatedBundle = NULL; 109 BURN_RELATED_BUNDLE* pRelatedBundle = NULL;
110 BURN_PACKAGE* pPackage = NULL; 110 BURN_PACKAGE* pPackage = NULL;
111 111
112 *ppRelatedBundle = NULL; 112 *ppRelatedBundle = NULL;
113 113
114 for (DWORD i = 0; i < pRelatedBundles->cRelatedBundles; ++i) 114 for (DWORD i = 0; i < pRelatedBundles->cRelatedBundles; ++i)
@@ -180,7 +180,7 @@ static __callback int __cdecl CompareRelatedBundlesDetect(
180 const BURN_RELATED_BUNDLE* pBundleLeft = static_cast<const BURN_RELATED_BUNDLE*>(pvLeft); 180 const BURN_RELATED_BUNDLE* pBundleLeft = static_cast<const BURN_RELATED_BUNDLE*>(pvLeft);
181 const BURN_RELATED_BUNDLE* pBundleRight = static_cast<const BURN_RELATED_BUNDLE*>(pvRight); 181 const BURN_RELATED_BUNDLE* pBundleRight = static_cast<const BURN_RELATED_BUNDLE*>(pvRight);
182 182
183 // Sort by relation type, then version, then bundle id. 183 // Sort by relation type, then version, then bundle code.
184 if (pBundleLeft->detectRelationType != pBundleRight->detectRelationType) 184 if (pBundleLeft->detectRelationType != pBundleRight->detectRelationType)
185 { 185 {
186 // Upgrade bundles last, everything else according to the enum. 186 // Upgrade bundles last, everything else according to the enum.
@@ -223,7 +223,7 @@ static __callback int __cdecl CompareRelatedBundlesPlan(
223 const BURN_RELATED_BUNDLE* pBundleLeft = *reinterpret_cast<BURN_RELATED_BUNDLE**>(const_cast<void*>(pvLeft)); 223 const BURN_RELATED_BUNDLE* pBundleLeft = *reinterpret_cast<BURN_RELATED_BUNDLE**>(const_cast<void*>(pvLeft));
224 const BURN_RELATED_BUNDLE* pBundleRight = *reinterpret_cast<BURN_RELATED_BUNDLE**>(const_cast<void*>(pvRight)); 224 const BURN_RELATED_BUNDLE* pBundleRight = *reinterpret_cast<BURN_RELATED_BUNDLE**>(const_cast<void*>(pvRight));
225 225
226 // Sort by relation type, then version, then bundle id. 226 // Sort by relation type, then version, then bundle code.
227 if (pBundleLeft->planRelationType != pBundleRight->planRelationType) 227 if (pBundleLeft->planRelationType != pBundleRight->planRelationType)
228 { 228 {
229 // Upgrade bundles last, everything else according to the enum. 229 // Upgrade bundles last, everything else according to the enum.
@@ -266,7 +266,7 @@ static BUNDLE_QUERY_CALLBACK_RESULT CALLBACK QueryRelatedBundlesCallback(
266 BUNDLE_QUERY_CONTEXT* pContext = reinterpret_cast<BUNDLE_QUERY_CONTEXT*>(pvContext); 266 BUNDLE_QUERY_CONTEXT* pContext = reinterpret_cast<BUNDLE_QUERY_CONTEXT*>(pvContext);
267 267
268 hr = LoadIfRelatedBundle(pBundle, pContext->pRegistration, pContext->pRelatedBundles); 268 hr = LoadIfRelatedBundle(pBundle, pContext->pRegistration, pContext->pRelatedBundles);
269 ExitOnFailure(hr, "Failed to load related bundle: %ls", pBundle->wzBundleId); 269 ExitOnFailure(hr, "Failed to load related bundle: %ls", pBundle->wzBundleCode);
270 270
271LExit: 271LExit:
272 return result; 272 return result;
@@ -283,8 +283,8 @@ static HRESULT LoadIfRelatedBundle(
283 BOOTSTRAPPER_RELATION_TYPE relationType = RelatedBundleConvertRelationType(pBundle->relationType); 283 BOOTSTRAPPER_RELATION_TYPE relationType = RelatedBundleConvertRelationType(pBundle->relationType);
284 BURN_RELATED_BUNDLE* pRelatedBundle = NULL; 284 BURN_RELATED_BUNDLE* pRelatedBundle = NULL;
285 285
286 // If we found our bundle id, it's not a related bundle. 286 // If we found our bundle code, it's not a related bundle.
287 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pBundle->wzBundleId, -1, pRegistration->sczId, -1)) 287 if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pBundle->wzBundleCode, -1, pRegistration->sczCode, -1))
288 { 288 {
289 ExitFunction1(hr = S_FALSE); 289 ExitFunction1(hr = S_FALSE);
290 } 290 }
@@ -294,8 +294,8 @@ static HRESULT LoadIfRelatedBundle(
294 294
295 pRelatedBundle = pRelatedBundles->rgRelatedBundles + pRelatedBundles->cRelatedBundles; 295 pRelatedBundle = pRelatedBundles->rgRelatedBundles + pRelatedBundles->cRelatedBundles;
296 296
297 hr = LoadRelatedBundleFromKey(pBundle->wzBundleId, pBundle->hkBundle, fPerMachine, relationType, pRelatedBundle); 297 hr = LoadRelatedBundleFromKey(pBundle->wzBundleCode, pBundle->hkBundle, fPerMachine, relationType, pRelatedBundle);
298 ExitOnFailure(hr, "Failed to initialize package from related bundle id: %ls", pBundle->wzBundleId); 298 ExitOnFailure(hr, "Failed to initialize package from related bundle code: %ls", pBundle->wzBundleCode);
299 299
300 hr = DependencyDetectRelatedBundle(pRelatedBundle, pRegistration); 300 hr = DependencyDetectRelatedBundle(pRelatedBundle, pRegistration);
301 ExitOnFailure(hr, "Failed to detect dependencies for related bundle."); 301 ExitOnFailure(hr, "Failed to detect dependencies for related bundle.");
@@ -307,8 +307,8 @@ LExit:
307} 307}
308 308
309static HRESULT LoadRelatedBundleFromKey( 309static HRESULT LoadRelatedBundleFromKey(
310 __in_z LPCWSTR wzRelatedBundleId, 310 __in_z LPCWSTR wzRelatedBundleCode,
311 __in HKEY hkBundleId, 311 __in HKEY hkBundleCode,
312 __in BOOL fPerMachine, 312 __in BOOL fPerMachine,
313 __in BOOTSTRAPPER_RELATION_TYPE relationType, 313 __in BOOTSTRAPPER_RELATION_TYPE relationType,
314 __in BURN_RELATED_BUNDLE* pRelatedBundle 314 __in BURN_RELATED_BUNDLE* pRelatedBundle
@@ -327,7 +327,7 @@ static HRESULT LoadRelatedBundleFromKey(
327 BURN_DEPENDENCY_PROVIDER* pBundleDependencyProvider = NULL; 327 BURN_DEPENDENCY_PROVIDER* pBundleDependencyProvider = NULL;
328 328
329 // Only support progress from engines that are compatible. 329 // Only support progress from engines that are compatible.
330 hr = RegReadNumber(hkBundleId, BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION, &dwEngineProtocolVersion); 330 hr = RegReadNumber(hkBundleCode, BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION, &dwEngineProtocolVersion);
331 if (SUCCEEDED(hr)) 331 if (SUCCEEDED(hr))
332 { 332 {
333 fSupportsBurnProtocol = BURN_PROTOCOL_VERSION == dwEngineProtocolVersion; 333 fSupportsBurnProtocol = BURN_PROTOCOL_VERSION == dwEngineProtocolVersion;
@@ -335,7 +335,7 @@ static HRESULT LoadRelatedBundleFromKey(
335 else 335 else
336 { 336 {
337 // Rely on version checking (aka: version greater than or equal to last protocol breaking change *and* versions that are older or the same as this engine) 337 // Rely on version checking (aka: version greater than or equal to last protocol breaking change *and* versions that are older or the same as this engine)
338 hr = RegReadVersion(hkBundleId, BURN_REGISTRATION_REGISTRY_ENGINE_VERSION, &qwEngineVersion); 338 hr = RegReadVersion(hkBundleCode, BURN_REGISTRATION_REGISTRY_ENGINE_VERSION, &qwEngineVersion);
339 if (SUCCEEDED(hr)) 339 if (SUCCEEDED(hr))
340 { 340 {
341 fSupportsBurnProtocol = (FILEMAKEVERSION(3, 6, 2221, 0) <= qwEngineVersion && qwEngineVersion <= FILEMAKEVERSION(rmj, rmm, rup, rpr)); 341 fSupportsBurnProtocol = (FILEMAKEVERSION(3, 6, 2221, 0) <= qwEngineVersion && qwEngineVersion <= FILEMAKEVERSION(rmj, rmm, rup, rpr));
@@ -344,19 +344,19 @@ static HRESULT LoadRelatedBundleFromKey(
344 hr = S_OK; 344 hr = S_OK;
345 } 345 }
346 346
347 hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, &sczBundleVersion); 347 hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, &sczBundleVersion);
348 ExitOnFailure(hr, "Failed to read version from registry for bundle: %ls", wzRelatedBundleId); 348 ExitOnFailure(hr, "Failed to read version from registry for bundle: %ls", wzRelatedBundleCode);
349 349
350 hr = VerParseVersion(sczBundleVersion, 0, FALSE, &pRelatedBundle->pVersion); 350 hr = VerParseVersion(sczBundleVersion, 0, FALSE, &pRelatedBundle->pVersion);
351 ExitOnFailure(hr, "Failed to parse pseudo bundle version: %ls", sczBundleVersion); 351 ExitOnFailure(hr, "Failed to parse pseudo bundle version: %ls", sczBundleVersion);
352 352
353 if (pRelatedBundle->pVersion->fInvalid) 353 if (pRelatedBundle->pVersion->fInvalid)
354 { 354 {
355 LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleId, sczBundleVersion); 355 LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleCode, sczBundleVersion);
356 } 356 }
357 357
358 hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath); 358 hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath);
359 ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleId); 359 ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleCode);
360 360
361 if (FileExistsEx(sczCachePath, NULL)) 361 if (FileExistsEx(sczCachePath, NULL))
362 { 362 {
@@ -364,13 +364,13 @@ static HRESULT LoadRelatedBundleFromKey(
364 } 364 }
365 else 365 else
366 { 366 {
367 LogId(REPORT_STANDARD, MSG_DETECT_RELATED_BUNDLE_NOT_CACHED, wzRelatedBundleId, sczCachePath); 367 LogId(REPORT_STANDARD, MSG_DETECT_RELATED_BUNDLE_NOT_CACHED, wzRelatedBundleCode, sczCachePath);
368 } 368 }
369 369
370 pRelatedBundle->fPlannable = fCached; 370 pRelatedBundle->fPlannable = fCached;
371 371
372 hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY, &dependencyProvider.sczKey); 372 hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY, &dependencyProvider.sczKey);
373 ExitOnPathFailure(hr, fExists, "Failed to read provider key from registry for bundle: %ls", wzRelatedBundleId); 373 ExitOnPathFailure(hr, fExists, "Failed to read provider key from registry for bundle: %ls", wzRelatedBundleCode);
374 374
375 if (dependencyProvider.sczKey && *dependencyProvider.sczKey) 375 if (dependencyProvider.sczKey && *dependencyProvider.sczKey)
376 { 376 {
@@ -379,23 +379,23 @@ static HRESULT LoadRelatedBundleFromKey(
379 dependencyProvider.fImported = TRUE; 379 dependencyProvider.fImported = TRUE;
380 380
381 hr = StrAllocString(&dependencyProvider.sczVersion, pRelatedBundle->pVersion->sczVersion, 0); 381 hr = StrAllocString(&dependencyProvider.sczVersion, pRelatedBundle->pVersion->sczVersion, 0);
382 ExitOnFailure(hr, "Failed to copy version for bundle: %ls", wzRelatedBundleId); 382 ExitOnFailure(hr, "Failed to copy version for bundle: %ls", wzRelatedBundleCode);
383 383
384 hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_DISPLAY_NAME, &dependencyProvider.sczDisplayName); 384 hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_DISPLAY_NAME, &dependencyProvider.sczDisplayName);
385 ExitOnPathFailure(hr, fExists, "Failed to copy display name for bundle: %ls", wzRelatedBundleId); 385 ExitOnPathFailure(hr, fExists, "Failed to copy display name for bundle: %ls", wzRelatedBundleCode);
386 } 386 }
387 387
388 hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_TAG, &pRelatedBundle->sczTag); 388 hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_TAG, &pRelatedBundle->sczTag);
389 ExitOnPathFailure(hr, fExists, "Failed to read tag from registry for bundle: %ls", wzRelatedBundleId); 389 ExitOnPathFailure(hr, fExists, "Failed to read tag from registry for bundle: %ls", wzRelatedBundleCode);
390 390
391 pRelatedBundle->detectRelationType = relationType; 391 pRelatedBundle->detectRelationType = relationType;
392 392
393 hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, fSupportsBurnProtocol, fPerMachine, wzRelatedBundleId, 393 hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, fSupportsBurnProtocol, fPerMachine, wzRelatedBundleCode,
394#ifdef DEBUG 394#ifdef DEBUG
395 pRelatedBundle->detectRelationType, 395 pRelatedBundle->detectRelationType,
396#endif 396#endif
397 fCached, sczCachePath, qwFileSize, pBundleDependencyProvider); 397 fCached, sczCachePath, qwFileSize, pBundleDependencyProvider);
398 ExitOnFailure(hr, "Failed to initialize related bundle to represent bundle: %ls", wzRelatedBundleId); 398 ExitOnFailure(hr, "Failed to initialize related bundle to represent bundle: %ls", wzRelatedBundleCode);
399 399
400LExit: 400LExit:
401 DependencyUninitializeProvider(&dependencyProvider); 401 DependencyUninitializeProvider(&dependencyProvider);