diff options
| author | Rob Mensching <rob@firegiant.com> | 2022-03-14 11:13:11 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2022-03-14 12:50:55 -0700 |
| commit | 2449385e7c649821907a745d3859137977b3e78a (patch) | |
| tree | 10cdf07b060c9db02bc429159035a03f729cc42f /src | |
| parent | 2a702f736a907febdd03b493437f0bad3f6732af (diff) | |
| download | wix-2449385e7c649821907a745d3859137977b3e78a.tar.gz wix-2449385e7c649821907a745d3859137977b3e78a.tar.bz2 wix-2449385e7c649821907a745d3859137977b3e78a.zip | |
Support containers in relative subfolders
Fixes 5677
Diffstat (limited to 'src')
3 files changed, 45 insertions, 1 deletions
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs index 87a63cc3..f7db6c00 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/CreateContainerCommand.cs | |||
| @@ -45,6 +45,9 @@ namespace WixToolset.Core.Burn.Bundles | |||
| 45 | public void Execute() | 45 | public void Execute() |
| 46 | { | 46 | { |
| 47 | var cabinetPath = Path.GetFullPath(this.OutputPath); | 47 | var cabinetPath = Path.GetFullPath(this.OutputPath); |
| 48 | var cabinetFolder = Path.GetDirectoryName(cabinetPath); | ||
| 49 | |||
| 50 | Directory.CreateDirectory(cabinetFolder); | ||
| 48 | 51 | ||
| 49 | var files = new List<CabinetCompressFile>(); | 52 | var files = new List<CabinetCompressFile>(); |
| 50 | 53 | ||
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index 77b122da..4ac9c3a4 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |||
| @@ -8,9 +8,9 @@ namespace WixToolsetTest.CoreIntegration | |||
| 8 | using System.Linq; | 8 | using System.Linq; |
| 9 | using System.Text; | 9 | using System.Text; |
| 10 | using System.Xml; | 10 | using System.Xml; |
| 11 | using System.Xml.Linq; | ||
| 11 | using Example.Extension; | 12 | using Example.Extension; |
| 12 | using WixBuildTools.TestSupport; | 13 | using WixBuildTools.TestSupport; |
| 13 | using WixToolset.Core; | ||
| 14 | using WixToolset.Core.Burn; | 14 | using WixToolset.Core.Burn; |
| 15 | using WixToolset.Core.TestPackage; | 15 | using WixToolset.Core.TestPackage; |
| 16 | using WixToolset.Data; | 16 | using WixToolset.Data; |
| @@ -530,6 +530,35 @@ namespace WixToolsetTest.CoreIntegration | |||
| 530 | } | 530 | } |
| 531 | 531 | ||
| 532 | [Fact] | 532 | [Fact] |
| 533 | public void CantBuildWithSubfolderContainer() | ||
| 534 | { | ||
| 535 | var folder = TestData.Get(@"TestData"); | ||
| 536 | |||
| 537 | using (var fs = new DisposableFileSystem()) | ||
| 538 | { | ||
| 539 | var baseFolder = fs.GetFolder(); | ||
| 540 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 541 | var exePath = Path.Combine(baseFolder, @"bin", "test.exe"); | ||
| 542 | var containerPath = Path.Combine(baseFolder, "bin", "Data", "c1"); | ||
| 543 | |||
| 544 | var result = WixRunner.Execute(new[] | ||
| 545 | { | ||
| 546 | "build", | ||
| 547 | Path.Combine(folder, "Bundle", "SubfolderContainer.wxs"), | ||
| 548 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), | ||
| 549 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
| 550 | "-bindpath", Path.Combine(folder, ".Data"), | ||
| 551 | "-intermediateFolder", intermediateFolder, | ||
| 552 | "-o", exePath, | ||
| 553 | }); | ||
| 554 | |||
| 555 | result.AssertSuccess(); | ||
| 556 | |||
| 557 | Assert.True(File.Exists(containerPath), $"Failed to find external container: {containerPath}"); | ||
| 558 | } | ||
| 559 | } | ||
| 560 | |||
| 561 | [Fact] | ||
| 533 | public void CantBuildWithUnscheduledPackage() | 562 | public void CantBuildWithUnscheduledPackage() |
| 534 | { | 563 | { |
| 535 | var folder = TestData.Get(@"TestData"); | 564 | var folder = TestData.Get(@"TestData"); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Bundle/SubfolderContainer.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Bundle/SubfolderContainer.wxs new file mode 100644 index 00000000..abb34533 --- /dev/null +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Bundle/SubfolderContainer.wxs | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Fragment> | ||
| 4 | <Container Name="Data\c1"> | ||
| 5 | <PackageGroupRef Id="BundlePackages" /> | ||
| 6 | </Container> | ||
| 7 | |||
| 8 | <PackageGroup Id="BundlePackages"> | ||
| 9 | <MsiPackage SourceFile="test.msi" /> | ||
| 10 | </PackageGroup> | ||
| 11 | </Fragment> | ||
| 12 | </Wix> | ||
