diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-24 17:00:13 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-25 23:06:35 -0500 |
commit | 8a957275b6a1185f3b74fb31fff258be7f628347 (patch) | |
tree | e59e314117a837665b14cdb8aebbd107d55fc4e2 | |
parent | 07bee0d033f1b4acb63e3da17764a3855503bce2 (diff) | |
download | wix-8a957275b6a1185f3b74fb31fff258be7f628347.tar.gz wix-8a957275b6a1185f3b74fb31fff258be7f628347.tar.bz2 wix-8a957275b6a1185f3b74fb31fff258be7f628347.zip |
Ignore Compressed attribute for payloads when authored into a container
#6406
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 | |||
169 | 169 | ||
170 | if (String.IsNullOrEmpty(payloadSymbol.ContainerRef)) | 170 | if (String.IsNullOrEmpty(payloadSymbol.ContainerRef)) |
171 | { | 171 | { |
172 | if (payloadSymbol.Compressed == false) | ||
173 | { | ||
174 | this.Messaging.Write(LinkerWarnings.UncompressedPayloadInContainer(payloadSymbol.SourceLineNumbers, groupSymbol.ChildId, containerId)); | ||
175 | } | ||
176 | |||
177 | payloadSymbol.Compressed = true; | ||
172 | payloadSymbol.ContainerRef = containerId; | 178 | payloadSymbol.ContainerRef = containerId; |
173 | } | 179 | } |
174 | else | 180 | 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 | |||
16 | 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); | 16 | 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); |
17 | } | 17 | } |
18 | 18 | ||
19 | public static Message UncompressedPayloadInContainer(SourceLineNumber sourceLineNumbers, string payloadId, string containerId) | ||
20 | { | ||
21 | return Message(sourceLineNumbers, Ids.UncompressedPayloadInContainer, "The Payload '{0}' is being added to Container '{1}', overriding its Compressed value of 'no'.", payloadId, containerId); | ||
22 | } | ||
23 | |||
19 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) | 24 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) |
20 | { | 25 | { |
21 | return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); | 26 | return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); |
@@ -25,6 +30,7 @@ namespace WixToolset.Core | |||
25 | { | 30 | { |
26 | LayoutPayloadInContainer = 6900, | 31 | LayoutPayloadInContainer = 6900, |
27 | PayloadInMultipleContainers = 6901, | 32 | PayloadInMultipleContainers = 6901, |
33 | UncompressedPayloadInContainer = 6902, | ||
28 | } // last available is 6999. 7000 is LinkerErrors. | 34 | } // last available is 6999. 7000 is LinkerErrors. |
29 | } | 35 | } |
30 | } | 36 | } |
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 | |||
157 | var baFolderPath = Path.Combine(baseFolder, "ba"); | 157 | var baFolderPath = Path.Combine(baseFolder, "ba"); |
158 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | 158 | var extractFolderPath = Path.Combine(baseFolder, "extract"); |
159 | 159 | ||
160 | var result = WixRunner.Execute(new[] | 160 | var result = WixRunner.Execute(false, new[] |
161 | { | 161 | { |
162 | "build", | 162 | "build", |
163 | Path.Combine(folder, "Payload", "DownloadUrlPlaceholdersBundle.wxs"), | 163 | Path.Combine(folder, "Payload", "DownloadUrlPlaceholdersBundle.wxs"), |
@@ -170,6 +170,11 @@ namespace WixToolsetTest.CoreIntegration | |||
170 | 170 | ||
171 | result.AssertSuccess(); | 171 | result.AssertSuccess(); |
172 | 172 | ||
173 | WixAssert.CompareLineByLine(new string[] | ||
174 | { | ||
175 | "The Payload 'burn.exe' is being added to Container 'PackagesContainer', overriding its Compressed value of 'no'.", | ||
176 | }, result.Messages.Select(m => m.ToString()).ToArray()); | ||
177 | |||
173 | Assert.True(File.Exists(bundlePath)); | 178 | Assert.True(File.Exists(bundlePath)); |
174 | 179 | ||
175 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 180 | 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 @@ | |||
14 | </Bundle> | 14 | </Bundle> |
15 | <Fragment> | 15 | <Fragment> |
16 | <PackageGroup Id="ContainerPackages"> | 16 | <PackageGroup Id="ContainerPackages"> |
17 | <ExePackage SourceFile="burn.exe" DetectCondition="none" /> | 17 | <ExePackage SourceFile="burn.exe" DetectCondition="none" Compressed="no" /> |
18 | </PackageGroup> | 18 | </PackageGroup> |
19 | </Fragment> | 19 | </Fragment> |
20 | <Fragment> | 20 | <Fragment> |