diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-25 15:36:31 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-25 23:06:35 -0500 |
| commit | b4210b23ea28e0acc5a8b7ca5357d7d3926071b4 (patch) | |
| tree | 89f476f9469682691e771cf204e04f007d6cfebd /src/test/WixToolsetTest.CoreIntegration | |
| parent | 8b7545c2b692098957cc5737e92415bbe4f7823d (diff) | |
| download | wix-b4210b23ea28e0acc5a8b7ca5357d7d3926071b4.tar.gz wix-b4210b23ea28e0acc5a8b7ca5357d7d3926071b4.tar.bz2 wix-b4210b23ea28e0acc5a8b7ca5357d7d3926071b4.zip | |
Allow DownloadUrl on embedded payloads.
#5253
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs | 50 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/Container/HarvestIntoAttachedContainer.wxs | 17 |
2 files changed, 64 insertions, 3 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs index ff48ee05..dd381dfe 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs | |||
| @@ -15,6 +15,50 @@ namespace WixToolsetTest.CoreIntegration | |||
| 15 | 15 | ||
| 16 | public class ContainerFixture | 16 | public class ContainerFixture |
| 17 | { | 17 | { |
| 18 | [Fact(Skip = "Test demonstrates failure")] | ||
| 19 | public void CanBuildWithCustomAttachedContainer() | ||
| 20 | { | ||
| 21 | var folder = TestData.Get(@"TestData"); | ||
| 22 | |||
| 23 | using (var fs = new DisposableFileSystem()) | ||
| 24 | { | ||
| 25 | var baseFolder = fs.GetFolder(); | ||
| 26 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 27 | var binFolder = Path.Combine(baseFolder, "bin"); | ||
| 28 | var bundlePath = Path.Combine(binFolder, "test.exe"); | ||
| 29 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
| 30 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
| 31 | |||
| 32 | this.BuildMsis(folder, intermediateFolder, binFolder, buildToSubfolder: true); | ||
| 33 | |||
| 34 | var result = WixRunner.Execute(new[] | ||
| 35 | { | ||
| 36 | "build", | ||
| 37 | Path.Combine(folder, "Container", "HarvestIntoAttachedContainer.wxs"), | ||
| 38 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), | ||
| 39 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
| 40 | "-bindpath", binFolder, | ||
| 41 | "-intermediateFolder", intermediateFolder, | ||
| 42 | "-o", bundlePath | ||
| 43 | }); | ||
| 44 | |||
| 45 | result.AssertSuccess(); | ||
| 46 | |||
| 47 | Assert.True(File.Exists(bundlePath)); | ||
| 48 | |||
| 49 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | ||
| 50 | extractResult.AssertSuccess(); | ||
| 51 | |||
| 52 | var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload"); | ||
| 53 | Assert.Equal(4, payloads.Count); | ||
| 54 | var ignoreAttributes = new Dictionary<string, List<string>> { { "Payload", new List<string> { "FileSize", "Hash" } } }; | ||
| 55 | Assert.Equal(@"<Payload Id='FirstX64' FilePath='FirstX64\FirstX64.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com//FirstX64/FirstX64/FirstX64.msi' Packaging='embedded' SourcePath='a0' Container='BundlePackages' />", payloads[0].GetTestXml(ignoreAttributes)); | ||
| 56 | Assert.Equal(@"<Payload Id='FirstX86.msi' FilePath='FirstX86\FirstX86.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com//FirstX86.msi/FirstX86/FirstX86.msi' Packaging='embedded' SourcePath='a1' Container='BundlePackages' />", payloads[1].GetTestXml(ignoreAttributes)); | ||
| 57 | Assert.Equal(@"<Payload Id='fk1m38Cf9RZ2Bx_ipinRY6BftelU' FilePath='FirstX86\PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' DownloadUrl='http://example.com/FirstX86/fk1m38Cf9RZ2Bx_ipinRY6BftelU/FirstX86/PFiles/MsiPackage/test.txt' Packaging='embedded' SourcePath='a2' Container='BundlePackages' />", payloads[2].GetTestXml(ignoreAttributes)); | ||
| 58 | Assert.Equal(@"<Payload Id='ff2L_N_DLQ.nSUi.l8LxG14gd2V4' FilePath='FirstX64\PFiles\MsiPackage\test.txt' FileSize='*' Hash='*' DownloadUrl='http://example.com/FirstX64/ff2L_N_DLQ.nSUi.l8LxG14gd2V4/FirstX64/PFiles/MsiPackage/test.txt' Packaging='embedded' SourcePath='a3' Container='BundlePackages' />", payloads[3].GetTestXml(ignoreAttributes)); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 18 | [Fact] | 62 | [Fact] |
| 19 | public void HarvestedPayloadsArePutInCorrectContainer() | 63 | public void HarvestedPayloadsArePutInCorrectContainer() |
| 20 | { | 64 | { |
| @@ -309,7 +353,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 309 | } | 353 | } |
| 310 | } | 354 | } |
| 311 | 355 | ||
| 312 | private void BuildMsis(string folder, string intermediateFolder, string binFolder) | 356 | private void BuildMsis(string folder, string intermediateFolder, string binFolder, bool buildToSubfolder = false) |
| 313 | { | 357 | { |
| 314 | var result = WixRunner.Execute(new[] | 358 | var result = WixRunner.Execute(new[] |
| 315 | { | 359 | { |
| @@ -319,7 +363,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 319 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | 363 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), |
| 320 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | 364 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), |
| 321 | "-intermediateFolder", intermediateFolder, | 365 | "-intermediateFolder", intermediateFolder, |
| 322 | "-o", Path.Combine(binFolder, "FirstX86.msi"), | 366 | "-o", Path.Combine(binFolder, buildToSubfolder ? "FirstX86" : ".", "FirstX86.msi"), |
| 323 | }); | 367 | }); |
| 324 | 368 | ||
| 325 | result.AssertSuccess(); | 369 | result.AssertSuccess(); |
| @@ -332,7 +376,7 @@ namespace WixToolsetTest.CoreIntegration | |||
| 332 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | 376 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), |
| 333 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | 377 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), |
| 334 | "-intermediateFolder", intermediateFolder, | 378 | "-intermediateFolder", intermediateFolder, |
| 335 | "-o", Path.Combine(binFolder, "FirstX64.msi"), | 379 | "-o", Path.Combine(binFolder, buildToSubfolder ? "FirstX64" : ".", "FirstX64.msi"), |
| 336 | }); | 380 | }); |
| 337 | 381 | ||
| 338 | result.AssertSuccess(); | 382 | result.AssertSuccess(); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Container/HarvestIntoAttachedContainer.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Container/HarvestIntoAttachedContainer.wxs new file mode 100644 index 00000000..ec757c5d --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Container/HarvestIntoAttachedContainer.wxs | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Fragment> | ||
| 4 | <PackageGroup Id="BundlePackages"> | ||
| 5 | <MsiPackage Id="FirstX86"> | ||
| 6 | <PayloadGroupRef Id="FirstX86Payloads" /> | ||
| 7 | </MsiPackage> | ||
| 8 | <MsiPackage Id="FirstX64" Name="FirstX64\FirstX64.msi" SourceFile="FirstX64\" DownloadUrl="http://example.com/{0}/{1}/{2}" /> | ||
| 9 | </PackageGroup> | ||
| 10 | <Container Id="BundlePackages" Type="attached"> | ||
| 11 | <PackageGroupRef Id="BundlePackages" /> | ||
| 12 | </Container> | ||
| 13 | <PayloadGroup Id="FirstX86Payloads"> | ||
| 14 | <MsiPackagePayload Name="FirstX86\FirstX86.msi" SourceFile="FirstX86\" DownloadUrl="http://example.com/{0}/{1}/{2}" /> | ||
| 15 | </PayloadGroup> | ||
| 16 | </Fragment> | ||
| 17 | </Wix> | ||
