diff options
| author | Bob Arnson <bob@firegiant.com> | 2026-02-04 20:47:04 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2026-02-04 20:47:04 -0500 |
| commit | edccb203c421d2bd820062024088c6698424d9ee (patch) | |
| tree | 6b47c3eb5ca53bd9f79f3d032dc1a596d411bf38 /src/burn/test/BurnUnitTest/RegistrationTest.cpp | |
| parent | a3d3963f806117ce123d95e8b77e73e1c1545b25 (diff) | |
| download | wix-bob/ConfigurableScopeBundles.tar.gz wix-bob/ConfigurableScopeBundles.tar.bz2 wix-bob/ConfigurableScopeBundles.zip | |
Support dual-purpose packages in Burn.bob/ConfigurableScopeBundles
Fixes https://github.com/wixtoolset/issues/issues/8958
Diffstat (limited to 'src/burn/test/BurnUnitTest/RegistrationTest.cpp')
| -rw-r--r-- | src/burn/test/BurnUnitTest/RegistrationTest.cpp | 56 |
1 files changed, 43 insertions, 13 deletions
diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp index 3068eb6a..1c43c442 100644 --- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp | |||
| @@ -9,11 +9,7 @@ | |||
| 9 | #define TEST_BUNDLE_UPGRADE_CODE L"{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}" | 9 | #define TEST_BUNDLE_UPGRADE_CODE L"{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}" |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | namespace Microsoft | 12 | namespace WixToolset |
| 13 | { | ||
| 14 | namespace Tools | ||
| 15 | { | ||
| 16 | namespace WindowsInstallerXml | ||
| 17 | { | 13 | { |
| 18 | namespace Test | 14 | namespace Test |
| 19 | { | 15 | { |
| @@ -73,7 +69,7 @@ namespace Bootstrapper | |||
| 73 | L" <UX PrimaryPayloadId='ux.exe'>" | 69 | L" <UX PrimaryPayloadId='ux.exe'>" |
| 74 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" | 70 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
| 75 | L" </UX>" | 71 | L" </UX>" |
| 76 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Tag='foo' ProviderKey='foo' Version='1.0.0.0' ExecutableName='setup.exe' PerMachine='no'>" | 72 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Scope='peruser' Tag='foo' ProviderKey='foo' Version='1.0.0.0' ExecutableName='setup.exe'>" |
| 77 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" | 73 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" |
| 78 | L" </Registration>" | 74 | L" </Registration>" |
| 79 | L"</Bundle>"; | 75 | L"</Bundle>"; |
| @@ -93,6 +89,12 @@ namespace Bootstrapper | |||
| 93 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 89 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
| 94 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); | 90 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); |
| 95 | 91 | ||
| 92 | hr = RegistrationSetPaths(®istration, &cache); | ||
| 93 | TestThrowOnFailure(hr, "Failed to set registration paths."); | ||
| 94 | |||
| 95 | hr = RegistrationPlanInitialize(®istration); | ||
| 96 | TestThrowOnFailure(hr, "Failed to initialize registration for the plan."); | ||
| 97 | |||
| 96 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; | 98 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; |
| 97 | plan.pCommand = &command; | 99 | plan.pCommand = &command; |
| 98 | plan.pInternalCommand = &internalCommand; | 100 | plan.pInternalCommand = &internalCommand; |
| @@ -173,7 +175,7 @@ namespace Bootstrapper | |||
| 173 | L" <UX PrimaryPayloadId='ux.exe'>" | 175 | L" <UX PrimaryPayloadId='ux.exe'>" |
| 174 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" | 176 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
| 175 | L" </UX>" | 177 | L" </UX>" |
| 176 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Tag='foo' ProviderKey='foo' Version='1.0.0.0' ExecutableName='setup.exe' PerMachine='no'>" | 178 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Scope='peruser' Tag='foo' ProviderKey='foo' Version='1.0.0.0' ExecutableName='setup.exe'>" |
| 177 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='Product1' InProgressDisplayName='Product1 Installation' DisplayVersion='1.0.0.0' />" | 179 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='Product1' InProgressDisplayName='Product1 Installation' DisplayVersion='1.0.0.0' />" |
| 178 | L" </Registration>" | 180 | L" </Registration>" |
| 179 | L"</Bundle>"; | 181 | L"</Bundle>"; |
| @@ -193,6 +195,12 @@ namespace Bootstrapper | |||
| 193 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 195 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
| 194 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); | 196 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); |
| 195 | 197 | ||
| 198 | hr = RegistrationSetPaths(®istration, &cache); | ||
| 199 | TestThrowOnFailure(hr, "Failed to set registration paths."); | ||
| 200 | |||
| 201 | hr = RegistrationPlanInitialize(®istration); | ||
| 202 | TestThrowOnFailure(hr, "Failed to initialize registration for the plan."); | ||
| 203 | |||
| 196 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; | 204 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; |
| 197 | plan.pCommand = &command; | 205 | plan.pCommand = &command; |
| 198 | plan.pInternalCommand = &internalCommand; | 206 | plan.pInternalCommand = &internalCommand; |
| @@ -294,7 +302,7 @@ namespace Bootstrapper | |||
| 294 | L" <UX PrimaryPayloadId='ux.exe'>" | 302 | L" <UX PrimaryPayloadId='ux.exe'>" |
| 295 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" | 303 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
| 296 | L" </UX>" | 304 | L" </UX>" |
| 297 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Tag='foo' ProviderKey='bar' Version='1.0.0.0' ExecutableName='setup.exe' PerMachine='no'>" | 305 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Scope='peruser' Tag='foo' ProviderKey='bar' Version='1.0.0.0' ExecutableName='setup.exe'>" |
| 298 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='Product1' DisplayVersion='1.0.0.0' />" | 306 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='Product1' DisplayVersion='1.0.0.0' />" |
| 299 | L" </Registration>" | 307 | L" </Registration>" |
| 300 | L"</Bundle>"; | 308 | L"</Bundle>"; |
| @@ -314,6 +322,12 @@ namespace Bootstrapper | |||
| 314 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 322 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
| 315 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); | 323 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); |
| 316 | 324 | ||
| 325 | hr = RegistrationSetPaths(®istration, &cache); | ||
| 326 | TestThrowOnFailure(hr, "Failed to set registration paths."); | ||
| 327 | |||
| 328 | hr = RegistrationPlanInitialize(®istration); | ||
| 329 | TestThrowOnFailure(hr, "Failed to initialize registration for the plan."); | ||
| 330 | |||
| 317 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; | 331 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; |
| 318 | plan.pCommand = &command; | 332 | plan.pCommand = &command; |
| 319 | plan.pInternalCommand = &internalCommand; | 333 | plan.pInternalCommand = &internalCommand; |
| @@ -415,7 +429,7 @@ namespace Bootstrapper | |||
| 415 | L" <UX PrimaryPayloadId='ux.exe'>" | 429 | L" <UX PrimaryPayloadId='ux.exe'>" |
| 416 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" | 430 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
| 417 | L" </UX>" | 431 | L" </UX>" |
| 418 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Tag='foo' ProviderKey='foo' Version='1.0.0.0' ExecutableName='setup.exe' PerMachine='no'>" | 432 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Scope='peruser' Tag='foo' ProviderKey='foo' Version='1.0.0.0' ExecutableName='setup.exe'>" |
| 419 | L" <Arp Register='yes' DisplayName='DisplayName1' DisplayVersion='1.2.3.4' Publisher='Publisher1' HelpLink='http://www.microsoft.com/help'" | 433 | L" <Arp Register='yes' DisplayName='DisplayName1' DisplayVersion='1.2.3.4' Publisher='Publisher1' HelpLink='http://www.microsoft.com/help'" |
| 420 | L" HelpTelephone='555-555-5555' AboutUrl='http://www.microsoft.com/about' UpdateUrl='http://www.microsoft.com/update'" | 434 | L" HelpTelephone='555-555-5555' AboutUrl='http://www.microsoft.com/about' UpdateUrl='http://www.microsoft.com/update'" |
| 421 | L" Comments='Comments1' Contact='Contact1' DisableModify='yes' DisableRemove='yes' />" | 435 | L" Comments='Comments1' Contact='Contact1' DisableModify='yes' DisableRemove='yes' />" |
| @@ -437,6 +451,12 @@ namespace Bootstrapper | |||
| 437 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 451 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
| 438 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); | 452 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); |
| 439 | 453 | ||
| 454 | hr = RegistrationSetPaths(®istration, &cache); | ||
| 455 | TestThrowOnFailure(hr, "Failed to set registration paths."); | ||
| 456 | |||
| 457 | hr = RegistrationPlanInitialize(®istration); | ||
| 458 | TestThrowOnFailure(hr, "Failed to initialize registration for the plan."); | ||
| 459 | |||
| 440 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; | 460 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; |
| 441 | plan.pCommand = &command; | 461 | plan.pCommand = &command; |
| 442 | plan.pInternalCommand = &internalCommand; | 462 | plan.pInternalCommand = &internalCommand; |
| @@ -554,7 +574,7 @@ namespace Bootstrapper | |||
| 554 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" | 574 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
| 555 | L" </UX>" | 575 | L" </UX>" |
| 556 | L" <RelatedBundle Code='" TEST_BUNDLE_UPGRADE_CODE L"' Action='Upgrade' />" | 576 | L" <RelatedBundle Code='" TEST_BUNDLE_UPGRADE_CODE L"' Action='Upgrade' />" |
| 557 | L" <Registration Code='" TEST_BUNDLE_ID L"' Tag='foo' ProviderKey='" TEST_BUNDLE_ID L"' Version='1.0.0.0' ExecutableName='setup.exe' PerMachine='no'>" | 577 | L" <Registration Code='" TEST_BUNDLE_ID L"' Scope='peruser' Tag='foo' ProviderKey='" TEST_BUNDLE_ID L"' Version='1.0.0.0' ExecutableName='setup.exe'>" |
| 558 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" | 578 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" |
| 559 | L" </Registration>" | 579 | L" </Registration>" |
| 560 | L" <Variable Id='MyBurnVariable1' Type='numeric' Value='0' Hidden='no' Persisted='yes' />" | 580 | L" <Variable Id='MyBurnVariable1' Type='numeric' Value='0' Hidden='no' Persisted='yes' />" |
| @@ -582,6 +602,12 @@ namespace Bootstrapper | |||
| 582 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 602 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
| 583 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); | 603 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); |
| 584 | 604 | ||
| 605 | hr = RegistrationSetPaths(®istration, &cache); | ||
| 606 | TestThrowOnFailure(hr, "Failed to set registration paths."); | ||
| 607 | |||
| 608 | hr = RegistrationPlanInitialize(®istration); | ||
| 609 | TestThrowOnFailure(hr, "Failed to initialize registration for the plan."); | ||
| 610 | |||
| 585 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; | 611 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; |
| 586 | plan.pCommand = &command; | 612 | plan.pCommand = &command; |
| 587 | plan.pInternalCommand = &internalCommand; | 613 | plan.pInternalCommand = &internalCommand; |
| @@ -694,7 +720,7 @@ namespace Bootstrapper | |||
| 694 | L" <UX PrimaryPayloadId='ux.exe'>" | 720 | L" <UX PrimaryPayloadId='ux.exe'>" |
| 695 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" | 721 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
| 696 | L" </UX>" | 722 | L" </UX>" |
| 697 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Tag='foo' ProviderKey='foo' Version='1.0.0.0' ExecutableName='setup.exe' PerMachine='no'>" | 723 | L" <Registration Code='{D54F896D-1952-43E6-9C67-B5652240618C}' UpgradeCode='{89FDAE1F-8CC1-48B9-B930-3945E0D3E7F0}' Scope='peruser' Tag='foo' ProviderKey='foo' Version='1.0.0.0' ExecutableName='setup.exe'>" |
| 698 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" | 724 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" |
| 699 | L" </Registration>" | 725 | L" </Registration>" |
| 700 | L" <Variable Id='MyBurnVariable1' Type='numeric' Value='0' Hidden='no' Persisted='yes' />" | 726 | L" <Variable Id='MyBurnVariable1' Type='numeric' Value='0' Hidden='no' Persisted='yes' />" |
| @@ -720,6 +746,12 @@ namespace Bootstrapper | |||
| 720 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 746 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
| 721 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); | 747 | TestThrowOnFailure(hr, L"Failed to parse registration from XML."); |
| 722 | 748 | ||
| 749 | hr = RegistrationSetPaths(®istration, &cache); | ||
| 750 | TestThrowOnFailure(hr, "Failed to set registration paths."); | ||
| 751 | |||
| 752 | hr = RegistrationPlanInitialize(®istration); | ||
| 753 | TestThrowOnFailure(hr, "Failed to initialize registration for the plan."); | ||
| 754 | |||
| 723 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; | 755 | plan.action = BOOTSTRAPPER_ACTION_INSTALL; |
| 724 | plan.pCommand = &command; | 756 | plan.pCommand = &command; |
| 725 | plan.pInternalCommand = &internalCommand; | 757 | plan.pInternalCommand = &internalCommand; |
| @@ -882,5 +914,3 @@ namespace Bootstrapper | |||
| 882 | } | 914 | } |
| 883 | } | 915 | } |
| 884 | } | 916 | } |
| 885 | } | ||
| 886 | } | ||
