diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-04-22 16:56:21 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-04-23 15:40:21 -0500 |
commit | a981e29d7a3df566754356c3fe1eb938a5cac4c1 (patch) | |
tree | 9d2b2abac872ae3c4917003812951e68b72e7163 /src/burn/test/BurnUnitTest | |
parent | 72e20f682c0d64102e86439ba5527dd0d71932ae (diff) | |
download | wix-a981e29d7a3df566754356c3fe1eb938a5cac4c1.tar.gz wix-a981e29d7a3df566754356c3fe1eb938a5cac4c1.tar.bz2 wix-a981e29d7a3df566754356c3fe1eb938a5cac4c1.zip |
Make the estimated size in ARP a little more accurate.
Fixes 4039
Diffstat (limited to 'src/burn/test/BurnUnitTest')
-rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 25 | ||||
-rw-r--r-- | src/burn/test/BurnUnitTest/RegistrationTest.cpp | 42 |
2 files changed, 26 insertions, 41 deletions
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index f69606a0..be078c5c 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
@@ -106,7 +106,6 @@ namespace Bootstrapper | |||
106 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 14); | 106 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 14); |
107 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 107 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
108 | 108 | ||
109 | Assert::Equal(107082ull, pPlan->qwEstimatedSize); | ||
110 | Assert::Equal(522548ull, pPlan->qwCacheSizeTotal); | 109 | Assert::Equal(522548ull, pPlan->qwCacheSizeTotal); |
111 | 110 | ||
112 | fRollback = FALSE; | 111 | fRollback = FALSE; |
@@ -252,7 +251,6 @@ namespace Bootstrapper | |||
252 | dwIndex = 0; | 251 | dwIndex = 0; |
253 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 252 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
254 | 253 | ||
255 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
256 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 254 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
257 | 255 | ||
258 | fRollback = FALSE; | 256 | fRollback = FALSE; |
@@ -392,7 +390,6 @@ namespace Bootstrapper | |||
392 | dwIndex = 0; | 390 | dwIndex = 0; |
393 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 391 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
394 | 392 | ||
395 | Assert::Equal(18575450ull, pPlan->qwEstimatedSize); | ||
396 | Assert::Equal(78462280ull, pPlan->qwCacheSizeTotal); | 393 | Assert::Equal(78462280ull, pPlan->qwCacheSizeTotal); |
397 | 394 | ||
398 | fRollback = FALSE; | 395 | fRollback = FALSE; |
@@ -503,7 +500,6 @@ namespace Bootstrapper | |||
503 | dwIndex = 0; | 500 | dwIndex = 0; |
504 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 501 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
505 | 502 | ||
506 | Assert::Equal(18575450ull, pPlan->qwEstimatedSize); | ||
507 | Assert::Equal(52254105ull, pPlan->qwCacheSizeTotal); | 503 | Assert::Equal(52254105ull, pPlan->qwCacheSizeTotal); |
508 | 504 | ||
509 | fRollback = FALSE; | 505 | fRollback = FALSE; |
@@ -595,7 +591,6 @@ namespace Bootstrapper | |||
595 | dwIndex = 0; | 591 | dwIndex = 0; |
596 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 592 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
597 | 593 | ||
598 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
599 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 594 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
600 | 595 | ||
601 | fRollback = FALSE; | 596 | fRollback = FALSE; |
@@ -703,7 +698,6 @@ namespace Bootstrapper | |||
703 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 698 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
704 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 699 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
705 | 700 | ||
706 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); | ||
707 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); | 701 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); |
708 | 702 | ||
709 | fRollback = FALSE; | 703 | fRollback = FALSE; |
@@ -823,7 +817,6 @@ namespace Bootstrapper | |||
823 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 817 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
824 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 818 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
825 | 819 | ||
826 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); | ||
827 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); | 820 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); |
828 | 821 | ||
829 | fRollback = FALSE; | 822 | fRollback = FALSE; |
@@ -924,7 +917,6 @@ namespace Bootstrapper | |||
924 | dwIndex = 0; | 917 | dwIndex = 0; |
925 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 918 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
926 | 919 | ||
927 | Assert::Equal(1463267ull, pPlan->qwEstimatedSize); | ||
928 | Assert::Equal(119695ull, pPlan->qwCacheSizeTotal); | 920 | Assert::Equal(119695ull, pPlan->qwCacheSizeTotal); |
929 | 921 | ||
930 | fRollback = FALSE; | 922 | fRollback = FALSE; |
@@ -1021,7 +1013,6 @@ namespace Bootstrapper | |||
1021 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 1013 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
1022 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1014 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1023 | 1015 | ||
1024 | Assert::Equal(33743ull, pPlan->qwEstimatedSize); | ||
1025 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); | 1016 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); |
1026 | 1017 | ||
1027 | fRollback = FALSE; | 1018 | fRollback = FALSE; |
@@ -1104,7 +1095,6 @@ namespace Bootstrapper | |||
1104 | dwIndex = 0; | 1095 | dwIndex = 0; |
1105 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1096 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1106 | 1097 | ||
1107 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
1108 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 1098 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
1109 | 1099 | ||
1110 | fRollback = FALSE; | 1100 | fRollback = FALSE; |
@@ -1180,7 +1170,6 @@ namespace Bootstrapper | |||
1180 | dwIndex = 0; | 1170 | dwIndex = 0; |
1181 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1171 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1182 | 1172 | ||
1183 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
1184 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 1173 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
1185 | 1174 | ||
1186 | fRollback = FALSE; | 1175 | fRollback = FALSE; |
@@ -1273,7 +1262,6 @@ namespace Bootstrapper | |||
1273 | dwIndex = 0; | 1262 | dwIndex = 0; |
1274 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1263 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1275 | 1264 | ||
1276 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); | ||
1277 | Assert::Equal(175674ull, pPlan->qwCacheSizeTotal); | 1265 | Assert::Equal(175674ull, pPlan->qwCacheSizeTotal); |
1278 | 1266 | ||
1279 | fRollback = FALSE; | 1267 | fRollback = FALSE; |
@@ -1371,7 +1359,6 @@ namespace Bootstrapper | |||
1371 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 1359 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
1372 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1360 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1373 | 1361 | ||
1374 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); | ||
1375 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); | 1362 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); |
1376 | 1363 | ||
1377 | fRollback = FALSE; | 1364 | fRollback = FALSE; |
@@ -1473,7 +1460,6 @@ namespace Bootstrapper | |||
1473 | dwIndex = 0; | 1460 | dwIndex = 0; |
1474 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1461 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1475 | 1462 | ||
1476 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
1477 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 1463 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
1478 | 1464 | ||
1479 | fRollback = FALSE; | 1465 | fRollback = FALSE; |
@@ -1553,7 +1539,6 @@ namespace Bootstrapper | |||
1553 | dwIndex = 0; | 1539 | dwIndex = 0; |
1554 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1540 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1555 | 1541 | ||
1556 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
1557 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 1542 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
1558 | 1543 | ||
1559 | fRollback = FALSE; | 1544 | fRollback = FALSE; |
@@ -1649,7 +1634,6 @@ namespace Bootstrapper | |||
1649 | dwIndex = 0; | 1634 | dwIndex = 0; |
1650 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1635 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1651 | 1636 | ||
1652 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
1653 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 1637 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
1654 | 1638 | ||
1655 | fRollback = FALSE; | 1639 | fRollback = FALSE; |
@@ -1720,7 +1704,6 @@ namespace Bootstrapper | |||
1720 | dwIndex = 0; | 1704 | dwIndex = 0; |
1721 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1705 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1722 | 1706 | ||
1723 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
1724 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 1707 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
1725 | 1708 | ||
1726 | fRollback = FALSE; | 1709 | fRollback = FALSE; |
@@ -1805,7 +1788,6 @@ namespace Bootstrapper | |||
1805 | dwIndex = 0; | 1788 | dwIndex = 0; |
1806 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1789 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1807 | 1790 | ||
1808 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
1809 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 1791 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
1810 | 1792 | ||
1811 | fRollback = FALSE; | 1793 | fRollback = FALSE; |
@@ -1906,7 +1888,6 @@ namespace Bootstrapper | |||
1906 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | 1888 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); |
1907 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1889 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
1908 | 1890 | ||
1909 | Assert::Equal(56ull, pPlan->qwEstimatedSize); | ||
1910 | Assert::Equal(140ull, pPlan->qwCacheSizeTotal); | 1891 | Assert::Equal(140ull, pPlan->qwCacheSizeTotal); |
1911 | 1892 | ||
1912 | fRollback = FALSE; | 1893 | fRollback = FALSE; |
@@ -2005,7 +1986,6 @@ namespace Bootstrapper | |||
2005 | dwIndex = 0; | 1986 | dwIndex = 0; |
2006 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 1987 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
2007 | 1988 | ||
2008 | Assert::Equal(3055111ull, pPlan->qwEstimatedSize); | ||
2009 | Assert::Equal(6130592ull, pPlan->qwCacheSizeTotal); | 1989 | Assert::Equal(6130592ull, pPlan->qwCacheSizeTotal); |
2010 | 1990 | ||
2011 | fRollback = FALSE; | 1991 | fRollback = FALSE; |
@@ -2128,7 +2108,6 @@ namespace Bootstrapper | |||
2128 | dwIndex = 0; | 2108 | dwIndex = 0; |
2129 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 2109 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
2130 | 2110 | ||
2131 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
2132 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 2111 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
2133 | 2112 | ||
2134 | fRollback = FALSE; | 2113 | fRollback = FALSE; |
@@ -2245,7 +2224,6 @@ namespace Bootstrapper | |||
2245 | dwIndex = 0; | 2224 | dwIndex = 0; |
2246 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 2225 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
2247 | 2226 | ||
2248 | Assert::Equal(0ull, pPlan->qwEstimatedSize); | ||
2249 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); | 2227 | Assert::Equal(0ull, pPlan->qwCacheSizeTotal); |
2250 | 2228 | ||
2251 | fRollback = FALSE; | 2229 | fRollback = FALSE; |
@@ -2351,7 +2329,6 @@ namespace Bootstrapper | |||
2351 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 4); | 2329 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 4); |
2352 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | 2330 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); |
2353 | 2331 | ||
2354 | Assert::Equal(2993671ull, pPlan->qwEstimatedSize); | ||
2355 | Assert::Equal(6048672ull, pPlan->qwCacheSizeTotal); | 2332 | Assert::Equal(6048672ull, pPlan->qwCacheSizeTotal); |
2356 | 2333 | ||
2357 | fRollback = FALSE; | 2334 | fRollback = FALSE; |
@@ -2451,6 +2428,8 @@ namespace Bootstrapper | |||
2451 | ReleaseStr(sczFilePath); | 2428 | ReleaseStr(sczFilePath); |
2452 | } | 2429 | } |
2453 | 2430 | ||
2431 | pEngineState->section.qwBundleSize = 1234; | ||
2432 | |||
2454 | hr = CoreInitializeConstants(pEngineState); | 2433 | hr = CoreInitializeConstants(pEngineState); |
2455 | NativeAssert::Succeeded(hr, "Failed to initialize core constants"); | 2434 | NativeAssert::Succeeded(hr, "Failed to initialize core constants"); |
2456 | 2435 | ||
diff --git a/src/burn/test/BurnUnitTest/RegistrationTest.cpp b/src/burn/test/BurnUnitTest/RegistrationTest.cpp index f01d92a4..0075e937 100644 --- a/src/burn/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/burn/test/BurnUnitTest/RegistrationTest.cpp | |||
@@ -60,6 +60,7 @@ namespace Bootstrapper | |||
60 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 60 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
61 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); | 61 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); |
62 | DWORD dwRegistrationOptions = BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE; | 62 | DWORD dwRegistrationOptions = BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE; |
63 | DWORD64 qwEstimatedSize = 1024; | ||
63 | 64 | ||
64 | try | 65 | try |
65 | { | 66 | { |
@@ -103,7 +104,7 @@ namespace Bootstrapper | |||
103 | TestThrowOnFailure(hr, L"Failed to get current process path."); | 104 | TestThrowOnFailure(hr, L"Failed to get current process path."); |
104 | 105 | ||
105 | // write registration | 106 | // write registration |
106 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 107 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
107 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 108 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
108 | 109 | ||
109 | // verify that registration was created | 110 | // verify that registration was created |
@@ -114,7 +115,7 @@ namespace Bootstrapper | |||
114 | this->ValidateRunOnceKeyEntry(cacheExePath); | 115 | this->ValidateRunOnceKeyEntry(cacheExePath); |
115 | 116 | ||
116 | // end session | 117 | // end session |
117 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 118 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
118 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 119 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
119 | 120 | ||
120 | // verify that registration was removed | 121 | // verify that registration was removed |
@@ -158,6 +159,7 @@ namespace Bootstrapper | |||
158 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 159 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
159 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); | 160 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); |
160 | DWORD dwRegistrationOptions = 0; | 161 | DWORD dwRegistrationOptions = 0; |
162 | DWORD64 qwEstimatedSize = 1024; | ||
161 | try | 163 | try |
162 | { | 164 | { |
163 | this->testRegistry->SetUp(); | 165 | this->testRegistry->SetUp(); |
@@ -204,7 +206,7 @@ namespace Bootstrapper | |||
204 | // | 206 | // |
205 | 207 | ||
206 | // write registration | 208 | // write registration |
207 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 209 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
208 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 210 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
209 | 211 | ||
210 | // verify that registration was created | 212 | // verify that registration was created |
@@ -213,7 +215,7 @@ namespace Bootstrapper | |||
213 | this->ValidateRunOnceKeyEntry(cacheExePath); | 215 | this->ValidateRunOnceKeyEntry(cacheExePath); |
214 | 216 | ||
215 | // complete registration | 217 | // complete registration |
216 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 218 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
217 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 219 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
218 | 220 | ||
219 | // verify that registration was updated | 221 | // verify that registration was updated |
@@ -226,7 +228,7 @@ namespace Bootstrapper | |||
226 | // | 228 | // |
227 | 229 | ||
228 | // write registration | 230 | // write registration |
229 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 231 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
230 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 232 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
231 | 233 | ||
232 | // verify that registration was updated | 234 | // verify that registration was updated |
@@ -235,7 +237,7 @@ namespace Bootstrapper | |||
235 | this->ValidateRunOnceKeyEntry(cacheExePath); | 237 | this->ValidateRunOnceKeyEntry(cacheExePath); |
236 | 238 | ||
237 | // delete registration | 239 | // delete registration |
238 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 240 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
239 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 241 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
240 | 242 | ||
241 | // verify that registration was removed | 243 | // verify that registration was removed |
@@ -278,6 +280,7 @@ namespace Bootstrapper | |||
278 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 280 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
279 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); | 281 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); |
280 | DWORD dwRegistrationOptions = 0; | 282 | DWORD dwRegistrationOptions = 0; |
283 | DWORD64 qwEstimatedSize = 1024; | ||
281 | try | 284 | try |
282 | { | 285 | { |
283 | this->testRegistry->SetUp(); | 286 | this->testRegistry->SetUp(); |
@@ -327,7 +330,7 @@ namespace Bootstrapper | |||
327 | // | 330 | // |
328 | 331 | ||
329 | // write registration | 332 | // write registration |
330 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 333 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
331 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 334 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
332 | 335 | ||
333 | // verify that registration was created | 336 | // verify that registration was created |
@@ -335,7 +338,7 @@ namespace Bootstrapper | |||
335 | this->ValidateRunOnceKeyEntry(cacheExePath); | 338 | this->ValidateRunOnceKeyEntry(cacheExePath); |
336 | 339 | ||
337 | // complete registration | 340 | // complete registration |
338 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BOOTSTRAPPER_REGISTRATION_TYPE_FULL); | 341 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_FULL); |
339 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 342 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
340 | 343 | ||
341 | // verify that registration variables were updated | 344 | // verify that registration variables were updated |
@@ -355,7 +358,7 @@ namespace Bootstrapper | |||
355 | // | 358 | // |
356 | 359 | ||
357 | // delete registration | 360 | // delete registration |
358 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 361 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
359 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 362 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
360 | 363 | ||
361 | // verify that registration was removed | 364 | // verify that registration was removed |
@@ -398,6 +401,7 @@ namespace Bootstrapper | |||
398 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 401 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
399 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); | 402 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); |
400 | DWORD dwRegistrationOptions = 0; | 403 | DWORD dwRegistrationOptions = 0; |
404 | DWORD64 qwEstimatedSize = 1024; | ||
401 | try | 405 | try |
402 | { | 406 | { |
403 | this->testRegistry->SetUp(); | 407 | this->testRegistry->SetUp(); |
@@ -446,7 +450,7 @@ namespace Bootstrapper | |||
446 | // | 450 | // |
447 | 451 | ||
448 | // write registration | 452 | // write registration |
449 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 453 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
450 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 454 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
451 | 455 | ||
452 | // verify that registration was created | 456 | // verify that registration was created |
@@ -454,7 +458,7 @@ namespace Bootstrapper | |||
454 | this->ValidateRunOnceKeyEntry(cacheExePath); | 458 | this->ValidateRunOnceKeyEntry(cacheExePath); |
455 | 459 | ||
456 | // finish registration | 460 | // finish registration |
457 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_FULL); | 461 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_FULL); |
458 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 462 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
459 | 463 | ||
460 | // verify that registration was updated | 464 | // verify that registration was updated |
@@ -479,7 +483,7 @@ namespace Bootstrapper | |||
479 | // | 483 | // |
480 | 484 | ||
481 | // write registration | 485 | // write registration |
482 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 486 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
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 |
@@ -487,7 +491,7 @@ namespace Bootstrapper | |||
487 | this->ValidateRunOnceKeyEntry(cacheExePath); | 491 | this->ValidateRunOnceKeyEntry(cacheExePath); |
488 | 492 | ||
489 | // delete registration | 493 | // delete registration |
490 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 494 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
491 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 495 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
492 | 496 | ||
493 | // verify that registration was removed | 497 | // verify that registration was removed |
@@ -533,6 +537,7 @@ namespace Bootstrapper | |||
533 | BYTE* pbBuffer = NULL; | 537 | BYTE* pbBuffer = NULL; |
534 | SIZE_T cbBuffer = 0; | 538 | SIZE_T cbBuffer = 0; |
535 | DWORD dwRegistrationOptions = 0; | 539 | DWORD dwRegistrationOptions = 0; |
540 | DWORD64 qwEstimatedSize = 1024; | ||
536 | 541 | ||
537 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 542 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
538 | try | 543 | try |
@@ -586,7 +591,7 @@ namespace Bootstrapper | |||
586 | TestThrowOnFailure(hr, L"Failed to get current process path."); | 591 | TestThrowOnFailure(hr, L"Failed to get current process path."); |
587 | 592 | ||
588 | // begin session | 593 | // begin session |
589 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 594 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
590 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 595 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
591 | 596 | ||
592 | VariableSetNumericHelper(&variables, L"MyBurnVariable1", 42); | 597 | VariableSetNumericHelper(&variables, L"MyBurnVariable1", 42); |
@@ -629,7 +634,7 @@ namespace Bootstrapper | |||
629 | NativeAssert::StringEqual(L"42", sczValue); | 634 | NativeAssert::StringEqual(L"42", sczValue); |
630 | 635 | ||
631 | // end session | 636 | // end session |
632 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 637 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
633 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 638 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
634 | } | 639 | } |
635 | finally | 640 | finally |
@@ -673,6 +678,7 @@ namespace Bootstrapper | |||
673 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); | 678 | String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(TEST_BUNDLE_ID)); |
674 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); | 679 | String^ cacheExePath = Path::Combine(cacheDirectory, gcnew String(L"setup.exe")); |
675 | DWORD dwRegistrationOptions = 0; | 680 | DWORD dwRegistrationOptions = 0; |
681 | DWORD64 qwEstimatedSize = 1024; | ||
676 | try | 682 | try |
677 | { | 683 | { |
678 | this->testRegistry->SetUp(); | 684 | this->testRegistry->SetUp(); |
@@ -728,7 +734,7 @@ namespace Bootstrapper | |||
728 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_NONE, (int)resumeType); | 734 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_NONE, (int)resumeType); |
729 | 735 | ||
730 | // begin session | 736 | // begin session |
731 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, 0, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 737 | hr = RegistrationSessionBegin(sczCurrentProcess, ®istration, &cache, &variables, dwRegistrationOptions, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
732 | TestThrowOnFailure(hr, L"Failed to register bundle."); | 738 | TestThrowOnFailure(hr, L"Failed to register bundle."); |
733 | 739 | ||
734 | VariableSetNumericHelper(&variables, L"MyBurnVariable1", 42); | 740 | VariableSetNumericHelper(&variables, L"MyBurnVariable1", 42); |
@@ -767,7 +773,7 @@ namespace Bootstrapper | |||
767 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); | 773 | Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); |
768 | 774 | ||
769 | // suspend session | 775 | // suspend session |
770 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); | 776 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_INPROGRESS); |
771 | TestThrowOnFailure(hr, L"Failed to suspend session."); | 777 | TestThrowOnFailure(hr, L"Failed to suspend session."); |
772 | 778 | ||
773 | // verify that run key was removed | 779 | // verify that run key was removed |
@@ -794,7 +800,7 @@ namespace Bootstrapper | |||
794 | this->ValidateRunOnceKeyEntry(cacheExePath); | 800 | this->ValidateRunOnceKeyEntry(cacheExePath); |
795 | 801 | ||
796 | // end session | 802 | // end session |
797 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); | 803 | hr = RegistrationSessionEnd(®istration, &cache, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, qwEstimatedSize, BOOTSTRAPPER_REGISTRATION_TYPE_NONE); |
798 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); | 804 | TestThrowOnFailure(hr, L"Failed to unregister bundle."); |
799 | 805 | ||
800 | // read resume type after session | 806 | // read resume type after session |