From b62a7a0beb7ceb7987de28ec768c7814cadb83b9 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 21 Jul 2020 14:31:53 -0700 Subject: Support implicit standard directory reference and "3264" platform folders Completes wixtoolset/issues#5798 and wixtoolset/issues#5835 --- .../Bind/SequenceActionsCommand.cs | 36 +++++++++------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs index 7f43da9a..93e25878 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs @@ -34,25 +34,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind { var requiredActionSymbols = new Dictionary(); - // Get the standard actions required based on symbols in the section. - var overridableActionSymbols = this.GetRequiredStandardActions(); - // Index all the action symbols and look for collisions. foreach (var actionSymbol in this.Section.Symbols.OfType()) { if (actionSymbol.Overridable) // overridable action { - if (overridableActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol)) + if (requiredActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol)) { - this.Messaging.Write(ErrorMessages.OverridableActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); - if (null != collidingActionSymbol.SourceLineNumbers) + if (collidingActionSymbol.Overridable) { - this.Messaging.Write(ErrorMessages.OverridableActionCollision2(collidingActionSymbol.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.OverridableActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); + if (null != collidingActionSymbol.SourceLineNumbers) + { + this.Messaging.Write(ErrorMessages.OverridableActionCollision2(collidingActionSymbol.SourceLineNumbers)); + } } } else { - overridableActionSymbols.Add(actionSymbol.Id.Id, actionSymbol); + requiredActionSymbols.Add(actionSymbol.Id.Id, actionSymbol); } } else // unsequenced or sequenced action. @@ -71,7 +71,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } } - if (requiredActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol)) + if (requiredActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol) && !collidingActionSymbol.Overridable) { this.Messaging.Write(ErrorMessages.ActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); if (null != collidingActionSymbol.SourceLineNumbers) @@ -81,13 +81,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else { - requiredActionSymbols.Add(actionSymbol.Id.Id, actionSymbol); + requiredActionSymbols[actionSymbol.Id.Id] = actionSymbol; } } } + // Get the standard actions required based on symbols in the section. + var requiredStandardActions = this.GetRequiredStandardActions(); + // Add the overridable action symbols that are not overridden to the required action symbols. - foreach (var actionSymbol in overridableActionSymbols.Values) + foreach (var actionSymbol in requiredStandardActions.Values) { if (!requiredActionSymbols.ContainsKey(actionSymbol.Id.Id)) { @@ -557,17 +560,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind return set; } - private IEnumerable GetActions(SequenceTable sequence, string[] actionNames) - { - foreach (var action in WindowsInstallerStandard.StandardActions()) - { - if (action.SequenceTable == sequence && actionNames.Contains(action.Action)) - { - yield return action; - } - } - } - /// /// Sequence an action before or after a standard action. /// -- cgit v1.2.3-55-g6feb