Verify MSI transactions are registered and cached appropriately.
Sean Hall committed
Dec 31, 2020 at 20:30 UTC
d45c8da71cd9eecdbb314d04754f4316cadeba6f
1 file changed
+16
src/WixToolsetTest.BurnE2E/MsiTransactionTests.cs
+16
@@ -41,6 +41,8 @@ namespace WixToolsetTest.BurnE2E
41
42
bundleAv1.Install();
43
44
+ var bundleAv1CachedPath = bundleAv1.VerifyRegisteredAndInPackageCache();
45
+
46
// Source file should be installed
47
Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
48
Assert.True(File.Exists(packageBv1SourceCodeInstalled), String.Concat("Should have found Package Bv1 payload installed at: ", packageBv1SourceCodeInstalled));
@@ -48,6 +50,8 @@ namespace WixToolsetTest.BurnE2E
50
51
bundleAv2.Install();
52
53
+ var bundleAv2CachedPath = bundleAv2.VerifyRegisteredAndInPackageCache();
54
+
55
// Source file should be upgraded
56
Assert.True(File.Exists(packageDSourceCodeInstalled), String.Concat("Should have found Package D payload installed at: ", packageDSourceCodeInstalled));
57
Assert.True(File.Exists(packageBv2SourceCodeInstalled), String.Concat("Should have found Package Bv2 payload installed at: ", packageBv2SourceCodeInstalled));
@@ -56,6 +60,8 @@ namespace WixToolsetTest.BurnE2E
60
Assert.False(File.Exists(packageBv1SourceCodeInstalled), String.Concat("Package Bv1 payload should have been removed by upgrade uninstall from: ", packageBv1SourceCodeInstalled));
61
Assert.False(File.Exists(packageASourceCodeInstalled), String.Concat("Package A payload should have been removed by upgrade uninstall from: ", packageASourceCodeInstalled));
62
63
+ bundleAv1.VerifyUnregisteredAndRemovedFromPackageCache(bundleAv1CachedPath);
64
+
65
// Uninstall everything.
66
bundleAv2.Uninstall();
67
@@ -63,6 +69,8 @@ namespace WixToolsetTest.BurnE2E
69
Assert.False(File.Exists(packageDSourceCodeInstalled), String.Concat("Package D payload should have been removed by uninstall from: ", packageDSourceCodeInstalled));
70
Assert.False(File.Exists(packageBv2SourceCodeInstalled), String.Concat("Package Bv2 payload should have been removed by uninstall from: ", packageBv2SourceCodeInstalled));
71
Assert.False(File.Exists(packageCv2SourceCodeInstalled), String.Concat("Package Cv2 payload should have been removed by uninstall from: ", packageCv2SourceCodeInstalled));
72
+
73
+ bundleAv2.VerifyUnregisteredAndRemovedFromPackageCache(bundleAv2CachedPath);
74
}
75
76
/// <summary>
@@ -95,11 +103,19 @@ namespace WixToolsetTest.BurnE2E
103
104
bundleBv1.Install();
105
106
+ bundleBv1.VerifyRegisteredAndInPackageCache();
107
+
108
// Source file should be installed
109
Assert.True(File.Exists(packageBv1SourceCodeInstalled), String.Concat("Should have found Package Bv1 payload installed at: ", packageBv1SourceCodeInstalled));
110
111
bundleBv2.Install((int)MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE);
112
113
+ // Bundle v2 should be registered since it installed a non-permanent package.
114
+ bundleBv2.VerifyRegisteredAndInPackageCache();
115
+
116
+ // Bundle v1 should not have been removed since the install of v2 failed in the middle of the chain.
117
+ bundleBv1.VerifyRegisteredAndInPackageCache();
118
+
119
// Source file should be installed
120
Assert.True(File.Exists(packageASourceCodeInstalled), String.Concat("Should have found Package A payload installed at: ", packageASourceCodeInstalled));
121