From 8a957275b6a1185f3b74fb31fff258be7f628347 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 24 Apr 2021 17:00:13 -0500 Subject: Ignore Compressed attribute for payloads when authored into a container #6406 --- src/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs | 6 ++++++ src/WixToolset.Core/LinkerWarnings.cs | 6 ++++++ src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs | 7 ++++++- .../TestData/Payload/DownloadUrlPlaceholdersBundle.wxs | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs b/src/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs index 52734141..16593c7d 100644 --- a/src/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs +++ b/src/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs @@ -169,6 +169,12 @@ namespace WixToolset.Core.Link if (String.IsNullOrEmpty(payloadSymbol.ContainerRef)) { + if (payloadSymbol.Compressed == false) + { + this.Messaging.Write(LinkerWarnings.UncompressedPayloadInContainer(payloadSymbol.SourceLineNumbers, groupSymbol.ChildId, containerId)); + } + + payloadSymbol.Compressed = true; payloadSymbol.ContainerRef = containerId; } else diff --git a/src/WixToolset.Core/LinkerWarnings.cs b/src/WixToolset.Core/LinkerWarnings.cs index 0eca090e..968fa4ea 100644 --- a/src/WixToolset.Core/LinkerWarnings.cs +++ b/src/WixToolset.Core/LinkerWarnings.cs @@ -16,6 +16,11 @@ namespace WixToolset.Core return Message(sourceLineNumbers, Ids.PayloadInMultipleContainers, "The Payload '{0}' can't be added to Container '{1}' because it was already added to Container '{2}'.", payloadId, containerId1, containerId2); } + public static Message UncompressedPayloadInContainer(SourceLineNumber sourceLineNumbers, string payloadId, string containerId) + { + return Message(sourceLineNumbers, Ids.UncompressedPayloadInContainer, "The Payload '{0}' is being added to Container '{1}', overriding its Compressed value of 'no'.", payloadId, containerId); + } + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) { return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); @@ -25,6 +30,7 @@ namespace WixToolset.Core { LayoutPayloadInContainer = 6900, PayloadInMultipleContainers = 6901, + UncompressedPayloadInContainer = 6902, } // last available is 6999. 7000 is LinkerErrors. } } diff --git a/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs index da87bf6c..23f6a9ba 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs @@ -157,7 +157,7 @@ namespace WixToolsetTest.CoreIntegration var baFolderPath = Path.Combine(baseFolder, "ba"); var extractFolderPath = Path.Combine(baseFolder, "extract"); - var result = WixRunner.Execute(new[] + var result = WixRunner.Execute(false, new[] { "build", Path.Combine(folder, "Payload", "DownloadUrlPlaceholdersBundle.wxs"), @@ -170,6 +170,11 @@ namespace WixToolsetTest.CoreIntegration result.AssertSuccess(); + WixAssert.CompareLineByLine(new string[] + { + "The Payload 'burn.exe' is being added to Container 'PackagesContainer', overriding its Compressed value of 'no'.", + }, result.Messages.Select(m => m.ToString()).ToArray()); + Assert.True(File.Exists(bundlePath)); var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Payload/DownloadUrlPlaceholdersBundle.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Payload/DownloadUrlPlaceholdersBundle.wxs index 87bb79f9..f8f38ea6 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/Payload/DownloadUrlPlaceholdersBundle.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Payload/DownloadUrlPlaceholdersBundle.wxs @@ -14,7 +14,7 @@ - + -- cgit v1.2.3-55-g6feb