aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-07-21 14:31:53 -0700
committerRob Mensching <rob@firegiant.com>2020-07-21 14:41:12 -0700
commitb62a7a0beb7ceb7987de28ec768c7814cadb83b9 (patch)
tree69a9183a3182334f0d48a39ab8e411ee3fc3aecd /src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs
parent414c07f7adce9c9fd0132ab0fade0267f743f665 (diff)
downloadwix-b62a7a0beb7ceb7987de28ec768c7814cadb83b9.tar.gz
wix-b62a7a0beb7ceb7987de28ec768c7814cadb83b9.tar.bz2
wix-b62a7a0beb7ceb7987de28ec768c7814cadb83b9.zip
Support implicit standard directory reference and "3264" platform folders
Completes wixtoolset/issues#5798 and wixtoolset/issues#5835
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs36
1 files changed, 14 insertions, 22 deletions
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
34 { 34 {
35 var requiredActionSymbols = new Dictionary<string, WixActionSymbol>(); 35 var requiredActionSymbols = new Dictionary<string, WixActionSymbol>();
36 36
37 // Get the standard actions required based on symbols in the section.
38 var overridableActionSymbols = this.GetRequiredStandardActions();
39
40 // Index all the action symbols and look for collisions. 37 // Index all the action symbols and look for collisions.
41 foreach (var actionSymbol in this.Section.Symbols.OfType<WixActionSymbol>()) 38 foreach (var actionSymbol in this.Section.Symbols.OfType<WixActionSymbol>())
42 { 39 {
43 if (actionSymbol.Overridable) // overridable action 40 if (actionSymbol.Overridable) // overridable action
44 { 41 {
45 if (overridableActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol)) 42 if (requiredActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol))
46 { 43 {
47 this.Messaging.Write(ErrorMessages.OverridableActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); 44 if (collidingActionSymbol.Overridable)
48 if (null != collidingActionSymbol.SourceLineNumbers)
49 { 45 {
50 this.Messaging.Write(ErrorMessages.OverridableActionCollision2(collidingActionSymbol.SourceLineNumbers)); 46 this.Messaging.Write(ErrorMessages.OverridableActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action));
47 if (null != collidingActionSymbol.SourceLineNumbers)
48 {
49 this.Messaging.Write(ErrorMessages.OverridableActionCollision2(collidingActionSymbol.SourceLineNumbers));
50 }
51 } 51 }
52 } 52 }
53 else 53 else
54 { 54 {
55 overridableActionSymbols.Add(actionSymbol.Id.Id, actionSymbol); 55 requiredActionSymbols.Add(actionSymbol.Id.Id, actionSymbol);
56 } 56 }
57 } 57 }
58 else // unsequenced or sequenced action. 58 else // unsequenced or sequenced action.
@@ -71,7 +71,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
71 } 71 }
72 } 72 }
73 73
74 if (requiredActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol)) 74 if (requiredActionSymbols.TryGetValue(actionSymbol.Id.Id, out var collidingActionSymbol) && !collidingActionSymbol.Overridable)
75 { 75 {
76 this.Messaging.Write(ErrorMessages.ActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action)); 76 this.Messaging.Write(ErrorMessages.ActionCollision(actionSymbol.SourceLineNumbers, actionSymbol.SequenceTable.ToString(), actionSymbol.Action));
77 if (null != collidingActionSymbol.SourceLineNumbers) 77 if (null != collidingActionSymbol.SourceLineNumbers)
@@ -81,13 +81,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind
81 } 81 }
82 else 82 else
83 { 83 {
84 requiredActionSymbols.Add(actionSymbol.Id.Id, actionSymbol); 84 requiredActionSymbols[actionSymbol.Id.Id] = actionSymbol;
85 } 85 }
86 } 86 }
87 } 87 }
88 88
89 // Get the standard actions required based on symbols in the section.
90 var requiredStandardActions = this.GetRequiredStandardActions();
91
89 // Add the overridable action symbols that are not overridden to the required action symbols. 92 // Add the overridable action symbols that are not overridden to the required action symbols.
90 foreach (var actionSymbol in overridableActionSymbols.Values) 93 foreach (var actionSymbol in requiredStandardActions.Values)
91 { 94 {
92 if (!requiredActionSymbols.ContainsKey(actionSymbol.Id.Id)) 95 if (!requiredActionSymbols.ContainsKey(actionSymbol.Id.Id))
93 { 96 {
@@ -557,17 +560,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
557 return set; 560 return set;
558 } 561 }
559 562
560 private IEnumerable<WixActionSymbol> GetActions(SequenceTable sequence, string[] actionNames)
561 {
562 foreach (var action in WindowsInstallerStandard.StandardActions())
563 {
564 if (action.SequenceTable == sequence && actionNames.Contains(action.Action))
565 {
566 yield return action;
567 }
568 }
569 }
570
571 /// <summary> 563 /// <summary>
572 /// Sequence an action before or after a standard action. 564 /// Sequence an action before or after a standard action.
573 /// </summary> 565 /// </summary>