From 7cc4271c9d78ed60e354f585d03b612a9efb7cf3 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 11 Mar 2021 20:57:52 -0600 Subject: Add tests to verify #4991 and #5702. --- global.json | 2 +- src/TestBA/TestBA.cs | 5 +++ src/TestBA/TestBA.csproj | 2 +- .../BundleA/BundleA.wixproj | 2 +- .../DependencyTests/BundleAv1/BundleAv1.wixproj | 2 +- .../BundleAv1_0_1/BundleAv1_0_1.wixproj | 2 +- .../DependencyTests/BundleB/BundleB.wixproj | 2 +- .../DependencyTests/BundleC/BundleC.wixproj | 2 +- .../DependencyTests/BundleD/BundleD.wixproj | 2 +- .../DependencyTests/BundleE/BundleE.wixproj | 2 +- .../DependencyTests/BundleF/BundleF.wixproj | 2 +- .../BundleF_AddOnA/BundleF_AddOnA.wixproj | 2 +- .../BundleF_AddOnB/BundleF_AddOnB.wixproj | 2 +- .../BundleF_PatchAv1_0_1.wixproj | 2 +- .../BundleF_PatchAv1_0_2.wixproj | 2 +- .../DependencyTests/BundleHv1/BundleHv1.wixproj | 2 +- .../DependencyTests/BundleHv2/BundleHv2.wixproj | 2 +- .../DependencyTests/BundleJ/BundleJ.wixproj | 2 +- .../BundleJ_Patch/BundleJ_Patch.wixproj | 2 +- .../DependencyTests/BundleKv1/BundleKv1.wixproj | 2 +- .../DependencyTests/BundleKv2/BundleKv2.wixproj | 2 +- .../DependencyTests/BundleL/BundleL.wixproj | 2 +- .../ElevationTests/BundleA/BundleA.wixproj | 2 +- src/TestData/FailureTests/BundleA/BundleA.wixproj | 2 +- src/TestData/FailureTests/BundleB/BundleB.wixproj | 2 +- src/TestData/FailureTests/BundleC/BundleC.wixproj | 2 +- .../BundleAv1/BundleAv1.wixproj | 2 +- .../BundleAv2/BundleAv2.wixproj | 2 +- .../BundleCv1/BundleCv1.wixproj | 2 +- .../BundleCv2/BundleCv2.wixproj | 2 +- .../BundleAv1/BundleAv1.wixproj | 2 +- .../BundleAv2/BundleAv2.wixproj | 2 +- .../BundleBv1/BundleBv1.wixproj | 2 +- .../BundleBv2/BundleBv2.wixproj | 2 +- src/TestData/PatchTests/BundleA/BundleA.wixproj | 2 +- .../PatchTests/BundlePatchA/BundlePatchA.wixproj | 2 +- .../PatchTests/BundlePatchA2/BundlePatchA2.wixproj | 2 +- src/TestData/PrereqBaTests/BundleA/BundleA.wixproj | 2 +- src/TestData/PrereqBaTests/BundleB/BundleB.wixproj | 2 +- .../RegistrationTests/BundleA/BundleA.wixproj | 2 +- .../RollbackBoundaryTests/BundleA/BundleA.wixproj | 2 +- .../SlipstreamTests/BundleA/BundleA.wixproj | 2 +- .../BundleAReverse/BundleAReverse.wixproj | 2 +- .../SlipstreamTests/BundleB/BundleB.wixproj | 2 +- .../SlipstreamTests/BundleC/BundleC.wixproj | 2 +- .../SlipstreamTests/BundleD/BundleD.wixproj | 2 +- .../BundleOnlyA/BundleOnlyA.wixproj | 2 +- .../BundleOnlyPatchA/BundleOnlyPatchA.wixproj | 2 +- .../TestBA/TestBAWixlib/testbawixlib.wixproj | 2 +- .../BundleAv1/BundleA.props | 10 ++++++ .../BundleAv1/BundleAv1.wixproj | 12 ++++++++ .../BundleAv1/BundleAv1.wxs | 10 ++++++ .../BundleAv2/BundleAv2.wixproj | 15 +++++++++ .../BundleAv2/BundleAv2.wxs | 10 ++++++ .../PackageAv1/PackageA.props | 9 ++++++ .../PackageAv1/PackageAv1.wixproj | 4 +++ .../PackageAv2/PackageAv2.wixproj | 7 +++++ src/WixTestTools/BundleInstaller.cs | 12 ++++++++ src/WixTestTools/BundleVerifier.cs | 14 +++++++++ src/WixTestTools/WixTestTools.csproj | 4 +-- src/WixToolsetTest.BurnE2E/DependencyTests.cs | 2 +- src/WixToolsetTest.BurnE2E/RegistrationTests.cs | 27 ++++++++++++++++ .../UpgradeRelatedBundleTests.cs | 36 ++++++++++++++++++++++ .../WixToolsetTest.BurnE2E.csproj | 4 +-- 64 files changed, 224 insertions(+), 53 deletions(-) create mode 100644 src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleA.props create mode 100644 src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleAv1.wixproj create mode 100644 src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleAv1.wxs create mode 100644 src/TestData/UpgradeRelatedBundleTests/BundleAv2/BundleAv2.wixproj create mode 100644 src/TestData/UpgradeRelatedBundleTests/BundleAv2/BundleAv2.wxs create mode 100644 src/TestData/UpgradeRelatedBundleTests/PackageAv1/PackageA.props create mode 100644 src/TestData/UpgradeRelatedBundleTests/PackageAv1/PackageAv1.wixproj create mode 100644 src/TestData/UpgradeRelatedBundleTests/PackageAv2/PackageAv2.wixproj create mode 100644 src/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs diff --git a/global.json b/global.json index 078998a4..627b9889 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "msbuild-sdks": { - "WixToolset.Sdk": "4.0.0-build-0195" + "WixToolset.Sdk": "4.0.0-build-0196" }, "sdk": { "allowPrerelease": false diff --git a/src/TestBA/TestBA.cs b/src/TestBA/TestBA.cs index 12e027b2..f86a5807 100644 --- a/src/TestBA/TestBA.cs +++ b/src/TestBA/TestBA.cs @@ -236,6 +236,11 @@ namespace WixToolset.Test.BA } } + protected override void OnDetectRelatedBundle(DetectRelatedBundleEventArgs args) + { + this.Log("OnDetectRelatedBundle() - id: {0}, missing from cache: {1}", args.ProductCode, args.MissingFromCache); + } + protected override void OnElevateBegin(ElevateBeginEventArgs args) { if (this.explicitlyElevateAndPlanFromOnElevateBegin) diff --git a/src/TestBA/TestBA.csproj b/src/TestBA/TestBA.csproj index 7196ba1b..72136230 100644 --- a/src/TestBA/TestBA.csproj +++ b/src/TestBA/TestBA.csproj @@ -19,6 +19,6 @@ - + \ No newline at end of file diff --git a/src/TestData/BasicFunctionalityTests/BundleA/BundleA.wixproj b/src/TestData/BasicFunctionalityTests/BundleA/BundleA.wixproj index ae38c899..a360812b 100644 --- a/src/TestData/BasicFunctionalityTests/BundleA/BundleA.wixproj +++ b/src/TestData/BasicFunctionalityTests/BundleA/BundleA.wixproj @@ -12,6 +12,6 @@ - + \ No newline at end of file diff --git a/src/TestData/DependencyTests/BundleAv1/BundleAv1.wixproj b/src/TestData/DependencyTests/BundleAv1/BundleAv1.wixproj index ede63892..8693fb19 100644 --- a/src/TestData/DependencyTests/BundleAv1/BundleAv1.wixproj +++ b/src/TestData/DependencyTests/BundleAv1/BundleAv1.wixproj @@ -9,7 +9,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleAv1_0_1/BundleAv1_0_1.wixproj b/src/TestData/DependencyTests/BundleAv1_0_1/BundleAv1_0_1.wixproj index 26a61a70..cb47ce74 100644 --- a/src/TestData/DependencyTests/BundleAv1_0_1/BundleAv1_0_1.wixproj +++ b/src/TestData/DependencyTests/BundleAv1_0_1/BundleAv1_0_1.wixproj @@ -9,7 +9,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleB/BundleB.wixproj b/src/TestData/DependencyTests/BundleB/BundleB.wixproj index 34c76ccb..8894d715 100644 --- a/src/TestData/DependencyTests/BundleB/BundleB.wixproj +++ b/src/TestData/DependencyTests/BundleB/BundleB.wixproj @@ -11,7 +11,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleC/BundleC.wixproj b/src/TestData/DependencyTests/BundleC/BundleC.wixproj index f77e772f..d29d2dda 100644 --- a/src/TestData/DependencyTests/BundleC/BundleC.wixproj +++ b/src/TestData/DependencyTests/BundleC/BundleC.wixproj @@ -15,7 +15,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleD/BundleD.wixproj b/src/TestData/DependencyTests/BundleD/BundleD.wixproj index 6f2f098e..02a7c559 100644 --- a/src/TestData/DependencyTests/BundleD/BundleD.wixproj +++ b/src/TestData/DependencyTests/BundleD/BundleD.wixproj @@ -15,7 +15,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleE/BundleE.wixproj b/src/TestData/DependencyTests/BundleE/BundleE.wixproj index e43ffceb..8129bbf3 100644 --- a/src/TestData/DependencyTests/BundleE/BundleE.wixproj +++ b/src/TestData/DependencyTests/BundleE/BundleE.wixproj @@ -14,7 +14,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleF/BundleF.wixproj b/src/TestData/DependencyTests/BundleF/BundleF.wixproj index 0bbe9ae6..64aec84f 100644 --- a/src/TestData/DependencyTests/BundleF/BundleF.wixproj +++ b/src/TestData/DependencyTests/BundleF/BundleF.wixproj @@ -14,7 +14,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wixproj b/src/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wixproj index 31994fb1..56c436b9 100644 --- a/src/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wixproj +++ b/src/TestData/DependencyTests/BundleF_AddOnA/BundleF_AddOnA.wixproj @@ -13,7 +13,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wixproj b/src/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wixproj index 056f8a1b..81f9cc84 100644 --- a/src/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wixproj +++ b/src/TestData/DependencyTests/BundleF_AddOnB/BundleF_AddOnB.wixproj @@ -14,7 +14,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleF_PatchAv1_0_1/BundleF_PatchAv1_0_1.wixproj b/src/TestData/DependencyTests/BundleF_PatchAv1_0_1/BundleF_PatchAv1_0_1.wixproj index 3c113acd..f882f401 100644 --- a/src/TestData/DependencyTests/BundleF_PatchAv1_0_1/BundleF_PatchAv1_0_1.wixproj +++ b/src/TestData/DependencyTests/BundleF_PatchAv1_0_1/BundleF_PatchAv1_0_1.wixproj @@ -9,7 +9,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleF_PatchAv1_0_2/BundleF_PatchAv1_0_2.wixproj b/src/TestData/DependencyTests/BundleF_PatchAv1_0_2/BundleF_PatchAv1_0_2.wixproj index cd88b4bf..6076aeda 100644 --- a/src/TestData/DependencyTests/BundleF_PatchAv1_0_2/BundleF_PatchAv1_0_2.wixproj +++ b/src/TestData/DependencyTests/BundleF_PatchAv1_0_2/BundleF_PatchAv1_0_2.wixproj @@ -10,7 +10,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleHv1/BundleHv1.wixproj b/src/TestData/DependencyTests/BundleHv1/BundleHv1.wixproj index 7c3d87f2..0d8ecbba 100644 --- a/src/TestData/DependencyTests/BundleHv1/BundleHv1.wixproj +++ b/src/TestData/DependencyTests/BundleHv1/BundleHv1.wixproj @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/src/TestData/DependencyTests/BundleHv2/BundleHv2.wixproj b/src/TestData/DependencyTests/BundleHv2/BundleHv2.wixproj index 4cf14238..4a08d817 100644 --- a/src/TestData/DependencyTests/BundleHv2/BundleHv2.wixproj +++ b/src/TestData/DependencyTests/BundleHv2/BundleHv2.wixproj @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/src/TestData/DependencyTests/BundleJ/BundleJ.wixproj b/src/TestData/DependencyTests/BundleJ/BundleJ.wixproj index 004b2d6a..5087c983 100644 --- a/src/TestData/DependencyTests/BundleJ/BundleJ.wixproj +++ b/src/TestData/DependencyTests/BundleJ/BundleJ.wixproj @@ -14,7 +14,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleJ_Patch/BundleJ_Patch.wixproj b/src/TestData/DependencyTests/BundleJ_Patch/BundleJ_Patch.wixproj index b7dbd86a..b827e325 100644 --- a/src/TestData/DependencyTests/BundleJ_Patch/BundleJ_Patch.wixproj +++ b/src/TestData/DependencyTests/BundleJ_Patch/BundleJ_Patch.wixproj @@ -14,7 +14,7 @@ - + diff --git a/src/TestData/DependencyTests/BundleKv1/BundleKv1.wixproj b/src/TestData/DependencyTests/BundleKv1/BundleKv1.wixproj index c5fca017..74e5b1ca 100644 --- a/src/TestData/DependencyTests/BundleKv1/BundleKv1.wixproj +++ b/src/TestData/DependencyTests/BundleKv1/BundleKv1.wixproj @@ -6,7 +6,7 @@ - + \ No newline at end of file diff --git a/src/TestData/DependencyTests/BundleKv2/BundleKv2.wixproj b/src/TestData/DependencyTests/BundleKv2/BundleKv2.wixproj index fbb53324..2761df11 100644 --- a/src/TestData/DependencyTests/BundleKv2/BundleKv2.wixproj +++ b/src/TestData/DependencyTests/BundleKv2/BundleKv2.wixproj @@ -9,7 +9,7 @@ - + \ No newline at end of file diff --git a/src/TestData/DependencyTests/BundleL/BundleL.wixproj b/src/TestData/DependencyTests/BundleL/BundleL.wixproj index f25af7f9..11b7cb75 100644 --- a/src/TestData/DependencyTests/BundleL/BundleL.wixproj +++ b/src/TestData/DependencyTests/BundleL/BundleL.wixproj @@ -13,7 +13,7 @@ - + diff --git a/src/TestData/ElevationTests/BundleA/BundleA.wixproj b/src/TestData/ElevationTests/BundleA/BundleA.wixproj index 0a6471a6..0c171236 100644 --- a/src/TestData/ElevationTests/BundleA/BundleA.wixproj +++ b/src/TestData/ElevationTests/BundleA/BundleA.wixproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/TestData/FailureTests/BundleA/BundleA.wixproj b/src/TestData/FailureTests/BundleA/BundleA.wixproj index 837a94d8..f72d6ba5 100644 --- a/src/TestData/FailureTests/BundleA/BundleA.wixproj +++ b/src/TestData/FailureTests/BundleA/BundleA.wixproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/src/TestData/FailureTests/BundleB/BundleB.wixproj b/src/TestData/FailureTests/BundleB/BundleB.wixproj index ff367ee4..8cd80a51 100644 --- a/src/TestData/FailureTests/BundleB/BundleB.wixproj +++ b/src/TestData/FailureTests/BundleB/BundleB.wixproj @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/src/TestData/FailureTests/BundleC/BundleC.wixproj b/src/TestData/FailureTests/BundleC/BundleC.wixproj index fc95d526..f56e9388 100644 --- a/src/TestData/FailureTests/BundleC/BundleC.wixproj +++ b/src/TestData/FailureTests/BundleC/BundleC.wixproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/src/TestData/ForwardCompatibleBundleTests/BundleAv1/BundleAv1.wixproj b/src/TestData/ForwardCompatibleBundleTests/BundleAv1/BundleAv1.wixproj index dea8b4f4..69d0408f 100644 --- a/src/TestData/ForwardCompatibleBundleTests/BundleAv1/BundleAv1.wixproj +++ b/src/TestData/ForwardCompatibleBundleTests/BundleAv1/BundleAv1.wixproj @@ -6,7 +6,7 @@ - + \ No newline at end of file diff --git a/src/TestData/ForwardCompatibleBundleTests/BundleAv2/BundleAv2.wixproj b/src/TestData/ForwardCompatibleBundleTests/BundleAv2/BundleAv2.wixproj index dec1d299..8c218de8 100644 --- a/src/TestData/ForwardCompatibleBundleTests/BundleAv2/BundleAv2.wixproj +++ b/src/TestData/ForwardCompatibleBundleTests/BundleAv2/BundleAv2.wixproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/TestData/ForwardCompatibleBundleTests/BundleCv1/BundleCv1.wixproj b/src/TestData/ForwardCompatibleBundleTests/BundleCv1/BundleCv1.wixproj index 28c6a478..4ab4e9c8 100644 --- a/src/TestData/ForwardCompatibleBundleTests/BundleCv1/BundleCv1.wixproj +++ b/src/TestData/ForwardCompatibleBundleTests/BundleCv1/BundleCv1.wixproj @@ -6,7 +6,7 @@ - + \ No newline at end of file diff --git a/src/TestData/ForwardCompatibleBundleTests/BundleCv2/BundleCv2.wixproj b/src/TestData/ForwardCompatibleBundleTests/BundleCv2/BundleCv2.wixproj index 51f61d73..dbf64202 100644 --- a/src/TestData/ForwardCompatibleBundleTests/BundleCv2/BundleCv2.wixproj +++ b/src/TestData/ForwardCompatibleBundleTests/BundleCv2/BundleCv2.wixproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/TestData/MsiTransactionTests/BundleAv1/BundleAv1.wixproj b/src/TestData/MsiTransactionTests/BundleAv1/BundleAv1.wixproj index c240711d..37f6fe3d 100644 --- a/src/TestData/MsiTransactionTests/BundleAv1/BundleAv1.wixproj +++ b/src/TestData/MsiTransactionTests/BundleAv1/BundleAv1.wixproj @@ -7,6 +7,6 @@ - + \ No newline at end of file diff --git a/src/TestData/MsiTransactionTests/BundleAv2/BundleAv2.wixproj b/src/TestData/MsiTransactionTests/BundleAv2/BundleAv2.wixproj index 0769a7ef..4a0338e9 100644 --- a/src/TestData/MsiTransactionTests/BundleAv2/BundleAv2.wixproj +++ b/src/TestData/MsiTransactionTests/BundleAv2/BundleAv2.wixproj @@ -10,6 +10,6 @@ - + \ No newline at end of file diff --git a/src/TestData/MsiTransactionTests/BundleBv1/BundleBv1.wixproj b/src/TestData/MsiTransactionTests/BundleBv1/BundleBv1.wixproj index 0a40354d..7580e13b 100644 --- a/src/TestData/MsiTransactionTests/BundleBv1/BundleBv1.wixproj +++ b/src/TestData/MsiTransactionTests/BundleBv1/BundleBv1.wixproj @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/src/TestData/MsiTransactionTests/BundleBv2/BundleBv2.wixproj b/src/TestData/MsiTransactionTests/BundleBv2/BundleBv2.wixproj index 0ad40b51..787cd584 100644 --- a/src/TestData/MsiTransactionTests/BundleBv2/BundleBv2.wixproj +++ b/src/TestData/MsiTransactionTests/BundleBv2/BundleBv2.wixproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/TestData/PatchTests/BundleA/BundleA.wixproj b/src/TestData/PatchTests/BundleA/BundleA.wixproj index 96f1e03a..b9d601c7 100644 --- a/src/TestData/PatchTests/BundleA/BundleA.wixproj +++ b/src/TestData/PatchTests/BundleA/BundleA.wixproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/src/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj b/src/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj index f7a8c580..998a3abc 100644 --- a/src/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj +++ b/src/TestData/PatchTests/BundlePatchA/BundlePatchA.wixproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/src/TestData/PatchTests/BundlePatchA2/BundlePatchA2.wixproj b/src/TestData/PatchTests/BundlePatchA2/BundlePatchA2.wixproj index b886f148..a235474e 100644 --- a/src/TestData/PatchTests/BundlePatchA2/BundlePatchA2.wixproj +++ b/src/TestData/PatchTests/BundlePatchA2/BundlePatchA2.wixproj @@ -14,7 +14,7 @@ - + \ No newline at end of file diff --git a/src/TestData/PrereqBaTests/BundleA/BundleA.wixproj b/src/TestData/PrereqBaTests/BundleA/BundleA.wixproj index 15913104..a61f4529 100644 --- a/src/TestData/PrereqBaTests/BundleA/BundleA.wixproj +++ b/src/TestData/PrereqBaTests/BundleA/BundleA.wixproj @@ -16,6 +16,6 @@ - + \ No newline at end of file diff --git a/src/TestData/PrereqBaTests/BundleB/BundleB.wixproj b/src/TestData/PrereqBaTests/BundleB/BundleB.wixproj index 66140e97..de26e2f8 100644 --- a/src/TestData/PrereqBaTests/BundleB/BundleB.wixproj +++ b/src/TestData/PrereqBaTests/BundleB/BundleB.wixproj @@ -16,6 +16,6 @@ - + \ No newline at end of file diff --git a/src/TestData/RegistrationTests/BundleA/BundleA.wixproj b/src/TestData/RegistrationTests/BundleA/BundleA.wixproj index c2e01330..bb816c8c 100644 --- a/src/TestData/RegistrationTests/BundleA/BundleA.wixproj +++ b/src/TestData/RegistrationTests/BundleA/BundleA.wixproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/TestData/RollbackBoundaryTests/BundleA/BundleA.wixproj b/src/TestData/RollbackBoundaryTests/BundleA/BundleA.wixproj index a548161e..14ef9f55 100644 --- a/src/TestData/RollbackBoundaryTests/BundleA/BundleA.wixproj +++ b/src/TestData/RollbackBoundaryTests/BundleA/BundleA.wixproj @@ -15,6 +15,6 @@ - + \ No newline at end of file diff --git a/src/TestData/SlipstreamTests/BundleA/BundleA.wixproj b/src/TestData/SlipstreamTests/BundleA/BundleA.wixproj index 1db21045..f4ce06f2 100644 --- a/src/TestData/SlipstreamTests/BundleA/BundleA.wixproj +++ b/src/TestData/SlipstreamTests/BundleA/BundleA.wixproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/src/TestData/SlipstreamTests/BundleAReverse/BundleAReverse.wixproj b/src/TestData/SlipstreamTests/BundleAReverse/BundleAReverse.wixproj index 5a81ff89..bc6b32c6 100644 --- a/src/TestData/SlipstreamTests/BundleAReverse/BundleAReverse.wixproj +++ b/src/TestData/SlipstreamTests/BundleAReverse/BundleAReverse.wixproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/src/TestData/SlipstreamTests/BundleB/BundleB.wixproj b/src/TestData/SlipstreamTests/BundleB/BundleB.wixproj index c21e0adc..86d3a019 100644 --- a/src/TestData/SlipstreamTests/BundleB/BundleB.wixproj +++ b/src/TestData/SlipstreamTests/BundleB/BundleB.wixproj @@ -14,7 +14,7 @@ - + \ No newline at end of file diff --git a/src/TestData/SlipstreamTests/BundleC/BundleC.wixproj b/src/TestData/SlipstreamTests/BundleC/BundleC.wixproj index 570d1520..7bb8f67c 100644 --- a/src/TestData/SlipstreamTests/BundleC/BundleC.wixproj +++ b/src/TestData/SlipstreamTests/BundleC/BundleC.wixproj @@ -15,7 +15,7 @@ - + \ No newline at end of file diff --git a/src/TestData/SlipstreamTests/BundleD/BundleD.wixproj b/src/TestData/SlipstreamTests/BundleD/BundleD.wixproj index 13e4a9e0..273ace2d 100644 --- a/src/TestData/SlipstreamTests/BundleD/BundleD.wixproj +++ b/src/TestData/SlipstreamTests/BundleD/BundleD.wixproj @@ -13,7 +13,7 @@ - + \ No newline at end of file diff --git a/src/TestData/SlipstreamTests/BundleOnlyA/BundleOnlyA.wixproj b/src/TestData/SlipstreamTests/BundleOnlyA/BundleOnlyA.wixproj index 5170c4fd..c843cc5f 100644 --- a/src/TestData/SlipstreamTests/BundleOnlyA/BundleOnlyA.wixproj +++ b/src/TestData/SlipstreamTests/BundleOnlyA/BundleOnlyA.wixproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/TestData/SlipstreamTests/BundleOnlyPatchA/BundleOnlyPatchA.wixproj b/src/TestData/SlipstreamTests/BundleOnlyPatchA/BundleOnlyPatchA.wixproj index 96223368..cabc5727 100644 --- a/src/TestData/SlipstreamTests/BundleOnlyPatchA/BundleOnlyPatchA.wixproj +++ b/src/TestData/SlipstreamTests/BundleOnlyPatchA/BundleOnlyPatchA.wixproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj b/src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj index 33b1379e..2bd434ce 100644 --- a/src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj +++ b/src/TestData/TestBA/TestBAWixlib/testbawixlib.wixproj @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleA.props b/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleA.props new file mode 100644 index 00000000..ee20a72c --- /dev/null +++ b/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleA.props @@ -0,0 +1,10 @@ + + + + Bundle + {8C01FD92-87BE-419B-88EC-36754E93CA67} + + + + + diff --git a/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleAv1.wixproj b/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleAv1.wixproj new file mode 100644 index 00000000..69d0408f --- /dev/null +++ b/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleAv1.wixproj @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleAv1.wxs b/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleAv1.wxs new file mode 100644 index 00000000..7bf16212 --- /dev/null +++ b/src/TestData/UpgradeRelatedBundleTests/BundleAv1/BundleAv1.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/TestData/UpgradeRelatedBundleTests/BundleAv2/BundleAv2.wixproj b/src/TestData/UpgradeRelatedBundleTests/BundleAv2/BundleAv2.wixproj new file mode 100644 index 00000000..78e773db --- /dev/null +++ b/src/TestData/UpgradeRelatedBundleTests/BundleAv2/BundleAv2.wixproj @@ -0,0 +1,15 @@ + + + + + 2.0.0.0 + + + + + + + + + + \ No newline at end of file diff --git a/src/TestData/UpgradeRelatedBundleTests/BundleAv2/BundleAv2.wxs b/src/TestData/UpgradeRelatedBundleTests/BundleAv2/BundleAv2.wxs new file mode 100644 index 00000000..5cbee5a8 --- /dev/null +++ b/src/TestData/UpgradeRelatedBundleTests/BundleAv2/BundleAv2.wxs @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/TestData/UpgradeRelatedBundleTests/PackageAv1/PackageA.props b/src/TestData/UpgradeRelatedBundleTests/PackageAv1/PackageA.props new file mode 100644 index 00000000..53541e10 --- /dev/null +++ b/src/TestData/UpgradeRelatedBundleTests/PackageAv1/PackageA.props @@ -0,0 +1,9 @@ + + + + {E7AF5E0D-EC10-4339-9126-76A76011DA3A} + + + + + \ No newline at end of file diff --git a/src/TestData/UpgradeRelatedBundleTests/PackageAv1/PackageAv1.wixproj b/src/TestData/UpgradeRelatedBundleTests/PackageAv1/PackageAv1.wixproj new file mode 100644 index 00000000..45d3b2c8 --- /dev/null +++ b/src/TestData/UpgradeRelatedBundleTests/PackageAv1/PackageAv1.wixproj @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/TestData/UpgradeRelatedBundleTests/PackageAv2/PackageAv2.wixproj b/src/TestData/UpgradeRelatedBundleTests/PackageAv2/PackageAv2.wixproj new file mode 100644 index 00000000..b419f663 --- /dev/null +++ b/src/TestData/UpgradeRelatedBundleTests/PackageAv2/PackageAv2.wixproj @@ -0,0 +1,7 @@ + + + + + 2.0.0.0 + + \ No newline at end of file diff --git a/src/WixTestTools/BundleInstaller.cs b/src/WixTestTools/BundleInstaller.cs index 854c12f0..859656ad 100644 --- a/src/WixTestTools/BundleInstaller.cs +++ b/src/WixTestTools/BundleInstaller.cs @@ -36,6 +36,18 @@ namespace WixTestTools return this.RunBundleWithArguments(expectedExitCode, MSIExec.MSIExecMode.Install, arguments); } + /// + /// Installs the bundle with optional arguments. + /// + /// This should be the bundle in the package cache. + /// Expected exit code, defaults to success. + /// Optional arguments to pass to the tool. + /// Path to the generated log file. + public string Install(string bundlePath, int expectedExitCode = (int)MSIExec.MSIExecReturnCode.SUCCESS, params string[] arguments) + { + return this.RunBundleWithArguments(expectedExitCode, MSIExec.MSIExecMode.Install, arguments, bundlePath: bundlePath); + } + /// /// Modify the bundle with optional arguments. /// diff --git a/src/WixTestTools/BundleVerifier.cs b/src/WixTestTools/BundleVerifier.cs index 433b6a0a..293da560 100644 --- a/src/WixTestTools/BundleVerifier.cs +++ b/src/WixTestTools/BundleVerifier.cs @@ -56,6 +56,20 @@ namespace WixTestTools return Path.Combine(cachePath, Path.GetFileName(this.Bundle)); } + public string ManuallyCache() + { + var expectedCachePath = this.GetExpectedCachedBundlePath(); + Directory.CreateDirectory(Path.GetDirectoryName(expectedCachePath)); + File.Copy(this.Bundle, expectedCachePath); + return expectedCachePath; + } + + public void ManuallyUncache() + { + var expectedCachePath = this.GetExpectedCachedBundlePath(); + File.Delete(expectedCachePath); + } + public bool TryGetRegistration(out BundleRegistration registration) { var bundleSymbol = this.GetBundleSymbol(); diff --git a/src/WixTestTools/WixTestTools.csproj b/src/WixTestTools/WixTestTools.csproj index 0c3c4c76..38b2cb35 100644 --- a/src/WixTestTools/WixTestTools.csproj +++ b/src/WixTestTools/WixTestTools.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/src/WixToolsetTest.BurnE2E/DependencyTests.cs b/src/WixToolsetTest.BurnE2E/DependencyTests.cs index 2e27239f..f542b149 100644 --- a/src/WixToolsetTest.BurnE2E/DependencyTests.cs +++ b/src/WixToolsetTest.BurnE2E/DependencyTests.cs @@ -593,7 +593,7 @@ namespace WixToolsetTest.BurnE2E packageDv2.VerifyInstalled(true); Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv2InstallLogFilePath, @"Skipping cross-scope dependency registration on package: PackageA, bundle scope: PerUser, package scope: PerMachine")); - Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerUser, version: 1\.0\.0\.0, operation: MajorUpgrade")); + Assert.True(LogVerifier.MessageInLogFileRegex(bundleHv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerUser, version: 1\.0\.0\.0, operation: MajorUpgrade, cached: Complete")); bundleHv2.Uninstall(); bundleHv2.VerifyUnregisteredAndRemovedFromPackageCache(); diff --git a/src/WixToolsetTest.BurnE2E/RegistrationTests.cs b/src/WixToolsetTest.BurnE2E/RegistrationTests.cs index 640b5085..51122c28 100644 --- a/src/WixToolsetTest.BurnE2E/RegistrationTests.cs +++ b/src/WixToolsetTest.BurnE2E/RegistrationTests.cs @@ -10,6 +10,21 @@ namespace WixToolsetTest.BurnE2E { public RegistrationTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + [Fact] + public void AutomaticallyUncachesBundleWhenNotInstalled() + { + var bundleA = this.CreateBundleInstaller("BundleA"); + var testBAController = this.CreateTestBAController(); + + var cachedBundlePath = bundleA.ManuallyCache(); + + testBAController.SetQuitAfterDetect(); + + bundleA.Install(cachedBundlePath); + + bundleA.VerifyUnregisteredAndRemovedFromPackageCache(); + } + [Fact] public void AutomaticallyUninstallsBundleWithoutBADoingApply() { @@ -22,6 +37,18 @@ namespace WixToolsetTest.BurnE2E this.InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(false); } + [Fact] + public void RegistersInARPIfPrecached() + { + var bundleA = this.CreateBundleInstaller("BundleA"); + + bundleA.ManuallyCache(); + + // Verifies https://github.com/wixtoolset/issues/issues/5702 + bundleA.Install(); + bundleA.VerifyRegisteredAndInPackageCache(); + } + private void InstallBundleThenManuallyUninstallPackageAndRemovePackageFromCacheThenRunAndQuitWithoutApply(bool detect) { var packageA = this.CreatePackageInstaller("PackageA"); diff --git a/src/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs b/src/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs new file mode 100644 index 00000000..a48f45f4 --- /dev/null +++ b/src/WixToolsetTest.BurnE2E/UpgradeRelatedBundleTests.cs @@ -0,0 +1,36 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolsetTest.BurnE2E +{ + using System; + using System.IO; + using WixTestTools; + using Xunit; + using Xunit.Abstractions; + + public class UpgradeRelatedBundleTests : BurnE2ETests + { + public UpgradeRelatedBundleTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + [Fact] + public void ReportsRelatedBundleMissingFromCache() + { + var packageAv1 = this.CreatePackageInstaller("PackageAv1"); + var packageAv2 = this.CreatePackageInstaller("PackageAv2"); + var bundleAv1 = this.CreateBundleInstaller("BundleAv1"); + var bundleAv2 = this.CreateBundleInstaller("BundleAv2"); + + bundleAv1.Install(); + bundleAv1.VerifyRegisteredAndInPackageCache(); + + bundleAv1.ManuallyUncache(); + + // Verify https://github.com/wixtoolset/issues/issues/4991 + var bundleAv2InstallLogFilePath = bundleAv2.Install(); + bundleAv2.VerifyRegisteredAndInPackageCache(); + + Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2InstallLogFilePath, @"OnDetectRelatedBundle\(\) - id: \{[0-9A-Za-z\-]{36}\}, missing from cache: True")); + Assert.True(LogVerifier.MessageInLogFileRegex(bundleAv2InstallLogFilePath, @"Detected related bundle: \{[0-9A-Za-z\-]{36}\}, type: Upgrade, scope: PerMachine, version: 1\.0\.0\.0, operation: MajorUpgrade, cached: None")); + } + } +} diff --git a/src/WixToolsetTest.BurnE2E/WixToolsetTest.BurnE2E.csproj b/src/WixToolsetTest.BurnE2E/WixToolsetTest.BurnE2E.csproj index f1db82e7..170f5c73 100644 --- a/src/WixToolsetTest.BurnE2E/WixToolsetTest.BurnE2E.csproj +++ b/src/WixToolsetTest.BurnE2E/WixToolsetTest.BurnE2E.csproj @@ -20,8 +20,8 @@ - - + + -- cgit v1.2.3-55-g6feb