aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-10-22 16:42:25 -0700
committerRob Mensching <rob@firegiant.com>2022-10-22 23:45:28 -0700
commit28e9c7c14d2a156b55476f6b8e39e13f17aa87b6 (patch)
treeea397940bd9cf242d33ceff0768614062cff5720
parent5589a8081bbeb2f449339be23684e583b6df1c81 (diff)
downloadwix-28e9c7c14d2a156b55476f6b8e39e13f17aa87b6.tar.gz
wix-28e9c7c14d2a156b55476f6b8e39e13f17aa87b6.tar.bz2
wix-28e9c7c14d2a156b55476f6b8e39e13f17aa87b6.zip
Ensure BA container is only created once in Bundles
Fixes 6305
-rw-r--r--src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs8
-rw-r--r--src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs6
-rw-r--r--src/wix/WixToolset.Core/Compiler_Bundle.cs11
3 files changed, 19 insertions, 6 deletions
diff --git a/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
index 621be346..370364d1 100644
--- a/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
+++ b/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
@@ -676,10 +676,16 @@ namespace WixToolset.Core.Burn
676 { 676 {
677 var symbols = this.Output.Sections.Single().Symbols.OfType<T>().ToList(); 677 var symbols = this.Output.Sections.Single().Symbols.OfType<T>().ToList();
678 678
679 if (1 != symbols.Count) 679 if (0 == symbols.Count)
680 { 680 {
681 throw new WixException(ErrorMessages.MissingBundleInformation(elementName)); 681 throw new WixException(ErrorMessages.MissingBundleInformation(elementName));
682 } 682 }
683 else if (1 < symbols.Count)
684 {
685 // We'll show the first two source line collisions. If there are more than that, the user
686 // may have to build multiple times to find them all. This should be very rare.
687 throw new WixException(BurnBackendErrors.MultipleSingletonSymbolsFound(symbols[0].SourceLineNumbers, elementName, symbols[1].SourceLineNumbers));
688 }
683 689
684 return symbols[0]; 690 return symbols[0];
685 } 691 }
diff --git a/src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs b/src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs
index ee6fc0f8..c0e379ad 100644
--- a/src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs
+++ b/src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs
@@ -95,6 +95,11 @@ namespace WixToolset.Core.Burn
95 return Message(sourceLineNumbers, Ids.InvalidBundleManifest, "Unable to read bundle executable '{0}'. Its manifest is invalid. {1}", bundleExecutable, reason); 95 return Message(sourceLineNumbers, Ids.InvalidBundleManifest, "Unable to read bundle executable '{0}'. Its manifest is invalid. {1}", bundleExecutable, reason);
96 } 96 }
97 97
98 public static Message MultipleSingletonSymbolsFound(SourceLineNumber sourceLineNumbers, string friendlyName, SourceLineNumber collisionSourceLineNumbers)
99 {
100 return Message(sourceLineNumbers, Ids.MultipleSingletonSymbolsFound, "The Bundle requires a single {0}, but found another at: {1}", friendlyName, collisionSourceLineNumbers.ToString());
101 }
102
98 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) 103 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
99 { 104 {
100 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); 105 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
@@ -116,6 +121,7 @@ namespace WixToolset.Core.Burn
116 FailedToUpdateBundleResources = 8011, 121 FailedToUpdateBundleResources = 8011,
117 InvalidBundleManifest = 8012, 122 InvalidBundleManifest = 8012,
118 BundleMultipleProviders = 8013, 123 BundleMultipleProviders = 8013,
124 MultipleSingletonSymbolsFound = 8014,
119 } // last available is 8499. 8500 is BurnBackendWarnings. 125 } // last available is 8499. 8500 is BurnBackendWarnings.
120 } 126 }
121} 127}
diff --git a/src/wix/WixToolset.Core/Compiler_Bundle.cs b/src/wix/WixToolset.Core/Compiler_Bundle.cs
index d0911fe9..b9cf8e82 100644
--- a/src/wix/WixToolset.Core/Compiler_Bundle.cs
+++ b/src/wix/WixToolset.Core/Compiler_Bundle.cs
@@ -439,6 +439,12 @@ namespace WixToolset.Core
439 }); 439 });
440 } 440 }
441 441
442 this.Core.AddSymbol(new WixBundleContainerSymbol(sourceLineNumbers, Compiler.BurnUXContainerId)
443 {
444 Name = "bundle-ux.cab",
445 Type = ContainerType.Attached
446 });
447
442 this.Core.AddSymbol(new WixBundleContainerSymbol(sourceLineNumbers, Compiler.BurnDefaultAttachedContainerId) 448 this.Core.AddSymbol(new WixBundleContainerSymbol(sourceLineNumbers, Compiler.BurnDefaultAttachedContainerId)
443 { 449 {
444 Name = "bundle-attached.cab", 450 Name = "bundle-attached.cab",
@@ -773,11 +779,6 @@ namespace WixToolset.Core
773 if (!this.Core.EncounteredError) 779 if (!this.Core.EncounteredError)
774 { 780 {
775 compilerPayload.CreatePayloadSymbol(ComplexReferenceParentType.Container, Compiler.BurnUXContainerId.Id); 781 compilerPayload.CreatePayloadSymbol(ComplexReferenceParentType.Container, Compiler.BurnUXContainerId.Id);
776 this.Core.AddSymbol(new WixBundleContainerSymbol(sourceLineNumbers, Compiler.BurnUXContainerId)
777 {
778 Name = "bundle-ux.cab",
779 Type = ContainerType.Attached
780 });
781 782
782 this.Core.AddSymbol(new WixBootstrapperApplicationDllSymbol(sourceLineNumbers, compilerPayload.Id) 783 this.Core.AddSymbol(new WixBootstrapperApplicationDllSymbol(sourceLineNumbers, compilerPayload.Id)
783 { 784 {