diff options
5 files changed, 41 insertions, 8 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index b24481dc..83cc0a67 100644 --- a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | |||
@@ -452,7 +452,7 @@ namespace WixToolset.Core.Burn | |||
452 | WixBundleContainerSymbol uxContainer; | 452 | WixBundleContainerSymbol uxContainer; |
453 | IEnumerable<WixBundlePayloadSymbol> uxPayloads; | 453 | IEnumerable<WixBundlePayloadSymbol> uxPayloads; |
454 | { | 454 | { |
455 | var command = new CreateNonUXContainers(this.BackendHelper, section, bundleApplicationDllSymbol, containers.Values, payloadSymbols, this.IntermediateFolder, layoutDirectory, this.DefaultCompressionLevel); | 455 | var command = new CreateNonUXContainers(this.BackendHelper, this.Messaging, bundleApplicationDllSymbol, containers.Values, payloadSymbols, this.IntermediateFolder, layoutDirectory, this.DefaultCompressionLevel); |
456 | command.Execute(); | 456 | command.Execute(); |
457 | 457 | ||
458 | fileTransfers.AddRange(command.FileTransfers); | 458 | fileTransfers.AddRange(command.FileTransfers); |
@@ -462,6 +462,11 @@ namespace WixToolset.Core.Burn | |||
462 | uxPayloads = command.UXContainerPayloads; | 462 | uxPayloads = command.UXContainerPayloads; |
463 | } | 463 | } |
464 | 464 | ||
465 | if (this.Messaging.EncounteredError) | ||
466 | { | ||
467 | return; | ||
468 | } | ||
469 | |||
465 | // Resolve the download URLs now that we have all of the containers and payloads calculated. | 470 | // Resolve the download URLs now that we have all of the containers and payloads calculated. |
466 | { | 471 | { |
467 | var command = new ResolveDownloadUrlsCommand(this.Messaging, this.BackendExtensions, containers.Values, payloadSymbols); | 472 | var command = new ResolveDownloadUrlsCommand(this.Messaging, this.BackendExtensions, containers.Values, payloadSymbols); |
diff --git a/src/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs b/src/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs index 7b5984c0..f020ed84 100644 --- a/src/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs +++ b/src/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | namespace WixToolset.Core.Burn.Bundles | 3 | namespace WixToolset.Core.Burn.Bundles |
4 | { | 4 | { |
5 | using System; | ||
5 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
6 | using System.Diagnostics; | 7 | using System.Diagnostics; |
7 | using System.IO; | 8 | using System.IO; |
@@ -14,10 +15,10 @@ namespace WixToolset.Core.Burn.Bundles | |||
14 | 15 | ||
15 | internal class CreateNonUXContainers | 16 | internal class CreateNonUXContainers |
16 | { | 17 | { |
17 | public CreateNonUXContainers(IBackendHelper backendHelper, IntermediateSection section, WixBootstrapperApplicationDllSymbol bootstrapperApplicationDllSymbol, IEnumerable<WixBundleContainerSymbol> containerSymbols, Dictionary<string, WixBundlePayloadSymbol> payloadSymbols, string intermediateFolder, string layoutFolder, CompressionLevel? defaultCompressionLevel) | 18 | public CreateNonUXContainers(IBackendHelper backendHelper, IMessaging messaging, WixBootstrapperApplicationDllSymbol bootstrapperApplicationDllSymbol, IEnumerable<WixBundleContainerSymbol> containerSymbols, Dictionary<string, WixBundlePayloadSymbol> payloadSymbols, string intermediateFolder, string layoutFolder, CompressionLevel? defaultCompressionLevel) |
18 | { | 19 | { |
19 | this.BackendHelper = backendHelper; | 20 | this.BackendHelper = backendHelper; |
20 | this.Section = section; | 21 | this.Messaging = messaging; |
21 | this.BootstrapperApplicationDllSymbol = bootstrapperApplicationDllSymbol; | 22 | this.BootstrapperApplicationDllSymbol = bootstrapperApplicationDllSymbol; |
22 | this.Containers = containerSymbols; | 23 | this.Containers = containerSymbols; |
23 | this.PayloadSymbols = payloadSymbols; | 24 | this.PayloadSymbols = payloadSymbols; |
@@ -38,7 +39,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
38 | 39 | ||
39 | private IBackendHelper BackendHelper { get; } | 40 | private IBackendHelper BackendHelper { get; } |
40 | 41 | ||
41 | private IntermediateSection Section { get; } | 42 | private IMessaging Messaging { get; } |
42 | 43 | ||
43 | private WixBootstrapperApplicationDllSymbol BootstrapperApplicationDllSymbol { get; } | 44 | private WixBootstrapperApplicationDllSymbol BootstrapperApplicationDllSymbol { get; } |
44 | 45 | ||
@@ -70,7 +71,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
70 | { | 71 | { |
71 | if (containerId != BurnConstants.BurnDefaultAttachedContainerName) | 72 | if (containerId != BurnConstants.BurnDefaultAttachedContainerName) |
72 | { | 73 | { |
73 | // TODO: display warning that we're ignoring container that ended up with no paylods in it. | 74 | this.Messaging.Write(BurnBackendWarnings.EmptyContainer(container.SourceLineNumbers, containerId)); |
74 | } | 75 | } |
75 | } | 76 | } |
76 | else if (BurnConstants.BurnUXContainerName == containerId) | 77 | else if (BurnConstants.BurnUXContainerName == containerId) |
@@ -113,8 +114,22 @@ namespace WixToolset.Core.Burn.Bundles | |||
113 | container.AttachedContainerIndex = attachedContainerIndex; | 114 | container.AttachedContainerIndex = attachedContainerIndex; |
114 | ++attachedContainerIndex; | 115 | ++attachedContainerIndex; |
115 | } | 116 | } |
117 | } | ||
118 | } | ||
116 | 119 | ||
117 | this.CreateContainer(container, containerPayloads); | 120 | foreach (var container in this.Containers.Where(c => !String.IsNullOrEmpty(c.WorkingPath) && c.Id.Id != BurnConstants.BurnUXContainerName)) |
121 | { | ||
122 | if (container.Type == ContainerType.Attached && attachedContainerIndex > 2 && container.Id.Id != BurnConstants.BurnDefaultAttachedContainerName) | ||
123 | { | ||
124 | this.Messaging.Write(BurnBackendErrors.MultipleAttachedContainersUnsupported(container.SourceLineNumbers, container.Id.Id)); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | if (!this.Messaging.EncounteredError) | ||
129 | { | ||
130 | foreach (var container in this.Containers.Where(c => !String.IsNullOrEmpty(c.WorkingPath) && c.Id.Id != BurnConstants.BurnUXContainerName)) | ||
131 | { | ||
132 | this.CreateContainer(container, payloadsByContainer[container.Id.Id]); | ||
118 | trackedFiles.Add(this.BackendHelper.TrackFile(container.WorkingPath, TrackedFileType.Temporary, container.SourceLineNumbers)); | 133 | trackedFiles.Add(this.BackendHelper.TrackFile(container.WorkingPath, TrackedFileType.Temporary, container.SourceLineNumbers)); |
119 | } | 134 | } |
120 | } | 135 | } |
diff --git a/src/WixToolset.Core.Burn/BurnBackendErrors.cs b/src/WixToolset.Core.Burn/BurnBackendErrors.cs index 6f9a3706..f23db47d 100644 --- a/src/WixToolset.Core.Burn/BurnBackendErrors.cs +++ b/src/WixToolset.Core.Burn/BurnBackendErrors.cs | |||
@@ -36,6 +36,11 @@ namespace WixToolset.Core.Burn | |||
36 | return Message(sourceLineNumbers, Ids.ExternalPayloadCollision2, "The location of the symbol related to the previous error."); | 36 | return Message(sourceLineNumbers, Ids.ExternalPayloadCollision2, "The location of the symbol related to the previous error."); |
37 | } | 37 | } |
38 | 38 | ||
39 | public static Message MultipleAttachedContainersUnsupported(SourceLineNumber sourceLineNumbers, string containerId) | ||
40 | { | ||
41 | return Message(sourceLineNumbers, Ids.MultipleAttachedContainersUnsupported, "Bundles don't currently support having more than one attached container. Either remove all authored attached containers to use the default attached container, or make sure all compressed payloads are included in this Container '{0}'.", containerId); | ||
42 | } | ||
43 | |||
39 | public static Message PackageCachePayloadCollision(SourceLineNumber sourceLineNumbers, string payloadId, string payloadName, string packageId) | 44 | public static Message PackageCachePayloadCollision(SourceLineNumber sourceLineNumbers, string payloadId, string payloadName, string packageId) |
40 | { | 45 | { |
41 | return Message(sourceLineNumbers, Ids.PackageCachePayloadCollision, "The Payload '{0}' has a duplicate Name '{1}' in package '{2}'. When caching the package, the file will get overwritten.", payloadId, payloadName, packageId); | 46 | return Message(sourceLineNumbers, Ids.PackageCachePayloadCollision, "The Payload '{0}' has a duplicate Name '{1}' in package '{2}'. When caching the package, the file will get overwritten.", payloadId, payloadName, packageId); |
@@ -61,6 +66,7 @@ namespace WixToolset.Core.Burn | |||
61 | ExternalPayloadCollision2 = 8005, | 66 | ExternalPayloadCollision2 = 8005, |
62 | PackageCachePayloadCollision = 8006, | 67 | PackageCachePayloadCollision = 8006, |
63 | PackageCachePayloadCollision2 = 8007, | 68 | PackageCachePayloadCollision2 = 8007, |
69 | MultipleAttachedContainersUnsupported = 8008, | ||
64 | } | 70 | } |
65 | } | 71 | } |
66 | } | 72 | } |
diff --git a/src/WixToolset.Core.Burn/BurnBackendWarnings.cs b/src/WixToolset.Core.Burn/BurnBackendWarnings.cs index cbbc954e..5edbbd67 100644 --- a/src/WixToolset.Core.Burn/BurnBackendWarnings.cs +++ b/src/WixToolset.Core.Burn/BurnBackendWarnings.cs | |||
@@ -16,6 +16,11 @@ namespace WixToolset.Core.Burn | |||
16 | return Message(sourceLineNumbers, Ids.AttachedContainerPayloadCollision2, "The location of the payload related to the previous error."); | 16 | return Message(sourceLineNumbers, Ids.AttachedContainerPayloadCollision2, "The location of the payload related to the previous error."); |
17 | } | 17 | } |
18 | 18 | ||
19 | public static Message EmptyContainer(SourceLineNumber sourceLineNumbers, string containerId) | ||
20 | { | ||
21 | return Message(sourceLineNumbers, Ids.EmptyContainer, "The Container '{0}' is being ignored because it doesn't have any payloads.", 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.Burn | |||
25 | { | 30 | { |
26 | AttachedContainerPayloadCollision = 8500, | 31 | AttachedContainerPayloadCollision = 8500, |
27 | AttachedContainerPayloadCollision2 = 8501, | 32 | AttachedContainerPayloadCollision2 = 8501, |
33 | EmptyContainer = 8502, | ||
28 | } | 34 | } |
29 | } | 35 | } |
30 | } | 36 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs index e3dda59d..43fa3f55 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ContainerFixture.cs | |||
@@ -8,6 +8,7 @@ namespace WixToolsetTest.CoreIntegration | |||
8 | using System.Linq; | 8 | using System.Linq; |
9 | using System.Xml; | 9 | using System.Xml; |
10 | using WixBuildTools.TestSupport; | 10 | using WixBuildTools.TestSupport; |
11 | using WixToolset.Core.Burn; | ||
11 | using WixToolset.Core.TestPackage; | 12 | using WixToolset.Core.TestPackage; |
12 | using WixToolset.Data; | 13 | using WixToolset.Data; |
13 | using WixToolset.Data.Symbols; | 14 | using WixToolset.Data.Symbols; |
@@ -155,7 +156,7 @@ namespace WixToolsetTest.CoreIntegration | |||
155 | } | 156 | } |
156 | } | 157 | } |
157 | 158 | ||
158 | [Fact(Skip = "https://github.com/wixtoolset/issues/issues/6144")] | 159 | [Fact] |
159 | public void MultipleAttachedContainersAreNotCurrentlySupported() | 160 | public void MultipleAttachedContainersAreNotCurrentlySupported() |
160 | { | 161 | { |
161 | var folder = TestData.Get(@"TestData"); | 162 | var folder = TestData.Get(@"TestData"); |
@@ -206,7 +207,7 @@ namespace WixToolsetTest.CoreIntegration | |||
206 | "-o", bundlePath | 207 | "-o", bundlePath |
207 | }); | 208 | }); |
208 | 209 | ||
209 | Assert.InRange(result.ExitCode, 2, Int32.MaxValue); | 210 | Assert.Equal((int)BurnBackendErrors.Ids.MultipleAttachedContainersUnsupported, result.ExitCode); |
210 | } | 211 | } |
211 | } | 212 | } |
212 | } | 213 | } |