From d45c8da71cd9eecdbb314d04754f4316cadeba6f Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 31 Dec 2020 20:30:27 -0600 Subject: Verify MSI transactions are registered and cached appropriately. --- src/WixToolsetTest.BurnE2E/MsiTransactionTests.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/WixToolsetTest.BurnE2E/MsiTransactionTests.cs b/src/WixToolsetTest.BurnE2E/MsiTransactionTests.cs index 3c9261a7..53ed1fd2 100644 --- a/src/WixToolsetTest.BurnE2E/MsiTransactionTests.cs +++ b/src/WixToolsetTest.BurnE2E/MsiTransactionTests.cs @@ -41,6 +41,8 @@ namespace WixToolsetTest.BurnE2E bundleAv1.Install(); + var bundleAv1CachedPath = bundleAv1.VerifyRegisteredAndInPackageCache(); + // Source file should be installed Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled)); Assert.True(File.Exists(packageBv1SourceCodeInstalled), String.Concat("Should have found Package Bv1 payload installed at: ", packageBv1SourceCodeInstalled)); @@ -48,6 +50,8 @@ namespace WixToolsetTest.BurnE2E bundleAv2.Install(); + var bundleAv2CachedPath = bundleAv2.VerifyRegisteredAndInPackageCache(); + // Source file should be upgraded Assert.True(File.Exists(packageDSourceCodeInstalled), String.Concat("Should have found Package D payload installed at: ", packageDSourceCodeInstalled)); Assert.True(File.Exists(packageBv2SourceCodeInstalled), String.Concat("Should have found Package Bv2 payload installed at: ", packageBv2SourceCodeInstalled)); @@ -56,6 +60,8 @@ namespace WixToolsetTest.BurnE2E Assert.False(File.Exists(packageBv1SourceCodeInstalled), String.Concat("Package Bv1 payload should have been removed by upgrade uninstall from: ", packageBv1SourceCodeInstalled)); Assert.False(File.Exists(packageASourceCodeInstalled), String.Concat("Package A payload should have been removed by upgrade uninstall from: ", packageASourceCodeInstalled)); + bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache(bundleAv1CachedPath); + // Uninstall everything. bundleAv2.Uninstall(); @@ -63,6 +69,8 @@ namespace WixToolsetTest.BurnE2E Assert.False(File.Exists(packageDSourceCodeInstalled), String.Concat("Package D payload should have been removed by uninstall from: ", packageDSourceCodeInstalled)); Assert.False(File.Exists(packageBv2SourceCodeInstalled), String.Concat("Package Bv2 payload should have been removed by uninstall from: ", packageBv2SourceCodeInstalled)); Assert.False(File.Exists(packageCv2SourceCodeInstalled), String.Concat("Package Cv2 payload should have been removed by uninstall from: ", packageCv2SourceCodeInstalled)); + + bundleAv2.VerifyUnregisteredAndRemovedFromPackageCache(bundleAv2CachedPath); } /// @@ -95,11 +103,19 @@ namespace WixToolsetTest.BurnE2E bundleBv1.Install(); + bundleBv1.VerifyRegisteredAndInPackageCache(); + // Source file should be installed Assert.True(File.Exists(packageBv1SourceCodeInstalled), String.Concat("Should have found Package Bv1 payload installed at: ", packageBv1SourceCodeInstalled)); bundleBv2.Install((int)MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); + // Bundle v2 should be registered since it installed a non-permanent package. + bundleBv2.VerifyRegisteredAndInPackageCache(); + + // Bundle v1 should not have been removed since the install of v2 failed in the middle of the chain. + bundleBv1.VerifyRegisteredAndInPackageCache(); + // Source file should be installed Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled)); -- cgit v1.2.3-55-g6feb