diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-03-07 14:48:08 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-03-08 15:51:55 -0600 |
commit | 6bcf25fe37f0b4dc5f2f43720777e7ab0d26b030 (patch) | |
tree | 1b6106f9cae45fb60c59f1df45c328408c286865 /src/test | |
parent | 7fa2390b06b643ec775d00d7938c1624f5c0fdfe (diff) | |
download | wix-6bcf25fe37f0b4dc5f2f43720777e7ab0d26b030.tar.gz wix-6bcf25fe37f0b4dc5f2f43720777e7ab0d26b030.tar.bz2 wix-6bcf25fe37f0b4dc5f2f43720777e7ab0d26b030.zip |
Add failing test for patch from MSI that included a file from a wixext.
Diffstat (limited to 'src/test')
3 files changed, 70 insertions, 1 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index 788cc01f..de6d00a2 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PatchFixture.cs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
4 | { | 4 | { |
5 | using System; | ||
5 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
6 | using System.ComponentModel; | 7 | using System.ComponentModel; |
7 | using System.IO; | 8 | using System.IO; |
@@ -10,6 +11,7 @@ namespace WixToolsetTest.CoreIntegration | |||
10 | using System.Text; | 11 | using System.Text; |
11 | using System.Xml; | 12 | using System.Xml; |
12 | using System.Xml.Linq; | 13 | using System.Xml.Linq; |
14 | using Example.Extension; | ||
13 | using WixBuildTools.TestSupport; | 15 | using WixBuildTools.TestSupport; |
14 | using WixToolset.Core.TestPackage; | 16 | using WixToolset.Core.TestPackage; |
15 | using WixToolset.Data; | 17 | using WixToolset.Data; |
@@ -84,6 +86,25 @@ namespace WixToolsetTest.CoreIntegration | |||
84 | } | 86 | } |
85 | } | 87 | } |
86 | 88 | ||
89 | [Fact(Skip = "Test demonstrates failure")] | ||
90 | public void CanBuildPatchFromProductWithFilesFromWixlib() | ||
91 | { | ||
92 | var folder = TestData.Get(@"TestData\PatchFromWixlib"); | ||
93 | |||
94 | using (var fs = new DisposableFileSystem()) | ||
95 | { | ||
96 | var tempFolder = fs.GetFolder(); | ||
97 | |||
98 | var baselinePdb = BuildMsi("Baseline.msi", folder, tempFolder, "1.0.0", "1.0.0", "1.0.0"); | ||
99 | var update1Pdb = BuildMsi("Update.msi", folder, tempFolder, "1.0.1", "1.0.1", "1.0.1"); | ||
100 | var patchPdb = BuildMsp("Patch1.msp", folder, tempFolder, "1.0.1", hasNoFiles: true); | ||
101 | var patchPath = Path.ChangeExtension(patchPdb, ".msp"); | ||
102 | |||
103 | Assert.True(File.Exists(baselinePdb)); | ||
104 | Assert.True(File.Exists(update1Pdb)); | ||
105 | } | ||
106 | } | ||
107 | |||
87 | [Fact] | 108 | [Fact] |
88 | public void CanBuildBundleWithNonSpecificPatches() | 109 | public void CanBuildBundleWithNonSpecificPatches() |
89 | { | 110 | { |
@@ -164,6 +185,7 @@ namespace WixToolsetTest.CoreIntegration | |||
164 | 185 | ||
165 | private static string BuildMsi(string outputName, string sourceFolder, string baseFolder, string defineV, string defineA, string defineB) | 186 | private static string BuildMsi(string outputName, string sourceFolder, string baseFolder, string defineV, string defineA, string defineB) |
166 | { | 187 | { |
188 | var extensionPath = Path.GetFullPath(new Uri(typeof(ExampleExtensionFactory).Assembly.CodeBase).LocalPath); | ||
167 | var outputPath = Path.Combine(baseFolder, Path.Combine("bin", outputName)); | 189 | var outputPath = Path.Combine(baseFolder, Path.Combine("bin", outputName)); |
168 | 190 | ||
169 | var result = WixRunner.Execute(new[] | 191 | var result = WixRunner.Execute(new[] |
@@ -175,7 +197,8 @@ namespace WixToolsetTest.CoreIntegration | |||
175 | "-d", "B=" + defineB, | 197 | "-d", "B=" + defineB, |
176 | "-bindpath", Path.Combine(sourceFolder, ".data"), | 198 | "-bindpath", Path.Combine(sourceFolder, ".data"), |
177 | "-intermediateFolder", Path.Combine(baseFolder, "obj"), | 199 | "-intermediateFolder", Path.Combine(baseFolder, "obj"), |
178 | "-o", outputPath | 200 | "-o", outputPath, |
201 | "-ext", extensionPath, | ||
179 | }); | 202 | }); |
180 | 203 | ||
181 | result.AssertSuccess(); | 204 | result.AssertSuccess(); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/PatchFromWixlib/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/PatchFromWixlib/Package.wxs new file mode 100644 index 00000000..5cb8ede8 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/PatchFromWixlib/Package.wxs | |||
@@ -0,0 +1,30 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
2 | <Package Name="~Test Package" Version="$(var.V)" Manufacturer="Example Corporation" Language="1033" UpgradeCode="{6B8097B9-A5D0-4BDE-B21E-AF6622DDCA01}" Scope="perMachine" ProductCode="{7C871EC1-1F89-4850-A6A9-D7A4C21769F6}"> | ||
3 | <MajorUpgrade DowngradeErrorMessage="Newer version already installed." /> | ||
4 | <MediaTemplate EmbedCab="yes" /> | ||
5 | |||
6 | <CustomAction Id="CAFromExtension" DllEntry="DoesntExist" BinaryRef="BinFromWir" /> | ||
7 | |||
8 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
9 | <Directory Id="ProgramFilesFolder"> | ||
10 | <Directory Id="INSTALLFOLDER" Name="~Test App" /> | ||
11 | </Directory> | ||
12 | </Directory> | ||
13 | |||
14 | <Feature Id="Main"> | ||
15 | <ComponentGroupRef Id="Components" /> | ||
16 | </Feature> | ||
17 | </Package> | ||
18 | |||
19 | <Fragment> | ||
20 | <ComponentGroup Id="Components" Directory="INSTALLFOLDER"> | ||
21 | <Component> | ||
22 | <File Source="$(sys.SOURCEFILEPATH)" /> | ||
23 | </Component> | ||
24 | |||
25 | <Component> | ||
26 | <RegistryValue Root="HKLM" Key="SOFTWARE\!(bind.property.ProductName)\Patch" Name="Version" Value="$(var.V)" /> | ||
27 | </Component> | ||
28 | </ComponentGroup> | ||
29 | </Fragment> | ||
30 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/PatchFromWixlib/Patch.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/PatchFromWixlib/Patch.wxs new file mode 100644 index 00000000..52e87f64 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/PatchFromWixlib/Patch.wxs | |||
@@ -0,0 +1,16 @@ | |||
1 | <Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'> | ||
2 | <Patch | ||
3 | AllowRemoval="yes" | ||
4 | DisplayName="~Test Patch v$(var.V)" | ||
5 | Description="~Test Small Update Patch v$(var.V)" | ||
6 | MoreInfoURL="http://www.example.com/" | ||
7 | Manufacturer="Example Corporation" | ||
8 | Classification="Update"> | ||
9 | |||
10 | <Media Id="1" Cabinet="foo.cab"> | ||
11 | <PatchBaseline Id="RTM" BaselineFile="Baseline.wixpdb" UpdateFile="Update.wixpdb" /> | ||
12 | </Media> | ||
13 | |||
14 | <PatchFamily Id='SequenceFamily' Version='$(var.V)' /> | ||
15 | </Patch> | ||
16 | </Wix> | ||