diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-03-13 23:45:32 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-03-14 14:53:29 -0500 |
| commit | 4cd1c4e06145434ca940ac828772dc47b9d9738e (patch) | |
| tree | a754d685039173c63303dc6d0d8b1a2bf3ab506b /src/burn/test/BurnUnitTest/PlanTest.cpp | |
| parent | 89adb2e3cc232b11b28e5bdeccb0c522c8124a29 (diff) | |
| download | wix-4cd1c4e06145434ca940ac828772dc47b9d9738e.tar.gz wix-4cd1c4e06145434ca940ac828772dc47b9d9738e.tar.bz2 wix-4cd1c4e06145434ca940ac828772dc47b9d9738e.zip | |
Allow the BA to override the bundle relation type during plan.
Diffstat (limited to 'src/burn/test/BurnUnitTest/PlanTest.cpp')
| -rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 149 |
1 files changed, 138 insertions, 11 deletions
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index 881a960a..7852f1c9 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
| @@ -18,6 +18,8 @@ static BOOL vfUsePackageRequestState = FALSE; | |||
| 18 | static BOOTSTRAPPER_REQUEST_STATE vPackageRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; | 18 | static BOOTSTRAPPER_REQUEST_STATE vPackageRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; |
| 19 | static BOOL vfUseRelatedBundleRequestState = FALSE; | 19 | static BOOL vfUseRelatedBundleRequestState = FALSE; |
| 20 | static BOOTSTRAPPER_REQUEST_STATE vRelatedBundleRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; | 20 | static BOOTSTRAPPER_REQUEST_STATE vRelatedBundleRequestState = BOOTSTRAPPER_REQUEST_STATE_NONE; |
| 21 | static BOOL vfUseRelatedBundlePlanType = FALSE; | ||
| 22 | static BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE vRelatedBundlePlanType = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_NONE; | ||
| 21 | 23 | ||
| 22 | static BURN_DEPENDENCY_ACTION registerActions1[] = { BURN_DEPENDENCY_ACTION_REGISTER }; | 24 | static BURN_DEPENDENCY_ACTION registerActions1[] = { BURN_DEPENDENCY_ACTION_REGISTER }; |
| 23 | static BURN_DEPENDENCY_ACTION unregisterActions1[] = { BURN_DEPENDENCY_ACTION_UNREGISTER }; | 25 | static BURN_DEPENDENCY_ACTION unregisterActions1[] = { BURN_DEPENDENCY_ACTION_UNREGISTER }; |
| @@ -52,7 +54,7 @@ namespace Bootstrapper | |||
| 52 | 54 | ||
| 53 | InitializeEngineStateForCorePlan(wzMsiTransactionManifestFileName, pEngineState); | 55 | InitializeEngineStateForCorePlan(wzMsiTransactionManifestFileName, pEngineState); |
| 54 | DetectPackagesAsAbsent(pEngineState); | 56 | DetectPackagesAsAbsent(pEngineState); |
| 55 | DetectUpgradeBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"1.0.0.0"); | 57 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"1.0.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 56 | 58 | ||
| 57 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 59 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); |
| 58 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 60 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| @@ -375,6 +377,122 @@ namespace Bootstrapper | |||
| 375 | } | 377 | } |
| 376 | 378 | ||
| 377 | [Fact] | 379 | [Fact] |
| 380 | void RelatedBundlesAreSortedByPlanType() | ||
| 381 | { | ||
| 382 | HRESULT hr = S_OK; | ||
| 383 | BURN_ENGINE_STATE engineState = { }; | ||
| 384 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
| 385 | BURN_PLAN* pPlan = &engineState.plan; | ||
| 386 | |||
| 387 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | ||
| 388 | DetectAttachedContainerAsAttached(pEngineState); | ||
| 389 | DetectPackagesAsAbsent(pEngineState); | ||
| 390 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); | ||
| 391 | DetectRelatedBundle(pEngineState, L"{6B2D8401-C0C2-4060-BFEF-5DDFD04BD586}", L"0.2.0.0", BOOTSTRAPPER_RELATION_PATCH); | ||
| 392 | DetectRelatedBundle(pEngineState, L"{5C80A327-61B9-44CF-A6D4-64C45F4F90A9}", L"0.4.0.0", BOOTSTRAPPER_RELATION_ADDON); | ||
| 393 | DetectRelatedBundle(pEngineState, L"{33A8757F-32EA-4974-888E-D15547259B3C}", L"0.3.0.0", BOOTSTRAPPER_RELATION_DEPENDENT_PATCH); | ||
| 394 | DetectRelatedBundle(pEngineState, L"{59CD5A25-0398-41CA-AD53-AD8C061E2A1A}", L"0.7.0.0", BOOTSTRAPPER_RELATION_DEPENDENT_ADDON); | ||
| 395 | |||
| 396 | RelatedBundlesSortDetect(&pEngineState->registration.relatedBundles); | ||
| 397 | NativeAssert::StringEqual(L"{5C80A327-61B9-44CF-A6D4-64C45F4F90A9}", pEngineState->registration.relatedBundles.rgRelatedBundles[0].package.sczId); | ||
| 398 | NativeAssert::StringEqual(L"{6B2D8401-C0C2-4060-BFEF-5DDFD04BD586}", pEngineState->registration.relatedBundles.rgRelatedBundles[1].package.sczId); | ||
| 399 | NativeAssert::StringEqual(L"{59CD5A25-0398-41CA-AD53-AD8C061E2A1A}", pEngineState->registration.relatedBundles.rgRelatedBundles[2].package.sczId); | ||
| 400 | NativeAssert::StringEqual(L"{33A8757F-32EA-4974-888E-D15547259B3C}", pEngineState->registration.relatedBundles.rgRelatedBundles[3].package.sczId); | ||
| 401 | NativeAssert::StringEqual(L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", pEngineState->registration.relatedBundles.rgRelatedBundles[4].package.sczId); | ||
| 402 | |||
| 403 | vfUseRelatedBundlePlanType = TRUE; | ||
| 404 | vRelatedBundlePlanType = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_UPGRADE; | ||
| 405 | |||
| 406 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | ||
| 407 | NativeAssert::Succeeded(hr, "CorePlan failed"); | ||
| 408 | |||
| 409 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 410 | Assert::Equal<BOOL>(TRUE, pPlan->fPerMachine); | ||
| 411 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | ||
| 412 | |||
| 413 | BOOL fRollback = FALSE; | ||
| 414 | DWORD dwIndex = 0; | ||
| 415 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | ||
| 416 | ValidateCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | ||
| 417 | ValidateCacheSignalSyncpoint(pPlan, fRollback, dwIndex++); | ||
| 418 | Assert::Equal(dwIndex, pPlan->cCacheActions); | ||
| 419 | |||
| 420 | fRollback = TRUE; | ||
| 421 | dwIndex = 0; | ||
| 422 | ValidateCacheRollbackPackage(pPlan, fRollback, dwIndex++, L"PackageA"); | ||
| 423 | ValidateCacheCheckpoint(pPlan, fRollback, dwIndex++, 1); | ||
| 424 | Assert::Equal(dwIndex, pPlan->cRollbackCacheActions); | ||
| 425 | |||
| 426 | Assert::Equal(35694ull, pPlan->qwEstimatedSize); | ||
| 427 | Assert::Equal(168715ull, pPlan->qwCacheSizeTotal); | ||
| 428 | |||
| 429 | fRollback = FALSE; | ||
| 430 | dwIndex = 0; | ||
| 431 | DWORD dwExecuteCheckpointId = 2; | ||
| 432 | ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); | ||
| 433 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 434 | ValidateExecuteWaitCachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | ||
| 435 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 436 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", registerActions1, 1); | ||
| 437 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 438 | ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_INSTALL, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0); | ||
| 439 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 440 | ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", registerActions1, 1); | ||
| 441 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 442 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 443 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | ||
| 444 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{6B2D8401-C0C2-4060-BFEF-5DDFD04BD586}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); | ||
| 445 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{33A8757F-32EA-4974-888E-D15547259B3C}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); | ||
| 446 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{5C80A327-61B9-44CF-A6D4-64C45F4F90A9}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); | ||
| 447 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{59CD5A25-0398-41CA-AD53-AD8C061E2A1A}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); | ||
| 448 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); | ||
| 449 | Assert::Equal(dwIndex, pPlan->cExecuteActions); | ||
| 450 | |||
| 451 | fRollback = TRUE; | ||
| 452 | dwIndex = 0; | ||
| 453 | dwExecuteCheckpointId = 2; | ||
| 454 | ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); | ||
| 455 | ValidateExecuteUncachePackage(pPlan, fRollback, dwIndex++, L"PackageA"); | ||
| 456 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 457 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", unregisterActions1, 1); | ||
| 458 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 459 | ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0); | ||
| 460 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 461 | ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", unregisterActions1, 1); | ||
| 462 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 463 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 464 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | ||
| 465 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | ||
| 466 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{6B2D8401-C0C2-4060-BFEF-5DDFD04BD586}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 467 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{33A8757F-32EA-4974-888E-D15547259B3C}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 468 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{5C80A327-61B9-44CF-A6D4-64C45F4F90A9}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 469 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{59CD5A25-0398-41CA-AD53-AD8C061E2A1A}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 470 | ValidateExecuteRelatedBundle(pPlan, fRollback, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 471 | Assert::Equal(dwIndex, pPlan->cRollbackActions); | ||
| 472 | |||
| 473 | Assert::Equal(6ul, pPlan->cExecutePackagesTotal); | ||
| 474 | Assert::Equal(7ul, pPlan->cOverallProgressTicksTotal); | ||
| 475 | |||
| 476 | dwIndex = 0; | ||
| 477 | ValidateRestoreRelatedBundle(pPlan, dwIndex++, L"{6B2D8401-C0C2-4060-BFEF-5DDFD04BD586}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 478 | ValidateRestoreRelatedBundle(pPlan, dwIndex++, L"{33A8757F-32EA-4974-888E-D15547259B3C}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 479 | ValidateRestoreRelatedBundle(pPlan, dwIndex++, L"{5C80A327-61B9-44CF-A6D4-64C45F4F90A9}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 480 | ValidateRestoreRelatedBundle(pPlan, dwIndex++, L"{59CD5A25-0398-41CA-AD53-AD8C061E2A1A}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 481 | ValidateRestoreRelatedBundle(pPlan, dwIndex++, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); | ||
| 482 | Assert::Equal(dwIndex, pPlan->cRestoreRelatedBundleActions); | ||
| 483 | |||
| 484 | dwIndex = 0; | ||
| 485 | Assert::Equal(dwIndex, pPlan->cCleanActions); | ||
| 486 | |||
| 487 | UINT uIndex = 0; | ||
| 488 | ValidatePlannedProvider(pPlan, uIndex++, L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", NULL); | ||
| 489 | Assert::Equal(uIndex, pPlan->cPlannedProviders); | ||
| 490 | |||
| 491 | Assert::Equal(1ul, pEngineState->packages.cPackages); | ||
| 492 | ValidateNonPermanentPackageExpectedStates(&pEngineState->packages.rgPackages[0], L"PackageA", BURN_PACKAGE_REGISTRATION_STATE_PRESENT, BURN_PACKAGE_REGISTRATION_STATE_PRESENT); | ||
| 493 | } | ||
| 494 | |||
| 495 | [Fact] | ||
| 378 | void RelatedBundleMissingFromCacheTest() | 496 | void RelatedBundleMissingFromCacheTest() |
| 379 | { | 497 | { |
| 380 | HRESULT hr = S_OK; | 498 | HRESULT hr = S_OK; |
| @@ -385,7 +503,7 @@ namespace Bootstrapper | |||
| 385 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 503 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
| 386 | DetectAttachedContainerAsAttached(pEngineState); | 504 | DetectAttachedContainerAsAttached(pEngineState); |
| 387 | DetectPackagesAsAbsent(pEngineState); | 505 | DetectPackagesAsAbsent(pEngineState); |
| 388 | BURN_RELATED_BUNDLE* pRelatedBundle = DetectUpgradeBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0"); | 506 | BURN_RELATED_BUNDLE* pRelatedBundle = DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 389 | pRelatedBundle->fPlannable = FALSE; | 507 | pRelatedBundle->fPlannable = FALSE; |
| 390 | 508 | ||
| 391 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 509 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); |
| @@ -473,7 +591,7 @@ namespace Bootstrapper | |||
| 473 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 591 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
| 474 | DetectAttachedContainerAsAttached(pEngineState); | 592 | DetectAttachedContainerAsAttached(pEngineState); |
| 475 | DetectPackagesAsAbsent(pEngineState); | 593 | DetectPackagesAsAbsent(pEngineState); |
| 476 | DetectUpgradeBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0"); | 594 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 477 | 595 | ||
| 478 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_CACHE); | 596 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_CACHE); |
| 479 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 597 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| @@ -546,7 +664,7 @@ namespace Bootstrapper | |||
| 546 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 664 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
| 547 | DetectAttachedContainerAsAttached(pEngineState); | 665 | DetectAttachedContainerAsAttached(pEngineState); |
| 548 | DetectPackagesAsAbsent(pEngineState); | 666 | DetectPackagesAsAbsent(pEngineState); |
| 549 | DetectUpgradeBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0"); | 667 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 550 | 668 | ||
| 551 | vfUsePackageRequestState = TRUE; | 669 | vfUsePackageRequestState = TRUE; |
| 552 | vPackageRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT; | 670 | vPackageRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT; |
| @@ -621,7 +739,7 @@ namespace Bootstrapper | |||
| 621 | 739 | ||
| 622 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 740 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
| 623 | DetectPackagesAsPresentAndCached(pEngineState); | 741 | DetectPackagesAsPresentAndCached(pEngineState); |
| 624 | DetectUpgradeBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0"); | 742 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 625 | 743 | ||
| 626 | vfUsePackageRequestState = TRUE; | 744 | vfUsePackageRequestState = TRUE; |
| 627 | vPackageRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_PRESENT; | 745 | vPackageRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_PRESENT; |
| @@ -703,7 +821,7 @@ namespace Bootstrapper | |||
| 703 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 821 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
| 704 | DetectAttachedContainerAsAttached(pEngineState); | 822 | DetectAttachedContainerAsAttached(pEngineState); |
| 705 | DetectPackagesAsAbsent(pEngineState); | 823 | DetectPackagesAsAbsent(pEngineState); |
| 706 | DetectUpgradeBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0"); | 824 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 707 | 825 | ||
| 708 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 826 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); |
| 709 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 827 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| @@ -1475,6 +1593,7 @@ namespace Bootstrapper | |||
| 1475 | 1593 | ||
| 1476 | vfUsePackageRequestState = FALSE; | 1594 | vfUsePackageRequestState = FALSE; |
| 1477 | vfUseRelatedBundleRequestState = FALSE; | 1595 | vfUseRelatedBundleRequestState = FALSE; |
| 1596 | vfUseRelatedBundlePlanType = FALSE; | ||
| 1478 | 1597 | ||
| 1479 | ::InitializeCriticalSection(&pEngineState->userExperience.csEngineActive); | 1598 | ::InitializeCriticalSection(&pEngineState->userExperience.csEngineActive); |
| 1480 | 1599 | ||
| @@ -1686,10 +1805,11 @@ namespace Bootstrapper | |||
| 1686 | } | 1805 | } |
| 1687 | } | 1806 | } |
| 1688 | 1807 | ||
| 1689 | BURN_RELATED_BUNDLE* DetectUpgradeBundle( | 1808 | BURN_RELATED_BUNDLE* DetectRelatedBundle( |
| 1690 | __in BURN_ENGINE_STATE* pEngineState, | 1809 | __in BURN_ENGINE_STATE* pEngineState, |
| 1691 | __in LPCWSTR wzId, | 1810 | __in LPCWSTR wzId, |
| 1692 | __in LPCWSTR wzVersion | 1811 | __in LPCWSTR wzVersion, |
| 1812 | __in BOOTSTRAPPER_RELATION_TYPE relationType | ||
| 1693 | ) | 1813 | ) |
| 1694 | { | 1814 | { |
| 1695 | HRESULT hr = S_OK; | 1815 | HRESULT hr = S_OK; |
| @@ -1717,11 +1837,11 @@ namespace Bootstrapper | |||
| 1717 | NativeAssert::Succeeded(hr, "Failed to parse pseudo bundle version: %ls", wzVersion); | 1837 | NativeAssert::Succeeded(hr, "Failed to parse pseudo bundle version: %ls", wzVersion); |
| 1718 | 1838 | ||
| 1719 | pRelatedBundle->fPlannable = TRUE; | 1839 | pRelatedBundle->fPlannable = TRUE; |
| 1720 | pRelatedBundle->relationType = BOOTSTRAPPER_RELATION_UPGRADE; | 1840 | pRelatedBundle->detectRelationType = relationType; |
| 1721 | 1841 | ||
| 1722 | hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, TRUE, TRUE, wzId, | 1842 | hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, TRUE, TRUE, wzId, |
| 1723 | #ifdef DEBUG | 1843 | #ifdef DEBUG |
| 1724 | pRelatedBundle->relationType, | 1844 | pRelatedBundle->detectRelationType, |
| 1725 | #endif | 1845 | #endif |
| 1726 | TRUE, wzFilePath, 0, &dependencyProvider); | 1846 | TRUE, wzFilePath, 0, &dependencyProvider); |
| 1727 | NativeAssert::Succeeded(hr, "Failed to initialize related bundle to represent bundle: %ls", wzId); | 1847 | NativeAssert::Succeeded(hr, "Failed to initialize related bundle to represent bundle: %ls", wzId); |
| @@ -1746,7 +1866,7 @@ namespace Bootstrapper | |||
| 1746 | pEngineState->command.relationType = BOOTSTRAPPER_RELATION_UPGRADE; | 1866 | pEngineState->command.relationType = BOOTSTRAPPER_RELATION_UPGRADE; |
| 1747 | 1867 | ||
| 1748 | DetectPackagesAsPresentAndCached(pEngineState); | 1868 | DetectPackagesAsPresentAndCached(pEngineState); |
| 1749 | DetectUpgradeBundle(pEngineState, wzId, wzVersion); | 1869 | DetectRelatedBundle(pEngineState, wzId, wzVersion, BOOTSTRAPPER_RELATION_UPGRADE); |
| 1750 | 1870 | ||
| 1751 | for (DWORD i = 0; i < pEngineState->packages.cPackages; ++i) | 1871 | for (DWORD i = 0; i < pEngineState->packages.cPackages; ++i) |
| 1752 | { | 1872 | { |
| @@ -2199,6 +2319,13 @@ static HRESULT WINAPI PlanTestBAProc( | |||
| 2199 | pResults->requestedState = vRelatedBundleRequestState; | 2319 | pResults->requestedState = vRelatedBundleRequestState; |
| 2200 | } | 2320 | } |
| 2201 | break; | 2321 | break; |
| 2322 | case BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANRELATEDBUNDLETYPE: | ||
| 2323 | if (vfUseRelatedBundlePlanType) | ||
| 2324 | { | ||
| 2325 | BA_ONPLANRELATEDBUNDLETYPE_RESULTS* pResults = reinterpret_cast<BA_ONPLANRELATEDBUNDLETYPE_RESULTS*>(pvResults); | ||
| 2326 | pResults->requestedType = vRelatedBundlePlanType; | ||
| 2327 | } | ||
| 2328 | break; | ||
| 2202 | } | 2329 | } |
| 2203 | 2330 | ||
| 2204 | return S_OK; | 2331 | return S_OK; |
