diff options
author | Rob Mensching <rob@firegiant.com> | 2022-01-02 13:13:32 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2022-01-02 23:48:48 -0800 |
commit | 045eecc36260bfd9d184aedd4a6dc2ec0c5e9b1d (patch) | |
tree | d81d8a1be4a6f6de6348ba24ba0b071ac898eb3c | |
parent | 9e3d7c0c4c7000ef51c2959b4e04c2323d1dac31 (diff) | |
download | wix-045eecc36260bfd9d184aedd4a6dc2ec0c5e9b1d.tar.gz wix-045eecc36260bfd9d184aedd4a6dc2ec0c5e9b1d.tar.bz2 wix-045eecc36260bfd9d184aedd4a6dc2ec0c5e9b1d.zip |
Ensure external bundle payloads and containers are copied to output
6 files changed, 63 insertions, 13 deletions
diff --git a/src/test/burn/TestData/LayoutTests/BundleA/BundleA.wixproj b/src/test/burn/TestData/LayoutTests/BundleA/BundleA.wixproj index 3b1e871c..5796178b 100644 --- a/src/test/burn/TestData/LayoutTests/BundleA/BundleA.wixproj +++ b/src/test/burn/TestData/LayoutTests/BundleA/BundleA.wixproj | |||
@@ -12,12 +12,4 @@ | |||
12 | <PackageReference Include="WixToolset.Bal.wixext" /> | 12 | <PackageReference Include="WixToolset.Bal.wixext" /> |
13 | <PackageReference Include="WixToolset.NetFx.wixext" /> | 13 | <PackageReference Include="WixToolset.NetFx.wixext" /> |
14 | </ItemGroup> | 14 | </ItemGroup> |
15 | <!-- Workaround wix.targets brokenness --> | ||
16 | <Target Name="CopyUncompressedFiles" AfterTargets="AfterBuild"> | ||
17 | <ItemGroup> | ||
18 | <UncompressedFiles Include="$(IntermediateOutputPath)\BundleA.wxs" /> | ||
19 | <UncompressedFiles Include="$(IntermediateOutputPath)\packages.cab" /> | ||
20 | </ItemGroup> | ||
21 | <Copy SourceFiles="@(UncompressedFiles)" DestinationFolder="$(OutputPath)" /> | ||
22 | </Target> | ||
23 | </Project> \ No newline at end of file | 15 | </Project> \ No newline at end of file |
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs b/src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs index 9cddfc35..e606fe59 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs | |||
@@ -104,8 +104,11 @@ namespace WixToolset.Core.Burn.Bundles | |||
104 | // Add detached containers to the list of file transfers. | 104 | // Add detached containers to the list of file transfers. |
105 | if (ContainerType.Detached == container.Type) | 105 | if (ContainerType.Detached == container.Type) |
106 | { | 106 | { |
107 | var transfer = this.BackendHelper.CreateFileTransfer(container.WorkingPath, Path.Combine(this.LayoutFolder, container.Name), true, container.SourceLineNumbers); | 107 | var outputPath = Path.Combine(this.LayoutFolder, container.Name); |
108 | var transfer = this.BackendHelper.CreateFileTransfer(container.WorkingPath, outputPath, true, container.SourceLineNumbers); | ||
108 | fileTransfers.Add(transfer); | 109 | fileTransfers.Add(transfer); |
110 | |||
111 | trackedFiles.Add(this.BackendHelper.TrackFile(outputPath, TrackedFileType.BuiltOutput, container.SourceLineNumbers)); | ||
109 | } | 112 | } |
110 | else // update the attached container index. | 113 | else // update the attached container index. |
111 | { | 114 | { |
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs index 92fe86f2..3bd1f938 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs | |||
@@ -77,8 +77,12 @@ namespace WixToolset.Core.Burn.Bundles | |||
77 | // External payloads need to be transfered. | 77 | // External payloads need to be transfered. |
78 | if (PackagingType.External == payload.Packaging) | 78 | if (PackagingType.External == payload.Packaging) |
79 | { | 79 | { |
80 | var transfer = this.BackendHelper.CreateFileTransfer(sourceFile.Path, Path.Combine(this.LayoutDirectory, payload.Name), false, payload.SourceLineNumbers); | 80 | var outputPath = Path.Combine(this.LayoutDirectory, payload.Name); |
81 | |||
82 | var transfer = this.BackendHelper.CreateFileTransfer(sourceFile.Path, outputPath, false, payload.SourceLineNumbers); | ||
81 | fileTransfers.Add(transfer); | 83 | fileTransfers.Add(transfer); |
84 | |||
85 | trackedFiles.Add(this.BackendHelper.TrackFile(outputPath, TrackedFileType.CopiedOutput, payload.SourceLineNumbers)); | ||
82 | } | 86 | } |
83 | 87 | ||
84 | if (payload.ContentFile) | 88 | if (payload.ContentFile) |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index 10d9a39a..601503ab 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |||
@@ -292,6 +292,46 @@ namespace WixToolsetTest.CoreIntegration | |||
292 | } | 292 | } |
293 | 293 | ||
294 | [Fact] | 294 | [Fact] |
295 | public void CanBuildUncompressedBundle() | ||
296 | { | ||
297 | var folder = TestData.Get(@"TestData") + Path.DirectorySeparatorChar; | ||
298 | |||
299 | using (var fs = new DisposableFileSystem()) | ||
300 | { | ||
301 | var baseFolder = fs.GetFolder() + Path.DirectorySeparatorChar; | ||
302 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
303 | var exePath = Path.Combine(baseFolder, @"bin\test.exe"); | ||
304 | var trackingFile = Path.Combine(intermediateFolder, "trackingFile.txt"); | ||
305 | |||
306 | var result = WixRunner.Execute(new[] | ||
307 | { | ||
308 | "build", | ||
309 | Path.Combine(folder, "BundleUncompressed", "UncompressedBundle.wxs"), | ||
310 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
311 | "-bindpath", Path.Combine(folder, ".Data"), | ||
312 | "-intermediateFolder", intermediateFolder, | ||
313 | "-o", exePath, | ||
314 | "-trackingFile", trackingFile | ||
315 | }); | ||
316 | |||
317 | result.AssertSuccess(); | ||
318 | |||
319 | Assert.True(File.Exists(exePath)); | ||
320 | Assert.True(File.Exists(Path.Combine(Path.GetDirectoryName(exePath), "test.txt"))); | ||
321 | |||
322 | var trackedLines = File.ReadAllLines(trackingFile).Select(s => s.Replace(baseFolder, null, StringComparison.OrdinalIgnoreCase).Replace(folder, null, StringComparison.OrdinalIgnoreCase)).ToArray(); | ||
323 | WixAssert.CompareLineByLine(new[] | ||
324 | { | ||
325 | "BuiltOutput\tbin\\test.exe", | ||
326 | "BuiltOutput\tbin\\test.wixpdb", | ||
327 | "CopiedOutput\tbin\\test.txt", | ||
328 | "Input\tSimpleBundle\\data\\fakeba.dll", | ||
329 | "Input\tSimpleBundle\\data\\MsiPackage\\test.txt" | ||
330 | }, trackedLines); | ||
331 | } | ||
332 | } | ||
333 | |||
334 | [Fact] | ||
295 | public void CantBuildWithDuplicateCacheIds() | 335 | public void CantBuildWithDuplicateCacheIds() |
296 | { | 336 | { |
297 | var folder = TestData.Get(@"TestData"); | 337 | var folder = TestData.Get(@"TestData"); |
diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleUncompressed/UncompressedBundle.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleUncompressed/UncompressedBundle.wxs new file mode 100644 index 00000000..a9d09ede --- /dev/null +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleUncompressed/UncompressedBundle.wxs | |||
@@ -0,0 +1,11 @@ | |||
1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
2 | <Bundle Name="BurnBundle" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="B94478B1-E1F3-4700-9CE8-6AA090854AEC" Compressed="no"> | ||
3 | <BootstrapperApplication> | ||
4 | <BootstrapperApplicationDll SourceFile="fakeba.dll" /> | ||
5 | </BootstrapperApplication> | ||
6 | |||
7 | <Chain> | ||
8 | <ExePackage Permanent="yes" DetectCondition="none" SourceFile="MsiPackage\test.txt" /> | ||
9 | </Chain> | ||
10 | </Bundle> | ||
11 | </Wix> | ||
diff --git a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs index b3d25406..b1a97644 100644 --- a/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs +++ b/src/wix/test/WixToolsetTest.Sdk/MsbuildFixture.cs | |||
@@ -44,7 +44,7 @@ namespace WixToolsetTest.Sdk | |||
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | [Theory(Skip = "https://github.com/wixtoolset/issues/issues/6407")] | 47 | [Theory] |
48 | [InlineData(BuildSystem.DotNetCoreSdk)] | 48 | [InlineData(BuildSystem.DotNetCoreSdk)] |
49 | [InlineData(BuildSystem.MSBuild)] | 49 | [InlineData(BuildSystem.MSBuild)] |
50 | [InlineData(BuildSystem.MSBuild64)] | 50 | [InlineData(BuildSystem.MSBuild64)] |
@@ -71,9 +71,9 @@ namespace WixToolsetTest.Sdk | |||
71 | .ToArray(); | 71 | .ToArray(); |
72 | WixAssert.CompareLineByLine(new[] | 72 | WixAssert.CompareLineByLine(new[] |
73 | { | 73 | { |
74 | @"bin\x86\Release\SimpleBundle.exe", | ||
75 | @"bin\x86\Release\SimpleBundle.wixpdb", | ||
76 | @"bin\x86\Release\test.txt", | 74 | @"bin\x86\Release\test.txt", |
75 | @"bin\x86\Release\UncompressedBundle.exe", | ||
76 | @"bin\x86\Release\UncompressedBundle.wixpdb", | ||
77 | }, paths); | 77 | }, paths); |
78 | } | 78 | } |
79 | } | 79 | } |