diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-12-02 14:33:15 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-12-02 14:52:55 -0600 |
| commit | 5a874790ba9ec6c2d3c9002699114c2fe4c493ae (patch) | |
| tree | 4baa88262fbae45446363baf174d54a6877a9a9e /src/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs | |
| parent | 2a8f47e357bfbfe20c962cade4455793e45dae7c (diff) | |
| download | wix-5a874790ba9ec6c2d3c9002699114c2fe4c493ae.tar.gz wix-5a874790ba9ec6c2d3c9002699114c2fe4c493ae.tar.bz2 wix-5a874790ba9ec6c2d3c9002699114c2fe4c493ae.zip | |
MSI transaction cleanup.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs new file mode 100644 index 00000000..5a29eb9e --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/MsiTransactionFixture.cs | |||
| @@ -0,0 +1,129 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolsetTest.CoreIntegration | ||
| 4 | { | ||
| 5 | using System.IO; | ||
| 6 | using WixBuildTools.TestSupport; | ||
| 7 | using WixToolset.Core.TestPackage; | ||
| 8 | using Xunit; | ||
| 9 | |||
| 10 | public class MsiTransactionFixture | ||
| 11 | { | ||
| 12 | [Fact] | ||
| 13 | public void CantBuildX64AfterX86Bundle() | ||
| 14 | { | ||
| 15 | var folder = TestData.Get(@"TestData"); | ||
| 16 | |||
| 17 | using (var fs = new DisposableFileSystem()) | ||
| 18 | { | ||
| 19 | var baseFolder = fs.GetFolder(); | ||
| 20 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 21 | var binFolder = Path.Combine(baseFolder, "bin"); | ||
| 22 | var exePath = Path.Combine(binFolder, "test.exe"); | ||
| 23 | |||
| 24 | BuildMsiPackages(folder, intermediateFolder, binFolder); | ||
| 25 | |||
| 26 | var result = WixRunner.Execute(new[] | ||
| 27 | { | ||
| 28 | "build", | ||
| 29 | Path.Combine(folder, "MsiTransaction", "X64AfterX86Bundle.wxs"), | ||
| 30 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), | ||
| 31 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
| 32 | "-bindpath", binFolder, | ||
| 33 | "-intermediateFolder", intermediateFolder, | ||
| 34 | "-o", exePath, | ||
| 35 | }); | ||
| 36 | |||
| 37 | Assert.Equal(390, result.ExitCode); | ||
| 38 | } | ||
| 39 | } | ||
| 40 | |||
| 41 | [Fact] | ||
| 42 | public void CanBuildX86AfterX64Bundle() | ||
| 43 | { | ||
| 44 | var folder = TestData.Get(@"TestData"); | ||
| 45 | |||
| 46 | using (var fs = new DisposableFileSystem()) | ||
| 47 | { | ||
| 48 | var baseFolder = fs.GetFolder(); | ||
| 49 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 50 | var binFolder = Path.Combine(baseFolder, "bin"); | ||
| 51 | var exePath = Path.Combine(binFolder, "test.exe"); | ||
| 52 | |||
| 53 | BuildMsiPackages(folder, intermediateFolder, binFolder); | ||
| 54 | |||
| 55 | var result = WixRunner.Execute(new[] | ||
| 56 | { | ||
| 57 | "build", | ||
| 58 | Path.Combine(folder, "MsiTransaction", "X86AfterX64Bundle.wxs"), | ||
| 59 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), | ||
| 60 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
| 61 | "-bindpath", binFolder, | ||
| 62 | "-intermediateFolder", intermediateFolder, | ||
| 63 | "-o", exePath, | ||
| 64 | }); | ||
| 65 | |||
| 66 | result.AssertSuccess(); | ||
| 67 | |||
| 68 | Assert.True(File.Exists(exePath)); | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | private static void BuildMsiPackages(string folder, string intermediateFolder, string binFolder) | ||
| 73 | { | ||
| 74 | var result = WixRunner.Execute(new[] | ||
| 75 | { | ||
| 76 | "build", | ||
| 77 | Path.Combine(folder, "MsiTransaction", "FirstX86.wxs"), | ||
| 78 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 79 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 80 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 81 | "-intermediateFolder", intermediateFolder, | ||
| 82 | "-o", Path.Combine(binFolder, "FirstX86.msi"), | ||
| 83 | }); | ||
| 84 | |||
| 85 | result.AssertSuccess(); | ||
| 86 | |||
| 87 | result = WixRunner.Execute(new[] | ||
| 88 | { | ||
| 89 | "build", | ||
| 90 | Path.Combine(folder, "MsiTransaction", "SecondX86.wxs"), | ||
| 91 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 92 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 93 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 94 | "-intermediateFolder", intermediateFolder, | ||
| 95 | "-o", Path.Combine(binFolder, "SecondX86.msi"), | ||
| 96 | }); | ||
| 97 | |||
| 98 | result.AssertSuccess(); | ||
| 99 | |||
| 100 | result = WixRunner.Execute(new[] | ||
| 101 | { | ||
| 102 | "build", | ||
| 103 | Path.Combine(folder, "MsiTransaction", "FirstX64.wxs"), | ||
| 104 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 105 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 106 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 107 | "-intermediateFolder", intermediateFolder, | ||
| 108 | "-arch", "x64", | ||
| 109 | "-o", Path.Combine(binFolder, "FirstX64.msi"), | ||
| 110 | }); | ||
| 111 | |||
| 112 | result.AssertSuccess(); | ||
| 113 | |||
| 114 | result = WixRunner.Execute(new[] | ||
| 115 | { | ||
| 116 | "build", | ||
| 117 | Path.Combine(folder, "MsiTransaction", "SecondX64.wxs"), | ||
| 118 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 119 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 120 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 121 | "-intermediateFolder", intermediateFolder, | ||
| 122 | "-arch", "x64", | ||
| 123 | "-o", Path.Combine(binFolder, "SecondX64.msi"), | ||
| 124 | }); | ||
| 125 | |||
| 126 | result.AssertSuccess(); | ||
| 127 | } | ||
| 128 | } | ||
| 129 | } | ||
