diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-09-15 14:51:55 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-09-15 17:05:54 -0500 |
| commit | f1f75591bb723ac7358afa142307fe9574d59956 (patch) | |
| tree | 6760496722be049aa66edfd40e5238711cd40cb5 /src | |
| parent | 86cb96db39f97aacf1ed78b1e95fefe15e54bee6 (diff) | |
| download | wix-f1f75591bb723ac7358afa142307fe9574d59956.tar.gz wix-f1f75591bb723ac7358afa142307fe9574d59956.tar.bz2 wix-f1f75591bb723ac7358afa142307fe9574d59956.zip | |
Don't clean packages during layout.
Fixes 6871
Diffstat (limited to 'src')
| -rw-r--r-- | src/burn/engine/plan.cpp | 2 | ||||
| -rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 92 |
2 files changed, 93 insertions, 1 deletions
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index e6997b64..b7703869 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
| @@ -871,7 +871,7 @@ static HRESULT PlanPackagesHelper( | |||
| 871 | } | 871 | } |
| 872 | 872 | ||
| 873 | // Passthrough packages are never cleaned up by the calling bundle (they delete themselves when appropriate). | 873 | // Passthrough packages are never cleaned up by the calling bundle (they delete themselves when appropriate). |
| 874 | if (!pPlan->fEnabledForwardCompatibleBundle) | 874 | if (!pPlan->fEnabledForwardCompatibleBundle && BOOTSTRAPPER_ACTION_LAYOUT != pPlan->action) |
| 875 | { | 875 | { |
| 876 | // Plan clean up of packages. | 876 | // Plan clean up of packages. |
| 877 | for (DWORD i = 0; i < cPackages; ++i) | 877 | for (DWORD i = 0; i < cPackages; ++i) |
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index a98484c1..72ac1f9a 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
| @@ -1358,6 +1358,88 @@ namespace Bootstrapper | |||
| 1358 | } | 1358 | } |
| 1359 | 1359 | ||
| 1360 | [Fact] | 1360 | [Fact] |
| 1361 | void SingleExeLayoutTest() | ||
| 1362 | { | ||
| 1363 | HRESULT hr = S_OK; | ||
| 1364 | BURN_ENGINE_STATE engineState = { }; | ||
| 1365 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
| 1366 | BURN_PLAN* pPlan = &engineState.plan; | ||
| 1367 | |||
| 1368 | InitializeEngineStateForCorePlan(wzSingleExeManifestFileName, pEngineState); | ||
| 1369 | DetectAttachedContainerAsAttached(pEngineState); | ||
| 1370 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | ||
| 1371 | |||
| 1372 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_LAYOUT); | ||
| 1373 | NativeAssert::Succeeded(hr, "CorePlan failed"); | ||
| 1374 | |||
| 1375 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_LAYOUT, pPlan->action); | ||
| 1376 | NativeAssert::StringEqual(L"{9C184683-04FB-49AD-9D79-65101BDC3EE3}", pPlan->wzBundleId); | ||
| 1377 | NativeAssert::StringEqual(L"{9C184683-04FB-49AD-9D79-65101BDC3EE3}", pPlan->wzBundleProviderKey); | ||
| 1378 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | ||
| 1379 | Assert::Equal<BOOL>(FALSE, pPlan->fPerMachine); | ||
| 1380 | Assert::Equal<BOOL>(FALSE, pPlan->fCanAffectMachineState); | ||
| 1381 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | ||
| 1382 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | ||
| 1383 | Assert::Equal<BOOL>(FALSE, pPlan->fDowngrade); | ||
| 1384 | Assert::Equal<DWORD>(0, pPlan->dwRegistrationOperations); | ||
| 1385 | Assert::True(0 != pPlan->sczLayoutDirectory); | ||
| 1386 | Assert::NotEqual<WCHAR>(0, *pPlan->sczLayoutDirectory); | ||
| 1387 | |||
| 1388 | BOOL fRollback = FALSE; | ||
| 1389 | DWORD dwIndex = 0; | ||
| 1390 | Assert::Equal(dwIndex, pPlan->cRegistrationActions); | ||
| 1391 | |||
| 1392 | fRollback = TRUE; | ||
| 1393 | dwIndex = 0; | ||
| 1394 | Assert::Equal(dwIndex, pPlan->cRollbackRegistrationActions); | ||
| 1395 | |||
| 1396 | fRollback = FALSE; | ||
| 1397 | dwIndex = 0; | ||
| 1398 | ValidateCacheLayoutBundle(pPlan, fRollback, dwIndex++); | ||
| 1399 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web", TRUE, BURN_CACHE_PACKAGE_TYPE_NONE, BURN_CACHE_PACKAGE_TYPE_NONE); | ||
| 1400 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"ExeA", TRUE, BURN_CACHE_PACKAGE_TYPE_NONE, BURN_CACHE_PACKAGE_TYPE_NONE); | ||
| 1401 | Assert::Equal(dwIndex, pPlan->cCacheActions); | ||
| 1402 | |||
| 1403 | fRollback = TRUE; | ||
| 1404 | dwIndex = 0; | ||
| 1405 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | ||
| 1406 | |||
| 1407 | Assert::Equal(4321686ull, pPlan->qwCacheSizeTotal); | ||
| 1408 | |||
| 1409 | fRollback = FALSE; | ||
| 1410 | dwIndex = 0; | ||
| 1411 | DWORD dwExecuteCheckpointId = 1; | ||
| 1412 | ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); | ||
| 1413 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 1414 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | ||
| 1415 | Assert::Equal(dwIndex, pPlan->cExecuteActions); | ||
| 1416 | |||
| 1417 | fRollback = TRUE; | ||
| 1418 | dwIndex = 0; | ||
| 1419 | dwExecuteCheckpointId = 1; | ||
| 1420 | ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); | ||
| 1421 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 1422 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | ||
| 1423 | Assert::Equal(dwIndex, pPlan->cRollbackActions); | ||
| 1424 | |||
| 1425 | Assert::Equal(0ul, pPlan->cExecutePackagesTotal); | ||
| 1426 | Assert::Equal(3ul, pPlan->cOverallProgressTicksTotal); | ||
| 1427 | |||
| 1428 | dwIndex = 0; | ||
| 1429 | Assert::Equal(dwIndex, pPlan->cRestoreRelatedBundleActions); | ||
| 1430 | |||
| 1431 | dwIndex = 0; | ||
| 1432 | Assert::Equal(dwIndex, pPlan->cCleanActions); | ||
| 1433 | |||
| 1434 | UINT uIndex = 0; | ||
| 1435 | ValidatePlannedProvider(pPlan, uIndex++, L"{9C184683-04FB-49AD-9D79-65101BDC3EE3}", NULL); | ||
| 1436 | Assert::Equal(uIndex, pPlan->cPlannedProviders); | ||
| 1437 | |||
| 1438 | Assert::Equal(2ul, pEngineState->packages.cPackages); | ||
| 1439 | ValidateNonPermanentPackageExpectedStates(&pEngineState->packages.rgPackages[1], L"ExeA", BURN_PACKAGE_REGISTRATION_STATE_ABSENT, BURN_PACKAGE_REGISTRATION_STATE_ABSENT); | ||
| 1440 | } | ||
| 1441 | |||
| 1442 | [Fact] | ||
| 1361 | void SingleMsiCacheTest() | 1443 | void SingleMsiCacheTest() |
| 1362 | { | 1444 | { |
| 1363 | HRESULT hr = S_OK; | 1445 | HRESULT hr = S_OK; |
| @@ -3169,6 +3251,16 @@ namespace Bootstrapper | |||
| 3169 | Assert::Equal(dwId, pAction->checkpoint.dwId); | 3251 | Assert::Equal(dwId, pAction->checkpoint.dwId); |
| 3170 | } | 3252 | } |
| 3171 | 3253 | ||
| 3254 | void ValidateCacheLayoutBundle( | ||
| 3255 | __in BURN_PLAN* pPlan, | ||
| 3256 | __in BOOL fRollback, | ||
| 3257 | __in DWORD dwIndex | ||
| 3258 | ) | ||
| 3259 | { | ||
| 3260 | BURN_CACHE_ACTION* pAction = ValidateCacheActionExists(pPlan, fRollback, dwIndex); | ||
| 3261 | Assert::Equal<DWORD>(BURN_CACHE_ACTION_TYPE_LAYOUT_BUNDLE, pAction->type); | ||
| 3262 | } | ||
| 3263 | |||
| 3172 | DWORD ValidateCachePackage( | 3264 | DWORD ValidateCachePackage( |
| 3173 | __in BURN_PLAN* pPlan, | 3265 | __in BURN_PLAN* pPlan, |
| 3174 | __in BOOL fRollback, | 3266 | __in BOOL fRollback, |
