diff options
author | Rob Mensching <rob@firegiant.com> | 2024-01-11 18:26:20 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2024-03-06 18:03:38 -0800 |
commit | 0d3d54992104288e9ee0c834d0b96e8502fd2d42 (patch) | |
tree | 9efa49c4983cd2ba1becab64bd1f2faccac88acf /src/burn/test/BurnUnitTest/RegistrationTest.cpp | |
parent | 2824298d9dd817a47527c920363556b54ead5d5d (diff) | |
download | wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.tar.gz wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.tar.bz2 wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.zip |
Move the BootstrapperApplication out of proc
Diffstat (limited to 'src/burn/test/BurnUnitTest/RegistrationTest.cpp')
-rw-r--r-- | src/burn/test/BurnUnitTest/RegistrationTest.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp index fc84511d..2d6515ef 100644 --- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp | |||
@@ -70,8 +70,8 @@ namespace Bootstrapper | |||
70 | 70 | ||
71 | LPCWSTR wzDocument = | 71 | LPCWSTR wzDocument = |
72 | L"<Bundle>" | 72 | L"<Bundle>" |
73 | L" <UX>" | 73 | L" <UX PrimaryPayloadId='ux.exe'>" |
74 | L" <Payload Id='ux.dll' FilePath='ux.dll' Packaging='embedded' SourcePath='ux.dll' Hash='000000000000' />" | 74 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
75 | L" </UX>" | 75 | L" </UX>" |
76 | L" <Registration Id='{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'>" | 76 | L" <Registration Id='{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'>" |
77 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" | 77 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" |
@@ -87,7 +87,7 @@ namespace Bootstrapper | |||
87 | hr = VariableInitialize(&variables); | 87 | hr = VariableInitialize(&variables); |
88 | TestThrowOnFailure(hr, L"Failed to initialize variables."); | 88 | TestThrowOnFailure(hr, L"Failed to initialize variables."); |
89 | 89 | ||
90 | hr = UserExperienceParseFromXml(&userExperience, pixeBundle); | 90 | hr = BootstrapperApplicationParseFromXml(&userExperience, pixeBundle); |
91 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); | 91 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); |
92 | 92 | ||
93 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 93 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
@@ -130,7 +130,7 @@ namespace Bootstrapper | |||
130 | { | 130 | { |
131 | ReleaseStr(sczCurrentProcess); | 131 | ReleaseStr(sczCurrentProcess); |
132 | ReleaseObject(pixeBundle); | 132 | ReleaseObject(pixeBundle); |
133 | UserExperienceUninitialize(&userExperience); | 133 | BootstrapperApplicationUninitialize(&userExperience); |
134 | RegistrationUninitialize(®istration); | 134 | RegistrationUninitialize(®istration); |
135 | VariablesUninitialize(&variables); | 135 | VariablesUninitialize(&variables); |
136 | 136 | ||
@@ -170,8 +170,8 @@ namespace Bootstrapper | |||
170 | 170 | ||
171 | LPCWSTR wzDocument = | 171 | LPCWSTR wzDocument = |
172 | L"<Bundle>" | 172 | L"<Bundle>" |
173 | L" <UX>" | 173 | L" <UX PrimaryPayloadId='ux.exe'>" |
174 | L" <Payload Id='ux.dll' FilePath='ux.dll' Packaging='embedded' SourcePath='ux.dll' Hash='000000000000' />" | 174 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
175 | L" </UX>" | 175 | L" </UX>" |
176 | L" <Registration Id='{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'>" | 176 | L" <Registration Id='{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'>" |
177 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='Product1' InProgressDisplayName='Product1 Installation' DisplayVersion='1.0.0.0' />" | 177 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='Product1' InProgressDisplayName='Product1 Installation' DisplayVersion='1.0.0.0' />" |
@@ -187,7 +187,7 @@ namespace Bootstrapper | |||
187 | hr = VariableInitialize(&variables); | 187 | hr = VariableInitialize(&variables); |
188 | TestThrowOnFailure(hr, L"Failed to initialize variables."); | 188 | TestThrowOnFailure(hr, L"Failed to initialize variables."); |
189 | 189 | ||
190 | hr = UserExperienceParseFromXml(&userExperience, pixeBundle); | 190 | hr = BootstrapperApplicationParseFromXml(&userExperience, pixeBundle); |
191 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); | 191 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); |
192 | 192 | ||
193 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 193 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
@@ -251,7 +251,7 @@ namespace Bootstrapper | |||
251 | { | 251 | { |
252 | ReleaseStr(sczCurrentProcess); | 252 | ReleaseStr(sczCurrentProcess); |
253 | ReleaseObject(pixeBundle); | 253 | ReleaseObject(pixeBundle); |
254 | UserExperienceUninitialize(&userExperience); | 254 | BootstrapperApplicationUninitialize(&userExperience); |
255 | RegistrationUninitialize(®istration); | 255 | RegistrationUninitialize(®istration); |
256 | VariablesUninitialize(&variables); | 256 | VariablesUninitialize(&variables); |
257 | 257 | ||
@@ -291,8 +291,8 @@ namespace Bootstrapper | |||
291 | 291 | ||
292 | LPCWSTR wzDocument = | 292 | LPCWSTR wzDocument = |
293 | L"<Bundle>" | 293 | L"<Bundle>" |
294 | L" <UX>" | 294 | L" <UX PrimaryPayloadId='ux.exe'>" |
295 | L" <Payload Id='ux.dll' FilePath='ux.dll' Packaging='embedded' SourcePath='ux.dll' Hash='000000000000' />" | 295 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
296 | L" </UX>" | 296 | L" </UX>" |
297 | L" <Registration Id='{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'>" | 297 | L" <Registration Id='{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'>" |
298 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='Product1' DisplayVersion='1.0.0.0' />" | 298 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='Product1' DisplayVersion='1.0.0.0' />" |
@@ -308,7 +308,7 @@ namespace Bootstrapper | |||
308 | hr = VariableInitialize(&variables); | 308 | hr = VariableInitialize(&variables); |
309 | TestThrowOnFailure(hr, L"Failed to initialize variables."); | 309 | TestThrowOnFailure(hr, L"Failed to initialize variables."); |
310 | 310 | ||
311 | hr = UserExperienceParseFromXml(&userExperience, pixeBundle); | 311 | hr = BootstrapperApplicationParseFromXml(&userExperience, pixeBundle); |
312 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); | 312 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); |
313 | 313 | ||
314 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 314 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
@@ -372,7 +372,7 @@ namespace Bootstrapper | |||
372 | { | 372 | { |
373 | ReleaseStr(sczCurrentProcess); | 373 | ReleaseStr(sczCurrentProcess); |
374 | ReleaseObject(pixeBundle); | 374 | ReleaseObject(pixeBundle); |
375 | UserExperienceUninitialize(&userExperience); | 375 | BootstrapperApplicationUninitialize(&userExperience); |
376 | RegistrationUninitialize(®istration); | 376 | RegistrationUninitialize(®istration); |
377 | VariablesUninitialize(&variables); | 377 | VariablesUninitialize(&variables); |
378 | 378 | ||
@@ -412,8 +412,8 @@ namespace Bootstrapper | |||
412 | 412 | ||
413 | LPCWSTR wzDocument = | 413 | LPCWSTR wzDocument = |
414 | L"<Bundle>" | 414 | L"<Bundle>" |
415 | L" <UX UxDllPayloadId='ux.dll'>" | 415 | L" <UX PrimaryPayloadId='ux.exe'>" |
416 | L" <Payload Id='ux.dll' FilePath='ux.dll' Packaging='embedded' SourcePath='ux.dll' Hash='000000000000' />" | 416 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
417 | L" </UX>" | 417 | L" </UX>" |
418 | L" <Registration Id='{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'>" | 418 | L" <Registration Id='{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'>" |
419 | L" <Arp Register='yes' DisplayName='DisplayName1' DisplayVersion='1.2.3.4' Publisher='Publisher1' HelpLink='http://www.microsoft.com/help'" | 419 | L" <Arp Register='yes' DisplayName='DisplayName1' DisplayVersion='1.2.3.4' Publisher='Publisher1' HelpLink='http://www.microsoft.com/help'" |
@@ -431,7 +431,7 @@ namespace Bootstrapper | |||
431 | hr = VariableInitialize(&variables); | 431 | hr = VariableInitialize(&variables); |
432 | TestThrowOnFailure(hr, L"Failed to initialize variables."); | 432 | TestThrowOnFailure(hr, L"Failed to initialize variables."); |
433 | 433 | ||
434 | hr = UserExperienceParseFromXml(&userExperience, pixeBundle); | 434 | hr = BootstrapperApplicationParseFromXml(&userExperience, pixeBundle); |
435 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); | 435 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); |
436 | 436 | ||
437 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 437 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
@@ -505,7 +505,7 @@ namespace Bootstrapper | |||
505 | { | 505 | { |
506 | ReleaseStr(sczCurrentProcess); | 506 | ReleaseStr(sczCurrentProcess); |
507 | ReleaseObject(pixeBundle); | 507 | ReleaseObject(pixeBundle); |
508 | UserExperienceUninitialize(&userExperience); | 508 | BootstrapperApplicationUninitialize(&userExperience); |
509 | RegistrationUninitialize(®istration); | 509 | RegistrationUninitialize(®istration); |
510 | VariablesUninitialize(&variables); | 510 | VariablesUninitialize(&variables); |
511 | 511 | ||
@@ -540,7 +540,7 @@ namespace Bootstrapper | |||
540 | SIZE_T cbBuffer = 0; | 540 | SIZE_T cbBuffer = 0; |
541 | DWORD dwRegistrationOptions = 0; | 541 | DWORD dwRegistrationOptions = 0; |
542 | DWORD64 qwEstimatedSize = 1024; | 542 | DWORD64 qwEstimatedSize = 1024; |
543 | 543 | ||
544 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 544 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
545 | try | 545 | try |
546 | { | 546 | { |
@@ -550,8 +550,8 @@ namespace Bootstrapper | |||
550 | 550 | ||
551 | LPCWSTR wzDocument = | 551 | LPCWSTR wzDocument = |
552 | L"<Bundle>" | 552 | L"<Bundle>" |
553 | L" <UX>" | 553 | L" <UX PrimaryPayloadId='ux.exe'>" |
554 | L" <Payload Id='ux.dll' FilePath='ux.dll' Packaging='embedded' SourcePath='ux.dll' Hash='000000000000' />" | 554 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
555 | L" </UX>" | 555 | L" </UX>" |
556 | L" <RelatedBundle Id='" TEST_BUNDLE_UPGRADE_CODE L"' Action='Upgrade' />" | 556 | L" <RelatedBundle Id='" TEST_BUNDLE_UPGRADE_CODE L"' Action='Upgrade' />" |
557 | L" <Registration Id='" TEST_BUNDLE_ID L"' Tag='foo' ProviderKey='" TEST_BUNDLE_ID L"' Version='1.0.0.0' ExecutableName='setup.exe' PerMachine='no'>" | 557 | L" <Registration Id='" TEST_BUNDLE_ID L"' Tag='foo' ProviderKey='" TEST_BUNDLE_ID L"' Version='1.0.0.0' ExecutableName='setup.exe' PerMachine='no'>" |
@@ -576,7 +576,7 @@ namespace Bootstrapper | |||
576 | hr = VariablesParseFromXml(&variables, pixeBundle); | 576 | hr = VariablesParseFromXml(&variables, pixeBundle); |
577 | TestThrowOnFailure(hr, L"Failed to parse variables from XML."); | 577 | TestThrowOnFailure(hr, L"Failed to parse variables from XML."); |
578 | 578 | ||
579 | hr = UserExperienceParseFromXml(&userExperience, pixeBundle); | 579 | hr = BootstrapperApplicationParseFromXml(&userExperience, pixeBundle); |
580 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); | 580 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); |
581 | 581 | ||
582 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 582 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
@@ -612,7 +612,7 @@ namespace Bootstrapper | |||
612 | hr = RegistrationSaveState(®istration, pbBuffer, cbBuffer); | 612 | hr = RegistrationSaveState(®istration, pbBuffer, cbBuffer); |
613 | TestThrowOnFailure(hr, L"Failed to save state."); | 613 | TestThrowOnFailure(hr, L"Failed to save state."); |
614 | 614 | ||
615 | ReleaseNullBuffer(pbBuffer); | 615 | ReleaseNullMem(pbBuffer); |
616 | cbBuffer = 0; | 616 | cbBuffer = 0; |
617 | 617 | ||
618 | // Verify the variables exist | 618 | // Verify the variables exist |
@@ -646,7 +646,7 @@ namespace Bootstrapper | |||
646 | ReleaseStr(sczRelatedBundleId); | 646 | ReleaseStr(sczRelatedBundleId); |
647 | ReleaseStr(sczCurrentProcess); | 647 | ReleaseStr(sczCurrentProcess); |
648 | ReleaseObject(pixeBundle); | 648 | ReleaseObject(pixeBundle); |
649 | UserExperienceUninitialize(&userExperience); | 649 | BootstrapperApplicationUninitialize(&userExperience); |
650 | RegistrationUninitialize(®istration); | 650 | RegistrationUninitialize(®istration); |
651 | VariablesUninitialize(&variables); | 651 | VariablesUninitialize(&variables); |
652 | 652 | ||
@@ -691,8 +691,8 @@ namespace Bootstrapper | |||
691 | 691 | ||
692 | LPCWSTR wzDocument = | 692 | LPCWSTR wzDocument = |
693 | L"<Bundle>" | 693 | L"<Bundle>" |
694 | L" <UX>" | 694 | L" <UX PrimaryPayloadId='ux.exe'>" |
695 | L" <Payload Id='ux.dll' FilePath='ux.dll' Packaging='embedded' SourcePath='ux.dll' Hash='000000000000' />" | 695 | L" <Payload Id='ux.exe' FilePath='ux.exe' Packaging='embedded' SourcePath='ux.exe' Hash='000000000000' />" |
696 | L" </UX>" | 696 | L" </UX>" |
697 | L" <Registration Id='{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'>" | 697 | L" <Registration Id='{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'>" |
698 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" | 698 | L" <Arp Register='yes' Publisher='WiX Toolset' DisplayName='RegisterBasicTest' DisplayVersion='1.0.0.0' />" |
@@ -714,7 +714,7 @@ namespace Bootstrapper | |||
714 | hr = VariablesParseFromXml(&variables, pixeBundle); | 714 | hr = VariablesParseFromXml(&variables, pixeBundle); |
715 | TestThrowOnFailure(hr, L"Failed to parse variables from XML."); | 715 | TestThrowOnFailure(hr, L"Failed to parse variables from XML."); |
716 | 716 | ||
717 | hr = UserExperienceParseFromXml(&userExperience, pixeBundle); | 717 | hr = BootstrapperApplicationParseFromXml(&userExperience, pixeBundle); |
718 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); | 718 | TestThrowOnFailure(hr, L"Failed to parse UX from XML."); |
719 | 719 | ||
720 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); | 720 | hr = RegistrationParseFromXml(®istration, &cache, pixeBundle); |
@@ -755,7 +755,7 @@ namespace Bootstrapper | |||
755 | hr = RegistrationSaveState(®istration, pbBuffer, cbBuffer); | 755 | hr = RegistrationSaveState(®istration, pbBuffer, cbBuffer); |
756 | TestThrowOnFailure(hr, L"Failed to save state."); | 756 | TestThrowOnFailure(hr, L"Failed to save state."); |
757 | 757 | ||
758 | ReleaseNullBuffer(pbBuffer); | 758 | ReleaseNullMem(pbBuffer); |
759 | cbBuffer = 0; | 759 | cbBuffer = 0; |
760 | 760 | ||
761 | // Verify the variables exist | 761 | // Verify the variables exist |
@@ -816,7 +816,7 @@ namespace Bootstrapper | |||
816 | { | 816 | { |
817 | ReleaseStr(sczCurrentProcess); | 817 | ReleaseStr(sczCurrentProcess); |
818 | ReleaseObject(pixeBundle); | 818 | ReleaseObject(pixeBundle); |
819 | UserExperienceUninitialize(&userExperience); | 819 | BootstrapperApplicationUninitialize(&userExperience); |
820 | RegistrationUninitialize(®istration); | 820 | RegistrationUninitialize(®istration); |
821 | VariablesUninitialize(&variables); | 821 | VariablesUninitialize(&variables); |
822 | 822 | ||
@@ -836,7 +836,7 @@ namespace Bootstrapper | |||
836 | 836 | ||
837 | void ValidateRunOnceKeyEntry(String^ exePath) | 837 | void ValidateRunOnceKeyEntry(String^ exePath) |
838 | { | 838 | { |
839 | this->ValidateRunOnceKeyString(TEST_BUNDLE_ID, String::Concat(L"\"", exePath, L"\" /burn.clean.room /burn.runonce")); | 839 | this->ValidateRunOnceKeyString(TEST_BUNDLE_ID, String::Concat(L"\"", exePath, L"\" /burn.runonce")); |
840 | } | 840 | } |
841 | 841 | ||
842 | void ValidateUninstallKeyNull(LPCWSTR valueName) | 842 | void ValidateUninstallKeyNull(LPCWSTR valueName) |