diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-01-31 15:44:00 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-02-01 23:36:23 -0600 |
commit | 56c980318e7167be591f7807c2fc34cea7d5cb42 (patch) | |
tree | e074b3548d8dfe51f420b6d0278a6fe17191b6ec /src/burn/test/BurnUnitTest/RegistrationTest.cpp | |
parent | bfe5ab76b5ecc1a21078534e6fba90d12cfd3c00 (diff) | |
download | wix-56c980318e7167be591f7807c2fc34cea7d5cb42.tar.gz wix-56c980318e7167be591f7807c2fc34cea7d5cb42.tar.bz2 wix-56c980318e7167be591f7807c2fc34cea7d5cb42.zip |
The bundle provider's presence needs to follow ARP registration.
Diffstat (limited to 'src/burn/test/BurnUnitTest/RegistrationTest.cpp')
-rw-r--r-- | src/burn/test/BurnUnitTest/RegistrationTest.cpp | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp index d2ec0a82..2ebab277 100644 --- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp | |||
@@ -79,6 +79,7 @@ namespace Bootstrapper | |||
79 | BURN_CACHE cache = { }; | 79 | BURN_CACHE cache = { }; |
80 | BURN_ENGINE_COMMAND internalCommand = { }; | 80 | BURN_ENGINE_COMMAND internalCommand = { }; |
81 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 81 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
82 | DWORD dwRegistrationOptions = BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE; | ||
82 | 83 | ||
83 | try | 84 | try |
84 | { | 85 | { |
@@ -125,7 +126,7 @@ namespace Bootstrapper | |||
125 | TestThrowOnFailure(hr, L"Failed to get current process path."); | 126 | TestThrowOnFailure(hr, L"Failed to get current process path."); |
126 | 127 | ||
127 | // write registration | 128 | // write registration |
128 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE | BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 129 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
129 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 130 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
130 | 131 | ||
131 | // verify that registration was created | 132 | // verify that registration was created |
@@ -136,7 +137,7 @@ namespace Bootstrapper | |||
136 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)(Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr))); | 137 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)(Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr))); |
137 | 138 | ||
138 | // end session | 139 | // end session |
139 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 140 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
140 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 141 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
141 | 142 | ||
142 | // verify that registration was removed | 143 | // verify that registration was removed |
@@ -179,6 +180,7 @@ namespace Bootstrapper | |||
179 | BURN_CACHE cache = { }; | 180 | BURN_CACHE cache = { }; |
180 | BURN_ENGINE_COMMAND internalCommand = { }; | 181 | BURN_ENGINE_COMMAND internalCommand = { }; |
181 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 182 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
183 | DWORD dwRegistrationOptions = 0; | ||
182 | try | 184 | try |
183 | { | 185 | { |
184 | // set mock API's | 186 | // set mock API's |
@@ -228,7 +230,7 @@ namespace Bootstrapper | |||
228 | // | 230 | // |
229 | 231 | ||
230 | // write registration | 232 | // write registration |
231 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 233 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
232 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 234 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
233 | 235 | ||
234 | // verify that registration was created | 236 | // verify that registration was created |
@@ -237,7 +239,7 @@ namespace Bootstrapper | |||
237 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); | 239 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); |
238 | 240 | ||
239 | // complete registration | 241 | // complete registration |
240 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 242 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
241 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 243 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
242 | 244 | ||
243 | // verify that registration was updated | 245 | // verify that registration was updated |
@@ -250,7 +252,7 @@ namespace Bootstrapper | |||
250 | // | 252 | // |
251 | 253 | ||
252 | // write registration | 254 | // write registration |
253 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 255 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
254 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 256 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
255 | 257 | ||
256 | // verify that registration was updated | 258 | // verify that registration was updated |
@@ -259,7 +261,7 @@ namespace Bootstrapper | |||
259 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); | 261 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); |
260 | 262 | ||
261 | // delete registration | 263 | // delete registration |
262 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 264 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
263 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 265 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
264 | 266 | ||
265 | // verify that registration was removed | 267 | // verify that registration was removed |
@@ -301,6 +303,7 @@ namespace Bootstrapper | |||
301 | BURN_CACHE cache = { }; | 303 | BURN_CACHE cache = { }; |
302 | BURN_ENGINE_COMMAND internalCommand = { }; | 304 | BURN_ENGINE_COMMAND internalCommand = { }; |
303 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 305 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
306 | DWORD dwRegistrationOptions = 0; | ||
304 | try | 307 | try |
305 | { | 308 | { |
306 | // set mock API's | 309 | // set mock API's |
@@ -350,7 +353,7 @@ namespace Bootstrapper | |||
350 | // | 353 | // |
351 | 354 | ||
352 | // write registration | 355 | // write registration |
353 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 356 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
354 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 357 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
355 | 358 | ||
356 | // verify that registration was created | 359 | // verify that registration was created |
@@ -358,7 +361,7 @@ namespace Bootstrapper | |||
358 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); | 361 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); |
359 | 362 | ||
360 | // complete registration | 363 | // complete registration |
361 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_FULL); | 364 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BOOTSTRAPPER_REGISTRATION_TYPE_FULL); |
362 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 365 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
363 | 366 | ||
364 | // verify that registration variables were updated | 367 | // verify that registration variables were updated |
@@ -378,7 +381,7 @@ namespace Bootstrapper | |||
378 | // | 381 | // |
379 | 382 | ||
380 | // delete registration | 383 | // delete registration |
381 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 384 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
382 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 385 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
383 | 386 | ||
384 | // verify that registration was removed | 387 | // verify that registration was removed |
@@ -420,6 +423,7 @@ namespace Bootstrapper | |||
420 | BURN_CACHE cache = { }; | 423 | BURN_CACHE cache = { }; |
421 | BURN_ENGINE_COMMAND internalCommand = { }; | 424 | BURN_ENGINE_COMMAND internalCommand = { }; |
422 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 425 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
426 | DWORD dwRegistrationOptions = 0; | ||
423 | try | 427 | try |
424 | { | 428 | { |
425 | // set mock API's | 429 | // set mock API's |
@@ -471,7 +475,7 @@ namespace Bootstrapper | |||
471 | // | 475 | // |
472 | 476 | ||
473 | // write registration | 477 | // write registration |
474 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 478 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
475 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 479 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
476 | 480 | ||
477 | // verify that registration was created | 481 | // verify that registration was created |
@@ -479,7 +483,7 @@ namespace Bootstrapper | |||
479 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); | 483 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); |
480 | 484 | ||
481 | // finish registration | 485 | // finish registration |
482 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_FULL); | 486 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_FULL); |
483 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 487 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
484 | 488 | ||
485 | // verify that registration was updated | 489 | // verify that registration was updated |
@@ -504,7 +508,7 @@ namespace Bootstrapper | |||
504 | // | 508 | // |
505 | 509 | ||
506 | // write registration | 510 | // write registration |
507 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 511 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
508 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 512 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
509 | 513 | ||
510 | // verify that registration was updated | 514 | // verify that registration was updated |
@@ -512,7 +516,7 @@ namespace Bootstrapper | |||
512 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); | 516 | Assert::Equal<String^>(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.clean.room /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); |
513 | 517 | ||
514 | // delete registration | 518 | // delete registration |
515 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 519 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
516 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 520 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
517 | 521 | ||
518 | // verify that registration was removed | 522 | // verify that registration was removed |
@@ -558,6 +562,7 @@ namespace Bootstrapper | |||
558 | BURN_ENGINE_COMMAND internalCommand = { }; | 562 | BURN_ENGINE_COMMAND internalCommand = { }; |
559 | BYTE* pbBuffer = NULL; | 563 | BYTE* pbBuffer = NULL; |
560 | SIZE_T cbBuffer = 0; | 564 | SIZE_T cbBuffer = 0; |
565 | DWORD dwRegistrationOptions = 0; | ||
561 | 566 | ||
562 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 567 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
563 | try | 568 | try |
@@ -614,7 +619,7 @@ namespace Bootstrapper | |||
614 | TestThrowOnFailure(hr, L"Failed to get current process path."); | 619 | TestThrowOnFailure(hr, L"Failed to get current process path."); |
615 | 620 | ||
616 | // begin session | 621 | // begin session |
617 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 622 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
618 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 623 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
619 | 624 | ||
620 | VariableSetNumericHelper(&variables, L"MyBurnVariable1", 42); | 625 | VariableSetNumericHelper(&variables, L"MyBurnVariable1", 42); |
@@ -657,7 +662,7 @@ namespace Bootstrapper | |||
657 | NativeAssert::StringEqual(L"42", sczValue); | 662 | NativeAssert::StringEqual(L"42", sczValue); |
658 | 663 | ||
659 | // end session | 664 | // end session |
660 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 665 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
661 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 666 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
662 | } | 667 | } |
663 | finally | 668 | finally |
@@ -700,6 +705,7 @@ namespace Bootstrapper | |||
700 | SIZE_T cbBuffer = 0; | 705 | SIZE_T cbBuffer = 0; |
701 | SIZE_T piBuffer = 0; | 706 | SIZE_T piBuffer = 0; |
702 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 707 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
708 | DWORD dwRegistrationOptions = 0; | ||
703 | try | 709 | try |
704 | { | 710 | { |
705 | // set mock API's | 711 | // set mock API's |
@@ -758,7 +764,7 @@ namespace Bootstrapper | |||
758 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_NONE, (int)resumeType); | 764 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_NONE, (int)resumeType); |
759 | 765 | ||
760 | // begin session | 766 | // begin session |
761 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_REGISTRATION, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 767 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
762 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 768 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
763 | 769 | ||
764 | VariableSetNumericHelper(&variables, L"MyBurnVariable1", 42); | 770 | VariableSetNumericHelper(&variables, L"MyBurnVariable1", 42); |
@@ -797,7 +803,7 @@ namespace Bootstrapper | |||
797 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); | 803 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); |
798 | 804 | ||
799 | // suspend session | 805 | // suspend session |
800 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 806 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
801 | TestThrowOnFailure(hr, L"Failed to suspend session."); | 807 | TestThrowOnFailure(hr, L"Failed to suspend session."); |
802 | 808 | ||
803 | // verify that run key was removed | 809 | // verify that run key was removed |
@@ -824,7 +830,7 @@ namespace Bootstrapper | |||
824 | Assert::NotEqual((Object^)nullptr, Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); | 830 | Assert::NotEqual((Object^)nullptr, Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(TEST_BUNDLE_ID), nullptr)); |
825 | 831 | ||
826 | // end session | 832 | // end session |
827 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 833 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
828 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 834 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
829 | 835 | ||
830 | // read resume type after session | 836 | // read resume type after session |