aboutsummaryrefslogtreecommitdiff
path: root/src/libs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2024-12-29 18:01:20 -0800
committerRob Mensching <rob@firegiant.com>2024-12-29 18:01:20 -0800
commit8dd2ee866dee2b25c67175c2ea88fa34e4568c5e (patch)
tree3b40f8e70c351a00cc68190bbef148e4edb2ee54 /src/libs
parentbd4559125099e91b8d2de9429e7cbf749e050597 (diff)
downloadwix-8dd2ee866dee2b25c67175c2ea88fa34e4568c5e.tar.gz
wix-8dd2ee866dee2b25c67175c2ea88fa34e4568c5e.tar.bz2
wix-8dd2ee866dee2b25c67175c2ea88fa34e4568c5e.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/libs')
-rw-r--r--src/libs/dutil/WixToolset.DUtil/butil.cpp80
-rw-r--r--src/libs/dutil/WixToolset.DUtil/inc/butil.h19
2 files changed, 50 insertions, 49 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/butil.cpp b/src/libs/dutil/WixToolset.DUtil/butil.cpp
index 4b6cd02a..87e58e36 100644
--- a/src/libs/dutil/WixToolset.DUtil/butil.cpp
+++ b/src/libs/dutil/WixToolset.DUtil/butil.cpp
@@ -61,12 +61,12 @@ static HRESULT QueryRelatedBundlesForScopeAndBitness(
61static HRESULT QueryPotentialRelatedBundle( 61static HRESULT QueryPotentialRelatedBundle(
62 __in BUNDLE_QUERY_CONTEXT* pQueryContext, 62 __in BUNDLE_QUERY_CONTEXT* pQueryContext,
63 __in HKEY hkUninstallKey, 63 __in HKEY hkUninstallKey,
64 __in_z LPCWSTR wzRelatedBundleId, 64 __in_z LPCWSTR wzRelatedBundleCode,
65 __inout BUNDLE_QUERY_CALLBACK_RESULT* pResult 65 __inout BUNDLE_QUERY_CALLBACK_RESULT* pResult
66 ); 66 );
67static HRESULT DetermineRelationType( 67static HRESULT DetermineRelationType(
68 __in BUNDLE_QUERY_CONTEXT* pQueryContext, 68 __in BUNDLE_QUERY_CONTEXT* pQueryContext,
69 __in HKEY hkBundleId, 69 __in HKEY hkBundleCode,
70 __out BUNDLE_RELATION_TYPE* pRelationType 70 __out BUNDLE_RELATION_TYPE* pRelationType
71 ); 71 );
72/******************************************************************** 72/********************************************************************
@@ -76,7 +76,7 @@ LocateAndQueryBundleValue - Locates the requested key for the bundle,
76NOTE: caller is responsible for closing key 76NOTE: caller is responsible for closing key
77********************************************************************/ 77********************************************************************/
78static HRESULT LocateAndQueryBundleValue( 78static HRESULT LocateAndQueryBundleValue(
79 __in_z LPCWSTR wzBundleId, 79 __in_z LPCWSTR wzBundleCode,
80 __in_opt LPCWSTR wzSubKey, 80 __in_opt LPCWSTR wzSubKey,
81 __in LPCWSTR wzValueName, 81 __in LPCWSTR wzValueName,
82 __inout HKEY* phKey, 82 __inout HKEY* phKey,
@@ -91,7 +91,7 @@ static HRESULT CopyStringToBuffer(
91 91
92 92
93DAPI_(HRESULT) BundleGetBundleInfo( 93DAPI_(HRESULT) BundleGetBundleInfo(
94 __in_z LPCWSTR wzBundleId, 94 __in_z LPCWSTR wzBundleCode,
95 __in_z LPCWSTR wzAttribute, 95 __in_z LPCWSTR wzAttribute,
96 __deref_out_z LPWSTR* psczValue 96 __deref_out_z LPWSTR* psczValue
97 ) 97 )
@@ -102,12 +102,12 @@ DAPI_(HRESULT) BundleGetBundleInfo(
102 DWORD dwType = 0; 102 DWORD dwType = 0;
103 DWORD dwValue = 0; 103 DWORD dwValue = 0;
104 104
105 if (!wzBundleId || !wzAttribute || !psczValue) 105 if (!wzBundleCode || !wzAttribute || !psczValue)
106 { 106 {
107 ButilExitWithRootFailure(hr, E_INVALIDARG, "An invalid parameter was passed to the function."); 107 ButilExitWithRootFailure(hr, E_INVALIDARG, "An invalid parameter was passed to the function.");
108 } 108 }
109 109
110 hr = LocateAndQueryBundleValue(wzBundleId, NULL, wzAttribute, &hkBundle, &dwType, &status); 110 hr = LocateAndQueryBundleValue(wzBundleCode, NULL, wzAttribute, &hkBundle, &dwType, &status);
111 ButilExitOnFailure(hr, "Failed to locate and query bundle attribute."); 111 ButilExitOnFailure(hr, "Failed to locate and query bundle attribute.");
112 112
113 switch (status) 113 switch (status)
@@ -144,7 +144,7 @@ LExit:
144 144
145 145
146DAPI_(HRESULT) BundleGetBundleInfoFixed( 146DAPI_(HRESULT) BundleGetBundleInfoFixed(
147 __in_z LPCWSTR wzBundleId, 147 __in_z LPCWSTR wzBundleCode,
148 __in_z LPCWSTR wzAttribute, 148 __in_z LPCWSTR wzAttribute,
149 __out_ecount_opt(*pcchValue) LPWSTR wzValue, 149 __out_ecount_opt(*pcchValue) LPWSTR wzValue,
150 __inout SIZE_T* pcchValue 150 __inout SIZE_T* pcchValue
@@ -158,7 +158,7 @@ DAPI_(HRESULT) BundleGetBundleInfoFixed(
158 ButilExitWithRootFailure(hr, E_INVALIDARG, "An invalid parameter was passed to the function."); 158 ButilExitWithRootFailure(hr, E_INVALIDARG, "An invalid parameter was passed to the function.");
159 } 159 }
160 160
161 hr = BundleGetBundleInfo(wzBundleId, wzAttribute, &sczValue); 161 hr = BundleGetBundleInfo(wzBundleCode, wzAttribute, &sczValue);
162 if (SUCCEEDED(hr)) 162 if (SUCCEEDED(hr))
163 { 163 {
164 hr = CopyStringToBuffer(sczValue, wzValue, pcchValue); 164 hr = CopyStringToBuffer(sczValue, wzValue, pcchValue);
@@ -176,7 +176,7 @@ DAPI_(HRESULT) BundleEnumRelatedBundle(
176 __in BUNDLE_INSTALL_CONTEXT context, 176 __in BUNDLE_INSTALL_CONTEXT context,
177 __in REG_KEY_BITNESS kbKeyBitness, 177 __in REG_KEY_BITNESS kbKeyBitness,
178 __inout PDWORD pdwStartIndex, 178 __inout PDWORD pdwStartIndex,
179 __deref_out_z LPWSTR* psczBundleId 179 __deref_out_z LPWSTR* psczBundleCode
180 ) 180 )
181{ 181{
182 HRESULT hr = S_OK; 182 HRESULT hr = S_OK;
@@ -218,9 +218,9 @@ DAPI_(HRESULT) BundleEnumRelatedBundle(
218 fUpgradeCodeFound = TRUE; 218 fUpgradeCodeFound = TRUE;
219 *pdwStartIndex = dwIndex; 219 *pdwStartIndex = dwIndex;
220 220
221 if (psczBundleId) 221 if (psczBundleCode)
222 { 222 {
223 *psczBundleId = sczUninstallSubKey; 223 *psczBundleCode = sczUninstallSubKey;
224 sczUninstallSubKey = NULL; 224 sczUninstallSubKey = NULL;
225 } 225 }
226 226
@@ -246,7 +246,7 @@ DAPI_(HRESULT) BundleEnumRelatedBundleFixed(
246 __in BUNDLE_INSTALL_CONTEXT context, 246 __in BUNDLE_INSTALL_CONTEXT context,
247 __in REG_KEY_BITNESS kbKeyBitness, 247 __in REG_KEY_BITNESS kbKeyBitness,
248 __inout PDWORD pdwStartIndex, 248 __inout PDWORD pdwStartIndex,
249 __out_ecount(MAX_GUID_CHARS+1) LPWSTR wzBundleId 249 __out_ecount(MAX_GUID_CHARS+1) LPWSTR wzBundleCode
250 ) 250 )
251{ 251{
252 HRESULT hr = S_OK; 252 HRESULT hr = S_OK;
@@ -254,12 +254,12 @@ DAPI_(HRESULT) BundleEnumRelatedBundleFixed(
254 size_t cchValue = 0; 254 size_t cchValue = 0;
255 255
256 hr = BundleEnumRelatedBundle(wzUpgradeCode, context, kbKeyBitness, pdwStartIndex, &sczValue); 256 hr = BundleEnumRelatedBundle(wzUpgradeCode, context, kbKeyBitness, pdwStartIndex, &sczValue);
257 if (S_OK == hr && wzBundleId) 257 if (S_OK == hr && wzBundleCode)
258 { 258 {
259 hr = ::StringCchLengthW(sczValue, STRSAFE_MAX_CCH, &cchValue); 259 hr = ::StringCchLengthW(sczValue, STRSAFE_MAX_CCH, &cchValue);
260 ButilExitOnRootFailure(hr, "Failed to calculate length of string."); 260 ButilExitOnRootFailure(hr, "Failed to calculate length of string.");
261 261
262 hr = ::StringCchCopyNExW(wzBundleId, MAX_GUID_CHARS + 1, sczValue, cchValue, NULL, NULL, STRSAFE_FILL_BEHIND_NULL); 262 hr = ::StringCchCopyNExW(wzBundleCode, MAX_GUID_CHARS + 1, sczValue, cchValue, NULL, NULL, STRSAFE_FILL_BEHIND_NULL);
263 ButilExitOnRootFailure(hr, "Failed to copy the property value to the output buffer."); 263 ButilExitOnRootFailure(hr, "Failed to copy the property value to the output buffer.");
264 } 264 }
265 265
@@ -271,7 +271,7 @@ LExit:
271 271
272 272
273DAPI_(HRESULT) BundleGetBundleVariable( 273DAPI_(HRESULT) BundleGetBundleVariable(
274 __in_z LPCWSTR wzBundleId, 274 __in_z LPCWSTR wzBundleCode,
275 __in_z LPCWSTR wzVariable, 275 __in_z LPCWSTR wzVariable,
276 __deref_out_z LPWSTR* psczValue 276 __deref_out_z LPWSTR* psczValue
277 ) 277 )
@@ -281,12 +281,12 @@ DAPI_(HRESULT) BundleGetBundleVariable(
281 INTERNAL_BUNDLE_STATUS status = INTERNAL_BUNDLE_STATUS_SUCCESS; 281 INTERNAL_BUNDLE_STATUS status = INTERNAL_BUNDLE_STATUS_SUCCESS;
282 DWORD dwType = 0; 282 DWORD dwType = 0;
283 283
284 if (!wzBundleId || !wzVariable || !psczValue) 284 if (!wzBundleCode || !wzVariable || !psczValue)
285 { 285 {
286 ButilExitWithRootFailure(hr, E_INVALIDARG, "An invalid parameter was passed to the function."); 286 ButilExitWithRootFailure(hr, E_INVALIDARG, "An invalid parameter was passed to the function.");
287 } 287 }
288 288
289 hr = LocateAndQueryBundleValue(wzBundleId, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_VARIABLE_KEY, wzVariable, &hkBundle, &dwType, &status); 289 hr = LocateAndQueryBundleValue(wzBundleCode, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_VARIABLE_KEY, wzVariable, &hkBundle, &dwType, &status);
290 ButilExitOnFailure(hr, "Failed to locate and query bundle variable."); 290 ButilExitOnFailure(hr, "Failed to locate and query bundle variable.");
291 291
292 switch (status) 292 switch (status)
@@ -319,7 +319,7 @@ LExit:
319 319
320 320
321DAPI_(HRESULT) BundleGetBundleVariableFixed( 321DAPI_(HRESULT) BundleGetBundleVariableFixed(
322 __in_z LPCWSTR wzBundleId, 322 __in_z LPCWSTR wzBundleCode,
323 __in_z LPCWSTR wzVariable, 323 __in_z LPCWSTR wzVariable,
324 __out_ecount_opt(*pcchValue) LPWSTR wzValue, 324 __out_ecount_opt(*pcchValue) LPWSTR wzValue,
325 __inout SIZE_T* pcchValue 325 __inout SIZE_T* pcchValue
@@ -333,7 +333,7 @@ DAPI_(HRESULT) BundleGetBundleVariableFixed(
333 ButilExitWithRootFailure(hr, E_INVALIDARG, "An invalid parameter was passed to the function."); 333 ButilExitWithRootFailure(hr, E_INVALIDARG, "An invalid parameter was passed to the function.");
334 } 334 }
335 335
336 hr = BundleGetBundleVariable(wzBundleId, wzVariable, &sczValue); 336 hr = BundleGetBundleVariable(wzBundleCode, wzVariable, &sczValue);
337 if (SUCCEEDED(hr)) 337 if (SUCCEEDED(hr))
338 { 338 {
339 hr = CopyStringToBuffer(sczValue, wzValue, pcchValue); 339 hr = CopyStringToBuffer(sczValue, wzValue, pcchValue);
@@ -405,7 +405,7 @@ static HRESULT QueryRelatedBundlesForScopeAndBitness(
405 HKEY hkRoot = BUNDLE_INSTALL_CONTEXT_USER == pQueryContext->installContext ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; 405 HKEY hkRoot = BUNDLE_INSTALL_CONTEXT_USER == pQueryContext->installContext ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
406 HKEY hkUninstallKey = NULL; 406 HKEY hkUninstallKey = NULL;
407 BOOL fExists = FALSE; 407 BOOL fExists = FALSE;
408 LPWSTR sczRelatedBundleId = NULL; 408 LPWSTR sczRelatedBundleCode = NULL;
409 BUNDLE_QUERY_CALLBACK_RESULT result = BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE; 409 BUNDLE_QUERY_CALLBACK_RESULT result = BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE;
410 410
411 hr = RegOpenEx(hkRoot, BUNDLE_REGISTRATION_REGISTRY_UNINSTALL_KEY, KEY_READ, pQueryContext->regBitness, &hkUninstallKey); 411 hr = RegOpenEx(hkRoot, BUNDLE_REGISTRATION_REGISTRY_UNINSTALL_KEY, KEY_READ, pQueryContext->regBitness, &hkUninstallKey);
@@ -418,7 +418,7 @@ static HRESULT QueryRelatedBundlesForScopeAndBitness(
418 418
419 for (DWORD dwIndex = 0; /* exit via break below */; ++dwIndex) 419 for (DWORD dwIndex = 0; /* exit via break below */; ++dwIndex)
420 { 420 {
421 hr = RegKeyEnum(hkUninstallKey, dwIndex, &sczRelatedBundleId); 421 hr = RegKeyEnum(hkUninstallKey, dwIndex, &sczRelatedBundleCode);
422 if (E_NOMOREITEMS == hr) 422 if (E_NOMOREITEMS == hr)
423 { 423 {
424 hr = S_OK; 424 hr = S_OK;
@@ -428,7 +428,7 @@ static HRESULT QueryRelatedBundlesForScopeAndBitness(
428 428
429 // Ignore failures here since we'll often find products that aren't actually 429 // Ignore failures here since we'll often find products that aren't actually
430 // related bundles (or even bundles at all). 430 // related bundles (or even bundles at all).
431 HRESULT hrRelatedBundle = QueryPotentialRelatedBundle(pQueryContext, hkUninstallKey, sczRelatedBundleId, &result); 431 HRESULT hrRelatedBundle = QueryPotentialRelatedBundle(pQueryContext, hkUninstallKey, sczRelatedBundleCode, &result);
432 if (SUCCEEDED(hrRelatedBundle) && BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE != result) 432 if (SUCCEEDED(hrRelatedBundle) && BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE != result)
433 { 433 {
434 ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED)); 434 ExitFunction1(hr = HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED));
@@ -436,7 +436,7 @@ static HRESULT QueryRelatedBundlesForScopeAndBitness(
436 } 436 }
437 437
438LExit: 438LExit:
439 ReleaseStr(sczRelatedBundleId); 439 ReleaseStr(sczRelatedBundleCode);
440 ReleaseRegKey(hkUninstallKey); 440 ReleaseRegKey(hkUninstallKey);
441 441
442 return hr; 442 return hr;
@@ -445,19 +445,19 @@ LExit:
445static HRESULT QueryPotentialRelatedBundle( 445static HRESULT QueryPotentialRelatedBundle(
446 __in BUNDLE_QUERY_CONTEXT* pQueryContext, 446 __in BUNDLE_QUERY_CONTEXT* pQueryContext,
447 __in HKEY hkUninstallKey, 447 __in HKEY hkUninstallKey,
448 __in_z LPCWSTR wzRelatedBundleId, 448 __in_z LPCWSTR wzRelatedBundleCode,
449 __inout BUNDLE_QUERY_CALLBACK_RESULT* pResult 449 __inout BUNDLE_QUERY_CALLBACK_RESULT* pResult
450 ) 450 )
451{ 451{
452 HRESULT hr = S_OK; 452 HRESULT hr = S_OK;
453 HKEY hkBundleId = NULL; 453 HKEY hkBundleCode = NULL;
454 BUNDLE_RELATION_TYPE relationType = BUNDLE_RELATION_NONE; 454 BUNDLE_RELATION_TYPE relationType = BUNDLE_RELATION_NONE;
455 BUNDLE_QUERY_RELATED_BUNDLE_RESULT bundle = { }; 455 BUNDLE_QUERY_RELATED_BUNDLE_RESULT bundle = { };
456 456
457 hr = RegOpenEx(hkUninstallKey, wzRelatedBundleId, KEY_READ, pQueryContext->regBitness, &hkBundleId); 457 hr = RegOpenEx(hkUninstallKey, wzRelatedBundleCode, KEY_READ, pQueryContext->regBitness, &hkBundleCode);
458 ButilExitOnFailure(hr, "Failed to open uninstall key for potential related bundle: %ls", wzRelatedBundleId); 458 ButilExitOnFailure(hr, "Failed to open uninstall key for potential related bundle: %ls", wzRelatedBundleCode);
459 459
460 hr = DetermineRelationType(pQueryContext, hkBundleId, &relationType); 460 hr = DetermineRelationType(pQueryContext, hkBundleCode, &relationType);
461 if (FAILED(hr)) 461 if (FAILED(hr))
462 { 462 {
463 ExitFunction(); 463 ExitFunction();
@@ -465,21 +465,21 @@ static HRESULT QueryPotentialRelatedBundle(
465 465
466 bundle.installContext = pQueryContext->installContext; 466 bundle.installContext = pQueryContext->installContext;
467 bundle.regBitness = pQueryContext->regBitness; 467 bundle.regBitness = pQueryContext->regBitness;
468 bundle.wzBundleId = wzRelatedBundleId; 468 bundle.wzBundleCode = wzRelatedBundleCode;
469 bundle.relationType = relationType; 469 bundle.relationType = relationType;
470 bundle.hkBundle = hkBundleId; 470 bundle.hkBundle = hkBundleCode;
471 471
472 *pResult = pQueryContext->pfnCallback(&bundle, pQueryContext->pvContext); 472 *pResult = pQueryContext->pfnCallback(&bundle, pQueryContext->pvContext);
473 473
474LExit: 474LExit:
475 ReleaseRegKey(hkBundleId); 475 ReleaseRegKey(hkBundleCode);
476 476
477 return hr; 477 return hr;
478} 478}
479 479
480static HRESULT DetermineRelationType( 480static HRESULT DetermineRelationType(
481 __in BUNDLE_QUERY_CONTEXT* pQueryContext, 481 __in BUNDLE_QUERY_CONTEXT* pQueryContext,
482 __in HKEY hkBundleId, 482 __in HKEY hkBundleCode,
483 __out BUNDLE_RELATION_TYPE* pRelationType 483 __out BUNDLE_RELATION_TYPE* pRelationType
484 ) 484 )
485{ 485{
@@ -499,7 +499,7 @@ static HRESULT DetermineRelationType(
499 499
500 *pRelationType = BUNDLE_RELATION_NONE; 500 *pRelationType = BUNDLE_RELATION_NONE;
501 501
502 hr = RegReadStringArray(hkBundleId, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_UPGRADE_CODE, &rgsczUpgradeCodes, &cUpgradeCodes); 502 hr = RegReadStringArray(hkBundleCode, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_UPGRADE_CODE, &rgsczUpgradeCodes, &cUpgradeCodes);
503 if (HRESULT_FROM_WIN32(ERROR_INVALID_DATATYPE) == hr) 503 if (HRESULT_FROM_WIN32(ERROR_INVALID_DATATYPE) == hr)
504 { 504 {
505 TraceError(hr, "Failed to read upgrade codes as REG_MULTI_SZ. Trying again as REG_SZ in case of older bundles."); 505 TraceError(hr, "Failed to read upgrade codes as REG_MULTI_SZ. Trying again as REG_SZ in case of older bundles.");
@@ -507,7 +507,7 @@ static HRESULT DetermineRelationType(
507 rgsczUpgradeCodes = reinterpret_cast<LPWSTR*>(MemAlloc(sizeof(LPWSTR), TRUE)); 507 rgsczUpgradeCodes = reinterpret_cast<LPWSTR*>(MemAlloc(sizeof(LPWSTR), TRUE));
508 ButilExitOnNull(rgsczUpgradeCodes, hr, E_OUTOFMEMORY, "Failed to allocate list for a single upgrade code from older bundle."); 508 ButilExitOnNull(rgsczUpgradeCodes, hr, E_OUTOFMEMORY, "Failed to allocate list for a single upgrade code from older bundle.");
509 509
510 hr = RegReadString(hkBundleId, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_UPGRADE_CODE, &rgsczUpgradeCodes[0]); 510 hr = RegReadString(hkBundleCode, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_UPGRADE_CODE, &rgsczUpgradeCodes[0]);
511 if (SUCCEEDED(hr)) 511 if (SUCCEEDED(hr))
512 { 512 {
513 cUpgradeCodes = 1; 513 cUpgradeCodes = 1;
@@ -581,7 +581,7 @@ static HRESULT DetermineRelationType(
581 } 581 }
582 582
583 // Compare addon codes. 583 // Compare addon codes.
584 hr = RegReadStringArray(hkBundleId, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_ADDON_CODE, &rgsczAddonCodes, &cAddonCodes); 584 hr = RegReadStringArray(hkBundleCode, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_ADDON_CODE, &rgsczAddonCodes, &cAddonCodes);
585 if (SUCCEEDED(hr)) 585 if (SUCCEEDED(hr))
586 { 586 {
587 hr = DictCreateStringListFromArray(&sdAddonCodes, rgsczAddonCodes, cAddonCodes, DICT_FLAG_CASEINSENSITIVE); 587 hr = DictCreateStringListFromArray(&sdAddonCodes, rgsczAddonCodes, cAddonCodes, DICT_FLAG_CASEINSENSITIVE);
@@ -620,7 +620,7 @@ static HRESULT DetermineRelationType(
620 } 620 }
621 621
622 // Compare patch codes. 622 // Compare patch codes.
623 hr = RegReadStringArray(hkBundleId, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_PATCH_CODE, &rgsczPatchCodes, &cPatchCodes); 623 hr = RegReadStringArray(hkBundleCode, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_PATCH_CODE, &rgsczPatchCodes, &cPatchCodes);
624 if (SUCCEEDED(hr)) 624 if (SUCCEEDED(hr))
625 { 625 {
626 hr = DictCreateStringListFromArray(&sdPatchCodes, rgsczPatchCodes, cPatchCodes, DICT_FLAG_CASEINSENSITIVE); 626 hr = DictCreateStringListFromArray(&sdPatchCodes, rgsczPatchCodes, cPatchCodes, DICT_FLAG_CASEINSENSITIVE);
@@ -659,7 +659,7 @@ static HRESULT DetermineRelationType(
659 } 659 }
660 660
661 // Compare detect codes. 661 // Compare detect codes.
662 hr = RegReadStringArray(hkBundleId, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_DETECT_CODE, &rgsczDetectCodes, &cDetectCodes); 662 hr = RegReadStringArray(hkBundleCode, BUNDLE_REGISTRATION_REGISTRY_BUNDLE_DETECT_CODE, &rgsczDetectCodes, &cDetectCodes);
663 if (SUCCEEDED(hr)) 663 if (SUCCEEDED(hr))
664 { 664 {
665 hr = DictCreateStringListFromArray(&sdDetectCodes, rgsczDetectCodes, cDetectCodes, DICT_FLAG_CASEINSENSITIVE); 665 hr = DictCreateStringListFromArray(&sdDetectCodes, rgsczDetectCodes, cDetectCodes, DICT_FLAG_CASEINSENSITIVE);
@@ -730,7 +730,7 @@ LExit:
730} 730}
731 731
732static HRESULT LocateAndQueryBundleValue( 732static HRESULT LocateAndQueryBundleValue(
733 __in_z LPCWSTR wzBundleId, 733 __in_z LPCWSTR wzBundleCode,
734 __in_opt LPCWSTR wzSubKey, 734 __in_opt LPCWSTR wzSubKey,
735 __in LPCWSTR wzValueName, 735 __in LPCWSTR wzValueName,
736 __inout HKEY* phKey, 736 __inout HKEY* phKey,
@@ -746,11 +746,11 @@ static HRESULT LocateAndQueryBundleValue(
746 746
747 if (wzSubKey) 747 if (wzSubKey)
748 { 748 {
749 hr = StrAllocFormatted(&sczKeypath, L"%ls\\%ls\\%ls", BUNDLE_REGISTRATION_REGISTRY_UNINSTALL_KEY, wzBundleId, wzSubKey); 749 hr = StrAllocFormatted(&sczKeypath, L"%ls\\%ls\\%ls", BUNDLE_REGISTRATION_REGISTRY_UNINSTALL_KEY, wzBundleCode, wzSubKey);
750 } 750 }
751 else 751 else
752 { 752 {
753 hr = StrAllocFormatted(&sczKeypath, L"%ls\\%ls", BUNDLE_REGISTRATION_REGISTRY_UNINSTALL_KEY, wzBundleId); 753 hr = StrAllocFormatted(&sczKeypath, L"%ls\\%ls", BUNDLE_REGISTRATION_REGISTRY_UNINSTALL_KEY, wzBundleCode);
754 } 754 }
755 ButilExitOnFailure(hr, "Failed to allocate bundle uninstall key path."); 755 ButilExitOnFailure(hr, "Failed to allocate bundle uninstall key path.");
756 756
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/butil.h b/src/libs/dutil/WixToolset.DUtil/inc/butil.h
index 5d390344..567d59d9 100644
--- a/src/libs/dutil/WixToolset.DUtil/inc/butil.h
+++ b/src/libs/dutil/WixToolset.DUtil/inc/butil.h
@@ -31,7 +31,7 @@ typedef enum _BUNDLE_RELATION_TYPE
31 31
32typedef struct _BUNDLE_QUERY_RELATED_BUNDLE_RESULT 32typedef struct _BUNDLE_QUERY_RELATED_BUNDLE_RESULT
33{ 33{
34 LPCWSTR wzBundleId; 34 LPCWSTR wzBundleCode;
35 BUNDLE_INSTALL_CONTEXT installContext; 35 BUNDLE_INSTALL_CONTEXT installContext;
36 REG_KEY_BITNESS regBitness; 36 REG_KEY_BITNESS regBitness;
37 HKEY hkBundle; 37 HKEY hkBundle;
@@ -61,7 +61,7 @@ RETURNS:
61 All other returns are unexpected returns from other dutil methods. 61 All other returns are unexpected returns from other dutil methods.
62********************************************************************/ 62********************************************************************/
63HRESULT DAPI BundleGetBundleInfo( 63HRESULT DAPI BundleGetBundleInfo(
64 __in_z LPCWSTR wzBundleId, 64 __in_z LPCWSTR wzBundleCode,
65 __in_z LPCWSTR wzAttribute, 65 __in_z LPCWSTR wzAttribute,
66 __deref_out_z LPWSTR* psczValue 66 __deref_out_z LPWSTR* psczValue
67 ); 67 );
@@ -84,7 +84,7 @@ RETURNS:
84 All other returns are unexpected returns from other dutil methods. 84 All other returns are unexpected returns from other dutil methods.
85********************************************************************/ 85********************************************************************/
86HRESULT DAPI BundleGetBundleInfoFixed( 86HRESULT DAPI BundleGetBundleInfoFixed(
87 __in_z LPCWSTR wzBundleId, 87 __in_z LPCWSTR wzBundleCode,
88 __in_z LPCWSTR wzAttribute, 88 __in_z LPCWSTR wzAttribute,
89 __out_ecount_opt(*pcchValue) LPWSTR wzValue, 89 __out_ecount_opt(*pcchValue) LPWSTR wzValue,
90 __inout SIZE_T* pcchValue 90 __inout SIZE_T* pcchValue
@@ -109,15 +109,16 @@ HRESULT DAPI BundleEnumRelatedBundle(
109 __in BUNDLE_INSTALL_CONTEXT context, 109 __in BUNDLE_INSTALL_CONTEXT context,
110 __in REG_KEY_BITNESS kbKeyBitness, 110 __in REG_KEY_BITNESS kbKeyBitness,
111 __inout PDWORD pdwStartIndex, 111 __inout PDWORD pdwStartIndex,
112 __deref_out_z LPWSTR* psczBundleId 112 __deref_out_z LPWSTR* psczBundleCode
113 ); 113 );
114 114
115/******************************************************************** 115/********************************************************************
116BundleEnumRelatedBundleFixed - Queries the bundle installation metadata for installs with the given upgrade code 116BundleEnumRelatedBundleFixed - Queries the bundle installation metadata for installs with the given upgrade code
117Enumerate 32-bit and 64-bit in two passes. 117Enumerate 32-bit and 64-bit in two passes.
118 118
119NOTE: lpBundleIdBuff is a buffer to receive the bundle GUID. This buffer must be 39 characters long. 119NOTE: wzBundleCode is a buffer to receive the bundle GUID. This buffer must be 39 characters long.
120 The first 38 characters are for the GUID, and the last character is for the terminating null character. 120 The first 38 characters are for the GUID, and the last character is for the terminating null character.
121
121RETURNS: 122RETURNS:
122 E_INVALIDARG 123 E_INVALIDARG
123 An invalid parameter was passed to the function. 124 An invalid parameter was passed to the function.
@@ -133,7 +134,7 @@ HRESULT DAPI BundleEnumRelatedBundleFixed(
133 __in BUNDLE_INSTALL_CONTEXT context, 134 __in BUNDLE_INSTALL_CONTEXT context,
134 __in REG_KEY_BITNESS kbKeyBitness, 135 __in REG_KEY_BITNESS kbKeyBitness,
135 __inout PDWORD pdwStartIndex, 136 __inout PDWORD pdwStartIndex,
136 __out_ecount(MAX_GUID_CHARS+1) LPWSTR wzBundleId 137 __out_ecount(MAX_GUID_CHARS+1) LPWSTR wzBundleCode
137 ); 138 );
138 139
139/******************************************************************** 140/********************************************************************
@@ -155,7 +156,7 @@ RETURNS:
155 All other returns are unexpected returns from other dutil methods. 156 All other returns are unexpected returns from other dutil methods.
156********************************************************************/ 157********************************************************************/
157HRESULT DAPI BundleGetBundleVariable( 158HRESULT DAPI BundleGetBundleVariable(
158 __in_z LPCWSTR wzBundleId, 159 __in_z LPCWSTR wzBundleCode,
159 __in_z LPCWSTR wzVariable, 160 __in_z LPCWSTR wzVariable,
160 __deref_out_z LPWSTR* psczValue 161 __deref_out_z LPWSTR* psczValue
161 ); 162 );
@@ -180,7 +181,7 @@ RETURNS:
180 All other returns are unexpected returns from other dutil methods. 181 All other returns are unexpected returns from other dutil methods.
181********************************************************************/ 182********************************************************************/
182HRESULT DAPI BundleGetBundleVariableFixed( 183HRESULT DAPI BundleGetBundleVariableFixed(
183 __in_z LPCWSTR wzBundleId, 184 __in_z LPCWSTR wzBundleCode,
184 __in_z LPCWSTR wzVariable, 185 __in_z LPCWSTR wzVariable,
185 __out_ecount_opt(*pcchValue) LPWSTR wzValue, 186 __out_ecount_opt(*pcchValue) LPWSTR wzValue,
186 __inout SIZE_T* pcchValue 187 __inout SIZE_T* pcchValue