aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2020-04-23 08:33:03 +1000
committerSean Hall <r.sean.hall@gmail.com>2020-04-23 12:39:32 +1000
commit2d23530fde970972c927680ee3df6466538ae8ca (patch)
treedcca3de75b1f935cde4f396ff60e6df8c8969c1c /src
parent961ccec685eb5dd34202b8edbf7f4e67910998aa (diff)
downloadwix-2d23530fde970972c927680ee3df6466538ae8ca.tar.gz
wix-2d23530fde970972c927680ee3df6466538ae8ca.tar.bz2
wix-2d23530fde970972c927680ee3df6466538ae8ca.zip
Add and fix some bundle tests.
Diffstat (limited to 'src')
-rw-r--r--src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs4
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs59
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/SingleExeBundle/SingleExePackageGroup.wxs8
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/TestData/SingleExeBundle/SingleExeRemotePayload.wxs31
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj2
5 files changed, 102 insertions, 2 deletions
diff --git a/src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs b/src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs
index d0c1fdfc..42b1b5ab 100644
--- a/src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs
+++ b/src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs
@@ -56,7 +56,7 @@ namespace WixToolset.Core.Burn.Bundles
56 // Embedded files (aka: files from binary .wixlibs) are not content files (because they are hidden 56 // Embedded files (aka: files from binary .wixlibs) are not content files (because they are hidden
57 // in the .wixlib). 57 // in the .wixlib).
58 var sourceFile = payload.SourceFile; 58 var sourceFile = payload.SourceFile;
59 payload.ContentFile = !sourceFile.Embed; 59 payload.ContentFile = sourceFile != null && !sourceFile.Embed;
60 60
61 this.UpdatePayloadPackagingType(payload); 61 this.UpdatePayloadPackagingType(payload);
62 62
@@ -85,7 +85,7 @@ namespace WixToolset.Core.Burn.Bundles
85 85
86 private void UpdatePayloadPackagingType(WixBundlePayloadTuple payload) 86 private void UpdatePayloadPackagingType(WixBundlePayloadTuple payload)
87 { 87 {
88 if (PackagingType.Unknown == payload.Packaging) 88 if (!payload.Packaging.HasValue || PackagingType.Unknown == payload.Packaging)
89 { 89 {
90 if (!payload.Compressed.HasValue) 90 if (!payload.Compressed.HasValue)
91 { 91 {
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
index 31cfed34..6e66aa74 100644
--- a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
+++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs
@@ -140,5 +140,64 @@ namespace WixToolsetTest.CoreIntegration
140 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); 140 Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb")));
141 } 141 }
142 } 142 }
143
144 [Fact]
145 public void CanBuildSingleExeBundle()
146 {
147 var burnStubPath = TestData.Get(@"TestData\.Data\burn.exe");
148 var folder = TestData.Get(@"TestData");
149
150 using (var fs = new DisposableFileSystem())
151 {
152 var baseFolder = fs.GetFolder();
153 var intermediateFolder = Path.Combine(baseFolder, "obj");
154 var exePath = Path.Combine(baseFolder, @"bin\test.exe");
155
156 var result = WixRunner.Execute(new[]
157 {
158 "build",
159 Path.Combine(folder, "SingleExeBundle", "SingleExePackageGroup.wxs"),
160 Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
161 "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
162 "-bindpath", Path.Combine(folder, ".Data"),
163 "-intermediateFolder", intermediateFolder,
164 "-burnStub", burnStubPath,
165 "-o", exePath,
166 });
167
168 result.AssertSuccess();
169
170 Assert.True(File.Exists(exePath));
171 }
172 }
173
174 [Fact]
175 public void CanBuildSingleExeRemotePayloadBundle()
176 {
177 var burnStubPath = TestData.Get(@"TestData\.Data\burn.exe");
178 var folder = TestData.Get(@"TestData");
179
180 using (var fs = new DisposableFileSystem())
181 {
182 var baseFolder = fs.GetFolder();
183 var intermediateFolder = Path.Combine(baseFolder, "obj");
184 var exePath = Path.Combine(baseFolder, @"bin\test.exe");
185
186 var result = WixRunner.Execute(new[]
187 {
188 "build",
189 Path.Combine(folder, "SingleExeBundle", "SingleExeRemotePayload.wxs"),
190 Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"),
191 "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
192 "-intermediateFolder", intermediateFolder,
193 "-burnStub", burnStubPath,
194 "-o", exePath,
195 });
196
197 result.AssertSuccess();
198
199 Assert.True(File.Exists(exePath));
200 }
201 }
143 } 202 }
144} 203}
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleExeBundle/SingleExePackageGroup.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleExeBundle/SingleExePackageGroup.wxs
new file mode 100644
index 00000000..9d7a9511
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleExeBundle/SingleExePackageGroup.wxs
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Fragment>
4 <PackageGroup Id="BundlePackages">
5 <ExePackage SourceFile="burn.exe" />
6 </PackageGroup>
7 </Fragment>
8</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SingleExeBundle/SingleExeRemotePayload.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleExeBundle/SingleExeRemotePayload.wxs
new file mode 100644
index 00000000..709dc9e7
--- /dev/null
+++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SingleExeBundle/SingleExeRemotePayload.wxs
@@ -0,0 +1,31 @@
1<?xml version="1.0" encoding="utf-8"?>
2<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
3 <Fragment>
4 <PackageGroup Id="BundlePackages">
5 <ExePackage
6 InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx462FullLog].html&quot;"
7 RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx462FullLog].html&quot;"
8 UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx462FullLog].html&quot;"
9 PerMachine="yes"
10 DetectCondition="A"
11 InstallCondition="B"
12 Id="NetFx462Web"
13 Vital="yes"
14 Permanent="yes"
15 Protocol="netfx4"
16 DownloadUrl="C"
17 LogPathVariable="NetFx462FullLog"
18 Compressed="no"
19 Name="NDP462-KB3151802-Web.exe">
20 <RemotePayload
21 CertificatePublicKey="52868DFCA6E3AF2632389E6C1EE7D0468D3797D0"
22 CertificateThumbprint="3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC"
23 Description="Microsoft .NET Framework 4.6.2 Setup"
24 Hash="C42E6ED280290648BBD59F664008852F4CFE4548"
25 ProductName="Microsoft .NET Framework 4.6.2"
26 Size="1429344"
27 Version="4.6.1590.0" />
28 </ExePackage>
29 </PackageGroup>
30 </Fragment>
31</Wix>
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
index 13611770..60cbde85 100644
--- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
@@ -117,6 +117,8 @@
117 <Content Include="TestData\SimpleBundle\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" /> 117 <Content Include="TestData\SimpleBundle\Bundle.wxs" CopyToOutputDirectory="PreserveNewest" />
118 <Content Include="TestData\SimpleBundle\MultiFileBootstrapperApplication.wxs" CopyToOutputDirectory="PreserveNewest" /> 118 <Content Include="TestData\SimpleBundle\MultiFileBootstrapperApplication.wxs" CopyToOutputDirectory="PreserveNewest" />
119 <Content Include="TestData\SimpleBundle\MultiFileBundle.wxs" CopyToOutputDirectory="PreserveNewest" /> 119 <Content Include="TestData\SimpleBundle\MultiFileBundle.wxs" CopyToOutputDirectory="PreserveNewest" />
120 <Content Include="TestData\SingleExeBundle\SingleExePackageGroup.wxs" CopyToOutputDirectory="PreserveNewest" />
121 <Content Include="TestData\SingleExeBundle\SingleExeRemotePayload.wxs" CopyToOutputDirectory="PreserveNewest" />
120 <Content Include="TestData\SingleFile\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> 122 <Content Include="TestData\SingleFile\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
121 <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> 123 <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" />
122 <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> 124 <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" />