diff options
-rw-r--r-- | src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs | 20 | ||||
-rw-r--r-- | src/WixToolset.Core/Link/ReportConflictingTuplesCommand.cs (renamed from src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs) | 27 | ||||
-rw-r--r-- | src/WixToolset.Core/Link/ResolveReferencesCommand.cs | 100 | ||||
-rw-r--r-- | src/WixToolset.Core/Linker.cs | 36 |
4 files changed, 91 insertions, 92 deletions
diff --git a/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs b/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs index b9890a3b..31cbf0b8 100644 --- a/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs +++ b/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs | |||
@@ -31,17 +31,17 @@ namespace WixToolset.Core.Link | |||
31 | /// <summary> | 31 | /// <summary> |
32 | /// Gets the collection of loaded symbols. | 32 | /// Gets the collection of loaded symbols. |
33 | /// </summary> | 33 | /// </summary> |
34 | public IDictionary<string, Symbol> Symbols { get; private set; } | 34 | public IDictionary<string, TupleWithSection> TuplesByName { get; private set; } |
35 | 35 | ||
36 | /// <summary> | 36 | /// <summary> |
37 | /// Gets the collection of possibly conflicting symbols. | 37 | /// Gets the collection of possibly conflicting symbols. |
38 | /// </summary> | 38 | /// </summary> |
39 | public IEnumerable<Symbol> PossiblyConflictingSymbols { get; private set; } | 39 | public IEnumerable<TupleWithSection> PossibleConflicts { get; private set; } |
40 | 40 | ||
41 | public void Execute() | 41 | public void Execute() |
42 | { | 42 | { |
43 | var symbols = new Dictionary<string, Symbol>(); | 43 | var tuplesByName = new Dictionary<string, TupleWithSection>(); |
44 | var possibleConflicts = new HashSet<Symbol>(); | 44 | var possibleConflicts = new HashSet<TupleWithSection>(); |
45 | 45 | ||
46 | if (!Enum.TryParse(this.ExpectedOutputType.ToString(), out SectionType expectedEntrySectionType)) | 46 | if (!Enum.TryParse(this.ExpectedOutputType.ToString(), out SectionType expectedEntrySectionType)) |
47 | { | 47 | { |
@@ -74,11 +74,11 @@ namespace WixToolset.Core.Link | |||
74 | // Load all the symbols from the section's tables that create symbols. | 74 | // Load all the symbols from the section's tables that create symbols. |
75 | foreach (var tuple in section.Tuples.Where(t => t.Id != null)) | 75 | foreach (var tuple in section.Tuples.Where(t => t.Id != null)) |
76 | { | 76 | { |
77 | var symbol = new Symbol(section, tuple); | 77 | var symbol = new TupleWithSection(section, tuple); |
78 | 78 | ||
79 | if (!symbols.TryGetValue(symbol.Name, out var existingSymbol)) | 79 | if (!tuplesByName.TryGetValue(symbol.Name, out var existingSymbol)) |
80 | { | 80 | { |
81 | symbols.Add(symbol.Name, symbol); | 81 | tuplesByName.Add(symbol.Name, symbol); |
82 | } | 82 | } |
83 | else // uh-oh, duplicate symbols. | 83 | else // uh-oh, duplicate symbols. |
84 | { | 84 | { |
@@ -86,7 +86,7 @@ namespace WixToolset.Core.Link | |||
86 | // point to identical tuples. Identical directory tuples are redundant and will not cause | 86 | // point to identical tuples. Identical directory tuples are redundant and will not cause |
87 | // conflicts. | 87 | // conflicts. |
88 | if (AccessModifier.Private == existingSymbol.Access && AccessModifier.Private == symbol.Access && | 88 | if (AccessModifier.Private == existingSymbol.Access && AccessModifier.Private == symbol.Access && |
89 | TupleDefinitionType.Directory == existingSymbol.Row.Definition.Type && existingSymbol.Row.IsIdentical(symbol.Row)) | 89 | TupleDefinitionType.Directory == existingSymbol.Tuple.Definition.Type && existingSymbol.Tuple.IsIdentical(symbol.Tuple)) |
90 | { | 90 | { |
91 | // Ensure identical symbol's tuple is marked redundant to ensure (should the tuple be | 91 | // Ensure identical symbol's tuple is marked redundant to ensure (should the tuple be |
92 | // referenced into the final output) it will not add duplicate primary keys during | 92 | // referenced into the final output) it will not add duplicate primary keys during |
@@ -103,8 +103,8 @@ namespace WixToolset.Core.Link | |||
103 | } | 103 | } |
104 | } | 104 | } |
105 | 105 | ||
106 | this.Symbols = symbols; | 106 | this.TuplesByName = tuplesByName; |
107 | this.PossiblyConflictingSymbols = possibleConflicts; | 107 | this.PossibleConflicts = possibleConflicts; |
108 | } | 108 | } |
109 | } | 109 | } |
110 | } | 110 | } |
diff --git a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs b/src/WixToolset.Core/Link/ReportConflictingTuplesCommand.cs index 8d818ad9..ff01f573 100644 --- a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs +++ b/src/WixToolset.Core/Link/ReportConflictingTuplesCommand.cs | |||
@@ -7,9 +7,9 @@ namespace WixToolset.Core.Link | |||
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility.Services; | 8 | using WixToolset.Extensibility.Services; |
9 | 9 | ||
10 | internal class ReportConflictingSymbolsCommand | 10 | internal class ReportConflictingTuplesCommand |
11 | { | 11 | { |
12 | public ReportConflictingSymbolsCommand(IMessaging messaging, IEnumerable<Symbol> possibleConflicts, IEnumerable<IntermediateSection> resolvedSections) | 12 | public ReportConflictingTuplesCommand(IMessaging messaging, IEnumerable<TupleWithSection> possibleConflicts, IEnumerable<IntermediateSection> resolvedSections) |
13 | { | 13 | { |
14 | this.Messaging = messaging; | 14 | this.Messaging = messaging; |
15 | this.PossibleConflicts = possibleConflicts; | 15 | this.PossibleConflicts = possibleConflicts; |
@@ -18,34 +18,33 @@ namespace WixToolset.Core.Link | |||
18 | 18 | ||
19 | private IMessaging Messaging { get; } | 19 | private IMessaging Messaging { get; } |
20 | 20 | ||
21 | private IEnumerable<Symbol> PossibleConflicts { get; } | 21 | private IEnumerable<TupleWithSection> PossibleConflicts { get; } |
22 | 22 | ||
23 | private IEnumerable<IntermediateSection> ResolvedSections { get; } | 23 | private IEnumerable<IntermediateSection> ResolvedSections { get; } |
24 | 24 | ||
25 | public void Execute() | 25 | public void Execute() |
26 | { | 26 | { |
27 | // Do a quick check if there are any possibly conflicting symbols that don't come from tables that allow | 27 | // Do a quick check if there are any possibly conflicting symbols that don't come from tables that allow |
28 | // overriding. Hopefully the symbols with possible conflicts list is usually very short list (empty should | 28 | // overriding. Hopefully the tuples with possible conflicts list is usually very short list (empty should |
29 | // be the most common). If we find any matches, we'll do a more costly check to see if the possible conflicting | 29 | // be the most common). If we find any matches, we'll do a more costly check to see if the possible conflicting |
30 | // symbols are in sections we actually referenced. From the resulting set, show an error for each duplicate | 30 | // tuples are in sections we actually referenced. From the resulting set, show an error for each duplicate |
31 | // (aka: conflicting) symbol. This should catch any rows with colliding primary keys (since symbols are based | 31 | // (aka: conflicting) tuple. |
32 | // on the primary keys of rows). | 32 | var illegalDuplicates = this.PossibleConflicts.Where(s => s.Tuple.Definition.Type != TupleDefinitionType.WixAction && s.Tuple.Definition.Type != TupleDefinitionType.WixVariable).ToList(); |
33 | var illegalDuplicates = this.PossibleConflicts.Where(s => s.Row.Definition.Type != TupleDefinitionType.WixAction && s.Row.Definition.Type != TupleDefinitionType.WixVariable).ToList(); | ||
34 | if (0 < illegalDuplicates.Count) | 33 | if (0 < illegalDuplicates.Count) |
35 | { | 34 | { |
36 | var referencedSections = new HashSet<IntermediateSection>(this.ResolvedSections); | 35 | var referencedSections = new HashSet<IntermediateSection>(this.ResolvedSections); |
37 | 36 | ||
38 | foreach (Symbol referencedDuplicateSymbol in illegalDuplicates.Where(s => referencedSections.Contains(s.Section))) | 37 | foreach (var referencedDuplicate in illegalDuplicates.Where(s => referencedSections.Contains(s.Section))) |
39 | { | 38 | { |
40 | List<Symbol> actuallyReferencedDuplicateSymbols = referencedDuplicateSymbol.PossiblyConflictingSymbols.Where(s => referencedSections.Contains(s.Section)).ToList(); | 39 | var actuallyReferencedDuplicates = referencedDuplicate.PossiblyConflicts.Where(s => referencedSections.Contains(s.Section)).ToList(); |
41 | 40 | ||
42 | if (actuallyReferencedDuplicateSymbols.Any()) | 41 | if (actuallyReferencedDuplicates.Any()) |
43 | { | 42 | { |
44 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(referencedDuplicateSymbol.Row.SourceLineNumbers, referencedDuplicateSymbol.Name)); | 43 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(referencedDuplicate.Tuple.SourceLineNumbers, referencedDuplicate.Name)); |
45 | 44 | ||
46 | foreach (Symbol duplicate in actuallyReferencedDuplicateSymbols) | 45 | foreach (var duplicate in actuallyReferencedDuplicates) |
47 | { | 46 | { |
48 | this.Messaging.Write(ErrorMessages.DuplicateSymbol2(duplicate.Row.SourceLineNumbers)); | 47 | this.Messaging.Write(ErrorMessages.DuplicateSymbol2(duplicate.Tuple.SourceLineNumbers)); |
49 | } | 48 | } |
50 | } | 49 | } |
51 | } | 50 | } |
diff --git a/src/WixToolset.Core/Link/ResolveReferencesCommand.cs b/src/WixToolset.Core/Link/ResolveReferencesCommand.cs index 6dcd36d3..4ffb5443 100644 --- a/src/WixToolset.Core/Link/ResolveReferencesCommand.cs +++ b/src/WixToolset.Core/Link/ResolveReferencesCommand.cs | |||
@@ -15,19 +15,19 @@ namespace WixToolset.Core.Link | |||
15 | internal class ResolveReferencesCommand | 15 | internal class ResolveReferencesCommand |
16 | { | 16 | { |
17 | private readonly IntermediateSection entrySection; | 17 | private readonly IntermediateSection entrySection; |
18 | private readonly IDictionary<string, Symbol> symbols; | 18 | private readonly IDictionary<string, TupleWithSection> tuplesWithSections; |
19 | private HashSet<Symbol> referencedSymbols; | 19 | private HashSet<TupleWithSection> referencedTuples; |
20 | private HashSet<IntermediateSection> resolvedSections; | 20 | private HashSet<IntermediateSection> resolvedSections; |
21 | 21 | ||
22 | public ResolveReferencesCommand(IMessaging messaging, IntermediateSection entrySection, IDictionary<string, Symbol> symbols) | 22 | public ResolveReferencesCommand(IMessaging messaging, IntermediateSection entrySection, IDictionary<string, TupleWithSection> tuplesWithSections) |
23 | { | 23 | { |
24 | this.Messaging = messaging; | 24 | this.Messaging = messaging; |
25 | this.entrySection = entrySection; | 25 | this.entrySection = entrySection; |
26 | this.symbols = symbols; | 26 | this.tuplesWithSections = tuplesWithSections; |
27 | this.BuildingMergeModule = (SectionType.Module == entrySection.Type); | 27 | this.BuildingMergeModule = (SectionType.Module == entrySection.Type); |
28 | } | 28 | } |
29 | 29 | ||
30 | public IEnumerable<Symbol> ReferencedSymbols => this.referencedSymbols; | 30 | public IEnumerable<TupleWithSection> ReferencedTupleWithSections => this.referencedTuples; |
31 | 31 | ||
32 | public IEnumerable<IntermediateSection> ResolvedSections => this.resolvedSections; | 32 | public IEnumerable<IntermediateSection> ResolvedSections => this.resolvedSections; |
33 | 33 | ||
@@ -41,7 +41,7 @@ namespace WixToolset.Core.Link | |||
41 | public void Execute() | 41 | public void Execute() |
42 | { | 42 | { |
43 | this.resolvedSections = new HashSet<IntermediateSection>(); | 43 | this.resolvedSections = new HashSet<IntermediateSection>(); |
44 | this.referencedSymbols = new HashSet<Symbol>(); | 44 | this.referencedTuples = new HashSet<TupleWithSection>(); |
45 | 45 | ||
46 | this.RecursivelyResolveReferences(this.entrySection); | 46 | this.RecursivelyResolveReferences(this.entrySection); |
47 | } | 47 | } |
@@ -60,8 +60,8 @@ namespace WixToolset.Core.Link | |||
60 | } | 60 | } |
61 | 61 | ||
62 | // Process all of the references contained in this section using the collection of | 62 | // Process all of the references contained in this section using the collection of |
63 | // symbols provided. Then recursively call this method to process the | 63 | // tuples provided. Then recursively call this method to process the |
64 | // located symbol's section. All in all this is a very simple depth-first | 64 | // located tuple's section. All in all this is a very simple depth-first |
65 | // search of the references per-section. | 65 | // search of the references per-section. |
66 | foreach (var wixSimpleReferenceRow in section.Tuples.OfType<WixSimpleReferenceTuple>()) | 66 | foreach (var wixSimpleReferenceRow in section.Tuples.OfType<WixSimpleReferenceTuple>()) |
67 | { | 67 | { |
@@ -72,44 +72,44 @@ namespace WixToolset.Core.Link | |||
72 | continue; | 72 | continue; |
73 | } | 73 | } |
74 | 74 | ||
75 | if (!this.symbols.TryGetValue(wixSimpleReferenceRow.SymbolicName, out var symbol)) | 75 | if (!this.tuplesWithSections.TryGetValue(wixSimpleReferenceRow.SymbolicName, out var tupleWithSection)) |
76 | { | 76 | { |
77 | this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName)); | 77 | this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName)); |
78 | } | 78 | } |
79 | else // see if the symbol (and any of its duplicates) are appropriately accessible. | 79 | else // see if the tuple (and any of its duplicates) are appropriately accessible. |
80 | { | 80 | { |
81 | IList<Symbol> accessible = this.DetermineAccessibleSymbols(section, symbol); | 81 | var accessible = this.DetermineAccessibleTuples(section, tupleWithSection); |
82 | if (!accessible.Any()) | 82 | if (!accessible.Any()) |
83 | { | 83 | { |
84 | this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName, symbol.Access)); | 84 | this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName, tupleWithSection.Access)); |
85 | } | 85 | } |
86 | else if (1 == accessible.Count) | 86 | else if (1 == accessible.Count) |
87 | { | 87 | { |
88 | var accessibleSymbol = accessible[0]; | 88 | var accessibleTuple = accessible[0]; |
89 | this.referencedSymbols.Add(accessibleSymbol); | 89 | this.referencedTuples.Add(accessibleTuple); |
90 | 90 | ||
91 | if (null != accessibleSymbol.Section) | 91 | if (null != accessibleTuple.Section) |
92 | { | 92 | { |
93 | this.RecursivelyResolveReferences(accessibleSymbol.Section); | 93 | this.RecursivelyResolveReferences(accessibleTuple.Section); |
94 | } | 94 | } |
95 | } | 95 | } |
96 | else // display errors for the duplicate symbols. | 96 | else // display errors for the duplicate tuples. |
97 | { | 97 | { |
98 | var accessibleSymbol = accessible[0]; | 98 | var accessibleTuple = accessible[0]; |
99 | var referencingSourceLineNumber = wixSimpleReferenceRow.SourceLineNumbers?.ToString(); | 99 | var referencingSourceLineNumber = wixSimpleReferenceRow.SourceLineNumbers?.ToString(); |
100 | 100 | ||
101 | if (String.IsNullOrEmpty(referencingSourceLineNumber)) | 101 | if (String.IsNullOrEmpty(referencingSourceLineNumber)) |
102 | { | 102 | { |
103 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleSymbol.Row.SourceLineNumbers, accessibleSymbol.Name)); | 103 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleTuple.Tuple.SourceLineNumbers, accessibleTuple.Name)); |
104 | } | 104 | } |
105 | else | 105 | else |
106 | { | 106 | { |
107 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleSymbol.Row.SourceLineNumbers, accessibleSymbol.Name, referencingSourceLineNumber)); | 107 | this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleTuple.Tuple.SourceLineNumbers, accessibleTuple.Name, referencingSourceLineNumber)); |
108 | } | 108 | } |
109 | 109 | ||
110 | foreach (Symbol accessibleDuplicate in accessible.Skip(1)) | 110 | foreach (var accessibleDuplicate in accessible.Skip(1)) |
111 | { | 111 | { |
112 | this.Messaging.Write(ErrorMessages.DuplicateSymbol2(accessibleDuplicate.Row.SourceLineNumbers)); | 112 | this.Messaging.Write(ErrorMessages.DuplicateSymbol2(accessibleDuplicate.Tuple.SourceLineNumbers)); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | } | 115 | } |
@@ -117,67 +117,67 @@ namespace WixToolset.Core.Link | |||
117 | } | 117 | } |
118 | 118 | ||
119 | /// <summary> | 119 | /// <summary> |
120 | /// Determine if the symbol and any of its duplicates are accessbile by referencing section. | 120 | /// Determine if the tuple and any of its duplicates are accessbile by referencing section. |
121 | /// </summary> | 121 | /// </summary> |
122 | /// <param name="referencingSection">Section referencing the symbol.</param> | 122 | /// <param name="referencingSection">Section referencing the tuple.</param> |
123 | /// <param name="symbol">Symbol being referenced.</param> | 123 | /// <param name="tupleWithSection">Tuple being referenced.</param> |
124 | /// <returns>List of symbols accessible by referencing section.</returns> | 124 | /// <returns>List of tuples accessible by referencing section.</returns> |
125 | private IList<Symbol> DetermineAccessibleSymbols(IntermediateSection referencingSection, Symbol symbol) | 125 | private List<TupleWithSection> DetermineAccessibleTuples(IntermediateSection referencingSection, TupleWithSection tupleWithSection) |
126 | { | 126 | { |
127 | List<Symbol> symbols = new List<Symbol>(); | 127 | var accessibleTuples = new List<TupleWithSection>(); |
128 | 128 | ||
129 | if (this.AccessibleSymbol(referencingSection, symbol)) | 129 | if (this.AccessibleTuple(referencingSection, tupleWithSection)) |
130 | { | 130 | { |
131 | symbols.Add(symbol); | 131 | accessibleTuples.Add(tupleWithSection); |
132 | } | 132 | } |
133 | 133 | ||
134 | foreach (Symbol dupe in symbol.PossiblyConflictingSymbols) | 134 | foreach (var dupe in tupleWithSection.PossiblyConflicts) |
135 | { | 135 | { |
136 | // don't count overridable WixActionTuples | 136 | // don't count overridable WixActionTuples |
137 | WixActionTuple symbolAction = symbol.Row as WixActionTuple; | 137 | var tupleAction = tupleWithSection.Tuple as WixActionTuple; |
138 | WixActionTuple dupeAction = dupe.Row as WixActionTuple; | 138 | var dupeAction = dupe.Tuple as WixActionTuple; |
139 | if (symbolAction?.Overridable != dupeAction?.Overridable) | 139 | if (tupleAction?.Overridable != dupeAction?.Overridable) |
140 | { | 140 | { |
141 | continue; | 141 | continue; |
142 | } | 142 | } |
143 | 143 | ||
144 | if (this.AccessibleSymbol(referencingSection, dupe)) | 144 | if (this.AccessibleTuple(referencingSection, dupe)) |
145 | { | 145 | { |
146 | symbols.Add(dupe); | 146 | accessibleTuples.Add(dupe); |
147 | } | 147 | } |
148 | } | 148 | } |
149 | 149 | ||
150 | foreach (Symbol dupe in symbol.RedundantSymbols) | 150 | foreach (var dupe in tupleWithSection.Redundants) |
151 | { | 151 | { |
152 | if (this.AccessibleSymbol(referencingSection, dupe)) | 152 | if (this.AccessibleTuple(referencingSection, dupe)) |
153 | { | 153 | { |
154 | symbols.Add(dupe); | 154 | accessibleTuples.Add(dupe); |
155 | } | 155 | } |
156 | } | 156 | } |
157 | 157 | ||
158 | return symbols; | 158 | return accessibleTuples; |
159 | } | 159 | } |
160 | 160 | ||
161 | /// <summary> | 161 | /// <summary> |
162 | /// Determine if a single symbol is accessible by the referencing section. | 162 | /// Determine if a single tuple is accessible by the referencing section. |
163 | /// </summary> | 163 | /// </summary> |
164 | /// <param name="referencingSection">Section referencing the symbol.</param> | 164 | /// <param name="referencingSection">Section referencing the tuple.</param> |
165 | /// <param name="symbol">Symbol being referenced.</param> | 165 | /// <param name="tupleWithSection">Tuple being referenced.</param> |
166 | /// <returns>True if symbol is accessible.</returns> | 166 | /// <returns>True if tuple is accessible.</returns> |
167 | private bool AccessibleSymbol(IntermediateSection referencingSection, Symbol symbol) | 167 | private bool AccessibleTuple(IntermediateSection referencingSection, TupleWithSection tupleWithSection) |
168 | { | 168 | { |
169 | switch (symbol.Access) | 169 | switch (tupleWithSection.Access) |
170 | { | 170 | { |
171 | case AccessModifier.Public: | 171 | case AccessModifier.Public: |
172 | return true; | 172 | return true; |
173 | case AccessModifier.Internal: | 173 | case AccessModifier.Internal: |
174 | return symbol.Section.CompilationId.Equals(referencingSection.CompilationId) || (null != symbol.Section.LibraryId && symbol.Section.LibraryId.Equals(referencingSection.LibraryId)); | 174 | return tupleWithSection.Section.CompilationId.Equals(referencingSection.CompilationId) || (null != tupleWithSection.Section.LibraryId && tupleWithSection.Section.LibraryId.Equals(referencingSection.LibraryId)); |
175 | case AccessModifier.Protected: | 175 | case AccessModifier.Protected: |
176 | return symbol.Section.CompilationId.Equals(referencingSection.CompilationId); | 176 | return tupleWithSection.Section.CompilationId.Equals(referencingSection.CompilationId); |
177 | case AccessModifier.Private: | 177 | case AccessModifier.Private: |
178 | return referencingSection == symbol.Section; | 178 | return referencingSection == tupleWithSection.Section; |
179 | default: | 179 | default: |
180 | throw new ArgumentOutOfRangeException(nameof(symbol.Access)); | 180 | throw new ArgumentOutOfRangeException(nameof(tupleWithSection.Access)); |
181 | } | 181 | } |
182 | } | 182 | } |
183 | } | 183 | } |
diff --git a/src/WixToolset.Core/Linker.cs b/src/WixToolset.Core/Linker.cs index cbdb46d0..862681bb 100644 --- a/src/WixToolset.Core/Linker.cs +++ b/src/WixToolset.Core/Linker.cs | |||
@@ -149,12 +149,12 @@ namespace WixToolset.Core | |||
149 | throw new WixException(ErrorMessages.MissingEntrySection(this.Context.ExpectedOutputType.ToString())); | 149 | throw new WixException(ErrorMessages.MissingEntrySection(this.Context.ExpectedOutputType.ToString())); |
150 | } | 150 | } |
151 | 151 | ||
152 | // Add the missing standard action symbols. | 152 | // Add the missing standard action tuples. |
153 | this.LoadStandardActionSymbols(find.EntrySection, find.Symbols); | 153 | this.LoadStandardActions(find.EntrySection, find.TuplesByName); |
154 | 154 | ||
155 | // Resolve the symbol references to find the set of sections we care about for linking. | 155 | // Resolve the tuple references to find the set of sections we care about for linking. |
156 | // Of course, we start with the entry section (that's how it got its name after all). | 156 | // Of course, we start with the entry section (that's how it got its name after all). |
157 | var resolve = new ResolveReferencesCommand(this.Messaging, find.EntrySection, find.Symbols); | 157 | var resolve = new ResolveReferencesCommand(this.Messaging, find.EntrySection, find.TuplesByName); |
158 | 158 | ||
159 | resolve.Execute(); | 159 | resolve.Execute(); |
160 | 160 | ||
@@ -190,16 +190,16 @@ namespace WixToolset.Core | |||
190 | } | 190 | } |
191 | 191 | ||
192 | // Display an error message for Components that were not referenced by a Feature. | 192 | // Display an error message for Components that were not referenced by a Feature. |
193 | foreach (var symbol in resolve.ReferencedSymbols.Where(s => s.Row.Definition.Type == TupleDefinitionType.Component)) | 193 | foreach (var tupleWithSection in resolve.ReferencedTupleWithSections.Where(s => s.Tuple.Definition.Type == TupleDefinitionType.Component)) |
194 | { | 194 | { |
195 | if (!referencedComponents.Contains(symbol.Name)) | 195 | if (!referencedComponents.Contains(tupleWithSection.Name)) |
196 | { | 196 | { |
197 | this.Messaging.Write(ErrorMessages.OrphanedComponent(symbol.Row.SourceLineNumbers, symbol.Row.Id.Id)); | 197 | this.Messaging.Write(ErrorMessages.OrphanedComponent(tupleWithSection.Tuple.SourceLineNumbers, tupleWithSection.Tuple.Id.Id)); |
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | // Report duplicates that would ultimately end up being primary key collisions. | 201 | // Report duplicates that would ultimately end up being primary key collisions. |
202 | var reportDupes = new ReportConflictingSymbolsCommand(this.Messaging, find.PossiblyConflictingSymbols, resolve.ResolvedSections); | 202 | var reportDupes = new ReportConflictingTuplesCommand(this.Messaging, find.PossibleConflicts, resolve.ResolvedSections); |
203 | reportDupes.Execute(); | 203 | reportDupes.Execute(); |
204 | 204 | ||
205 | if (this.Messaging.EncounteredError) | 205 | if (this.Messaging.EncounteredError) |
@@ -208,7 +208,7 @@ namespace WixToolset.Core | |||
208 | } | 208 | } |
209 | 209 | ||
210 | // resolve the feature to feature connects | 210 | // resolve the feature to feature connects |
211 | this.ResolveFeatureToFeatureConnects(featuresToFeatures, find.Symbols); | 211 | this.ResolveFeatureToFeatureConnects(featuresToFeatures, find.TuplesByName); |
212 | 212 | ||
213 | // Create the section to hold the linked content. | 213 | // Create the section to hold the linked content. |
214 | var resolvedSection = new IntermediateSection(find.EntrySection.Id, find.EntrySection.Type, find.EntrySection.Codepage); | 214 | var resolvedSection = new IntermediateSection(find.EntrySection.Id, find.EntrySection.Type, find.EntrySection.Codepage); |
@@ -734,17 +734,17 @@ namespace WixToolset.Core | |||
734 | /// <summary> | 734 | /// <summary> |
735 | /// Load the standard action symbols. | 735 | /// Load the standard action symbols. |
736 | /// </summary> | 736 | /// </summary> |
737 | /// <param name="symbols">Collection of symbols.</param> | 737 | /// <param name="tuplesByName">Collection of symbols.</param> |
738 | private void LoadStandardActionSymbols(IntermediateSection section, IDictionary<string, Symbol> symbols) | 738 | private void LoadStandardActions(IntermediateSection section, IDictionary<string, TupleWithSection> tuplesByName) |
739 | { | 739 | { |
740 | foreach (var actionRow in WindowsInstallerStandard.StandardActions()) | 740 | foreach (var actionTuple in WindowsInstallerStandard.StandardActions()) |
741 | { | 741 | { |
742 | var symbol = new Symbol(section, actionRow); | 742 | var tupleWithSection = new TupleWithSection(section, actionTuple); |
743 | 743 | ||
744 | // If the action's symbol has not already been defined (i.e. overriden by the user), add it now. | 744 | // If the action's tuple has not already been defined (i.e. overriden by the user), add it now. |
745 | if (!symbols.ContainsKey(symbol.Name)) | 745 | if (!tuplesByName.ContainsKey(tupleWithSection.Name)) |
746 | { | 746 | { |
747 | symbols.Add(symbol.Name, symbol); | 747 | tuplesByName.Add(tupleWithSection.Name, tupleWithSection); |
748 | } | 748 | } |
749 | } | 749 | } |
750 | } | 750 | } |
@@ -1242,7 +1242,7 @@ namespace WixToolset.Core | |||
1242 | /// </summary> | 1242 | /// </summary> |
1243 | /// <param name="featuresToFeatures">Feature to feature complex references.</param> | 1243 | /// <param name="featuresToFeatures">Feature to feature complex references.</param> |
1244 | /// <param name="allSymbols">All symbols loaded from the sections.</param> | 1244 | /// <param name="allSymbols">All symbols loaded from the sections.</param> |
1245 | private void ResolveFeatureToFeatureConnects(ConnectToFeatureCollection featuresToFeatures, IDictionary<string, Symbol> allSymbols) | 1245 | private void ResolveFeatureToFeatureConnects(ConnectToFeatureCollection featuresToFeatures, IDictionary<string, TupleWithSection> allSymbols) |
1246 | { | 1246 | { |
1247 | foreach (ConnectToFeature connection in featuresToFeatures) | 1247 | foreach (ConnectToFeature connection in featuresToFeatures) |
1248 | { | 1248 | { |
@@ -1254,7 +1254,7 @@ namespace WixToolset.Core | |||
1254 | 1254 | ||
1255 | if (allSymbols.TryGetValue(wixSimpleReferenceRow.SymbolicName, out var symbol)) | 1255 | if (allSymbols.TryGetValue(wixSimpleReferenceRow.SymbolicName, out var symbol)) |
1256 | { | 1256 | { |
1257 | var featureTuple = (FeatureTuple)symbol.Row; | 1257 | var featureTuple = (FeatureTuple)symbol.Tuple; |
1258 | featureTuple.ParentFeatureRef = connection.PrimaryFeature; | 1258 | featureTuple.ParentFeatureRef = connection.PrimaryFeature; |
1259 | } | 1259 | } |
1260 | } | 1260 | } |