aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs')
-rw-r--r--src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
index 5ddb6be1..37fc17f9 100644
--- a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
+++ b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
@@ -359,7 +359,6 @@ namespace WixToolset.Core.Burn
359 this.BackendHelper.ResolveDelayedFields(this.DelayedFields, variableCache); 359 this.BackendHelper.ResolveDelayedFields(this.DelayedFields, variableCache);
360 } 360 }
361 361
362 Dictionary<string, WixDependencyProviderSymbol> dependencySymbolsByKey;
363 { 362 {
364 var command = new ProcessDependencyProvidersCommand(this.Messaging, section, facades); 363 var command = new ProcessDependencyProvidersCommand(this.Messaging, section, facades);
365 command.Execute(); 364 command.Execute();
@@ -368,7 +367,6 @@ namespace WixToolset.Core.Burn
368 { 367 {
369 bundleSymbol.ProviderKey = command.BundleProviderKey; // set the overridable bundle provider key. 368 bundleSymbol.ProviderKey = command.BundleProviderKey; // set the overridable bundle provider key.
370 } 369 }
371 dependencySymbolsByKey = command.DependencySymbolsByKey;
372 } 370 }
373 371
374 // Update the bundle per-machine/per-user scope based on the chained packages. 372 // Update the bundle per-machine/per-user scope based on the chained packages.
@@ -381,6 +379,13 @@ namespace WixToolset.Core.Burn
381 command.Execute(); 379 command.Execute();
382 } 380 }
383 381
382 this.DetectDuplicateCacheIds(facades);
383
384 if (this.Messaging.EncounteredError)
385 {
386 return;
387 }
388
384 // Give the extension one last hook before generating the output files. 389 // Give the extension one last hook before generating the output files.
385 foreach (var extension in this.BackendExtensions) 390 foreach (var extension in this.BackendExtensions)
386 { 391 {
@@ -581,6 +586,24 @@ namespace WixToolset.Core.Burn
581 } 586 }
582 } 587 }
583 588
589 private void DetectDuplicateCacheIds(IDictionary<string, PackageFacade> facades)
590 {
591 var duplicateCacheIdDetector = new Dictionary<string, WixBundlePackageSymbol>();
592
593 foreach (var facade in facades.Values)
594 {
595 if (duplicateCacheIdDetector.TryGetValue(facade.PackageSymbol.CacheId, out var collisionPackage))
596 {
597 this.Messaging.Write(BurnBackendErrors.DuplicateCacheIds(collisionPackage.SourceLineNumbers, facade.PackageSymbol.CacheId));
598 this.Messaging.Write(BurnBackendErrors.DuplicateCacheIds2(facade.PackageSymbol.SourceLineNumbers, facade.PackageSymbol.CacheId));
599 }
600 else
601 {
602 duplicateCacheIdDetector.Add(facade.PackageSymbol.CacheId, facade.PackageSymbol);
603 }
604 }
605 }
606
584 private IEnumerable<T> GetRequiredSymbols<T>() where T : IntermediateSymbol 607 private IEnumerable<T> GetRequiredSymbols<T>() where T : IntermediateSymbol
585 { 608 {
586 var symbols = this.Output.Sections.Single().Symbols.OfType<T>().ToList(); 609 var symbols = this.Output.Sections.Single().Symbols.OfType<T>().ToList();