aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Intermediate.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/WixToolset.Data/Intermediate.cs54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/WixToolset.Data/Intermediate.cs b/src/WixToolset.Data/Intermediate.cs
index d1c38cf0..30a50120 100644
--- a/src/WixToolset.Data/Intermediate.cs
+++ b/src/WixToolset.Data/Intermediate.cs
@@ -69,7 +69,7 @@ namespace WixToolset.Data
69 /// <returns>Returns the loaded intermediate.</returns> 69 /// <returns>Returns the loaded intermediate.</returns>
70 public static Intermediate Load(string path, bool suppressVersionCheck = false) 70 public static Intermediate Load(string path, bool suppressVersionCheck = false)
71 { 71 {
72 var creator = new SimpleTupleDefinitionCreator(); 72 var creator = new SimpleSymbolDefinitionCreator();
73 return Intermediate.Load(path, creator, suppressVersionCheck); 73 return Intermediate.Load(path, creator, suppressVersionCheck);
74 } 74 }
75 75
@@ -82,7 +82,7 @@ namespace WixToolset.Data
82 /// <returns>Returns the loaded intermediate.</returns> 82 /// <returns>Returns the loaded intermediate.</returns>
83 public static Intermediate Load(Assembly assembly, string resourceName, bool suppressVersionCheck = false) 83 public static Intermediate Load(Assembly assembly, string resourceName, bool suppressVersionCheck = false)
84 { 84 {
85 var creator = new SimpleTupleDefinitionCreator(); 85 var creator = new SimpleSymbolDefinitionCreator();
86 return Intermediate.Load(assembly, resourceName, creator, suppressVersionCheck); 86 return Intermediate.Load(assembly, resourceName, creator, suppressVersionCheck);
87 } 87 }
88 88
@@ -91,10 +91,10 @@ namespace WixToolset.Data
91 /// </summary> 91 /// </summary>
92 /// <param name="assembly">Assembly with intermediate embedded in resource stream.</param> 92 /// <param name="assembly">Assembly with intermediate embedded in resource stream.</param>
93 /// <param name="resourceName">Name of resource stream.</param> 93 /// <param name="resourceName">Name of resource stream.</param>
94 /// <param name="creator">ITupleDefinitionCreator to use when reconstituting the intermediate.</param> 94 /// <param name="creator">ISymbolDefinitionCreator to use when reconstituting the intermediate.</param>
95 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param> 95 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param>
96 /// <returns>Returns the loaded intermediate.</returns> 96 /// <returns>Returns the loaded intermediate.</returns>
97 public static Intermediate Load(Assembly assembly, string resourceName, ITupleDefinitionCreator creator, bool suppressVersionCheck = false) 97 public static Intermediate Load(Assembly assembly, string resourceName, ISymbolDefinitionCreator creator, bool suppressVersionCheck = false)
98 { 98 {
99 using (var wixout = WixOutput.Read(assembly, resourceName)) 99 using (var wixout = WixOutput.Read(assembly, resourceName))
100 { 100 {
@@ -106,10 +106,10 @@ namespace WixToolset.Data
106 /// Loads an intermediate from a path on disk. 106 /// Loads an intermediate from a path on disk.
107 /// </summary> 107 /// </summary>
108 /// <param name="path">Path to intermediate file saved on disk.</param> 108 /// <param name="path">Path to intermediate file saved on disk.</param>
109 /// <param name="creator">ITupleDefinitionCreator to use when reconstituting the intermediate.</param> 109 /// <param name="creator">ISymbolDefinitionCreator to use when reconstituting the intermediate.</param>
110 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param> 110 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param>
111 /// <returns>Returns the loaded intermediate.</returns> 111 /// <returns>Returns the loaded intermediate.</returns>
112 public static Intermediate Load(string path, ITupleDefinitionCreator creator, bool suppressVersionCheck = false) 112 public static Intermediate Load(string path, ISymbolDefinitionCreator creator, bool suppressVersionCheck = false)
113 { 113 {
114 using (var wixout = WixOutput.Read(path)) 114 using (var wixout = WixOutput.Read(path))
115 { 115 {
@@ -121,12 +121,12 @@ namespace WixToolset.Data
121 /// Loads an intermediate from a WixOutput object. 121 /// Loads an intermediate from a WixOutput object.
122 /// </summary> 122 /// </summary>
123 /// <param name="wixOutput">WixOutput object.</param> 123 /// <param name="wixOutput">WixOutput object.</param>
124 /// <param name="creator">ITupleDefinitionCreator to use when reconstituting the intermediate.</param> 124 /// <param name="creator">ISymbolDefinitionCreator to use when reconstituting the intermediate.</param>
125 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param> 125 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param>
126 /// <returns>Returns the loaded intermediate.</returns> 126 /// <returns>Returns the loaded intermediate.</returns>
127 public static Intermediate Load(WixOutput wixOutput, bool suppressVersionCheck = false) 127 public static Intermediate Load(WixOutput wixOutput, bool suppressVersionCheck = false)
128 { 128 {
129 var creator = new SimpleTupleDefinitionCreator(); 129 var creator = new SimpleSymbolDefinitionCreator();
130 return Intermediate.LoadIntermediate(wixOutput, creator, suppressVersionCheck); 130 return Intermediate.LoadIntermediate(wixOutput, creator, suppressVersionCheck);
131 } 131 }
132 132
@@ -134,10 +134,10 @@ namespace WixToolset.Data
134 /// Loads an intermediate from a WixOutput object. 134 /// Loads an intermediate from a WixOutput object.
135 /// </summary> 135 /// </summary>
136 /// <param name="wixOutput">WixOutput object.</param> 136 /// <param name="wixOutput">WixOutput object.</param>
137 /// <param name="creator">ITupleDefinitionCreator to use when reconstituting the intermediate.</param> 137 /// <param name="creator">ISymbolDefinitionCreator to use when reconstituting the intermediate.</param>
138 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param> 138 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param>
139 /// <returns>Returns the loaded intermediate.</returns> 139 /// <returns>Returns the loaded intermediate.</returns>
140 public static Intermediate Load(WixOutput wixOutput, ITupleDefinitionCreator creator, bool suppressVersionCheck = false) 140 public static Intermediate Load(WixOutput wixOutput, ISymbolDefinitionCreator creator, bool suppressVersionCheck = false)
141 { 141 {
142 return Intermediate.LoadIntermediate(wixOutput, creator, suppressVersionCheck); 142 return Intermediate.LoadIntermediate(wixOutput, creator, suppressVersionCheck);
143 } 143 }
@@ -150,7 +150,7 @@ namespace WixToolset.Data
150 /// <returns>Returns the loaded intermediates</returns> 150 /// <returns>Returns the loaded intermediates</returns>
151 public static IEnumerable<Intermediate> Load(IEnumerable<string> intermediateFiles) 151 public static IEnumerable<Intermediate> Load(IEnumerable<string> intermediateFiles)
152 { 152 {
153 var creator = new SimpleTupleDefinitionCreator(); 153 var creator = new SimpleSymbolDefinitionCreator();
154 return Intermediate.Load(intermediateFiles, creator); 154 return Intermediate.Load(intermediateFiles, creator);
155 } 155 }
156 156
@@ -158,10 +158,10 @@ namespace WixToolset.Data
158 /// Loads several intermediates from paths on disk using the same definitions. 158 /// Loads several intermediates from paths on disk using the same definitions.
159 /// </summary> 159 /// </summary>
160 /// <param name="intermediateFiles">Paths to intermediate files saved on disk.</param> 160 /// <param name="intermediateFiles">Paths to intermediate files saved on disk.</param>
161 /// <param name="creator">ITupleDefinitionCreator to use when reconstituting the intermediates.</param> 161 /// <param name="creator">ISymbolDefinitionCreator to use when reconstituting the intermediates.</param>
162 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param> 162 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param>
163 /// <returns>Returns the loaded intermediates</returns> 163 /// <returns>Returns the loaded intermediates</returns>
164 public static IEnumerable<Intermediate> Load(IEnumerable<string> intermediateFiles, ITupleDefinitionCreator creator, bool suppressVersionCheck = false) 164 public static IEnumerable<Intermediate> Load(IEnumerable<string> intermediateFiles, ISymbolDefinitionCreator creator, bool suppressVersionCheck = false)
165 { 165 {
166 var jsons = new Queue<JsonWithPath>(); 166 var jsons = new Queue<JsonWithPath>();
167 var intermediates = new List<Intermediate>(); 167 var intermediates = new List<Intermediate>();
@@ -240,10 +240,10 @@ namespace WixToolset.Data
240 /// </summary> 240 /// </summary>
241 /// <param name="stream">Stream to intermediate file.</param> 241 /// <param name="stream">Stream to intermediate file.</param>
242 /// <param name="baseUri">Path name of intermediate file.</param> 242 /// <param name="baseUri">Path name of intermediate file.</param>
243 /// <param name="creator">ITupleDefinitionCreator to use when reconstituting the intermediate.</param> 243 /// <param name="creator">ISymbolDefinitionCreator to use when reconstituting the intermediate.</param>
244 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param> 244 /// <param name="suppressVersionCheck">Suppress checking for wix.dll version mismatches.</param>
245 /// <returns>Returns the loaded intermediate.</returns> 245 /// <returns>Returns the loaded intermediate.</returns>
246 private static Intermediate LoadIntermediate(WixOutput wixout, ITupleDefinitionCreator creator, bool suppressVersionCheck = false) 246 private static Intermediate LoadIntermediate(WixOutput wixout, ISymbolDefinitionCreator creator, bool suppressVersionCheck = false)
247 { 247 {
248 var data = wixout.GetData(WixOutputStreamName); 248 var data = wixout.GetData(WixOutputStreamName);
249 var json = Intermediate.LoadJson(data, wixout.Uri, suppressVersionCheck); 249 var json = Intermediate.LoadJson(data, wixout.Uri, suppressVersionCheck);
@@ -281,8 +281,8 @@ namespace WixToolset.Data
281 /// Loads custom definitions in intermediate json into the creator. 281 /// Loads custom definitions in intermediate json into the creator.
282 /// </summary> 282 /// </summary>
283 /// <param name="json">Json version of intermediate.</param> 283 /// <param name="json">Json version of intermediate.</param>
284 /// <param name="creator">ITupleDefinitionCreator to use when reconstituting the intermediate.</param> 284 /// <param name="creator">ISymbolDefinitionCreator to use when reconstituting the intermediate.</param>
285 private static void LoadDefinitions(JsonObject json, ITupleDefinitionCreator creator) 285 private static void LoadDefinitions(JsonObject json, ISymbolDefinitionCreator creator)
286 { 286 {
287 var definitionsJson = json.GetValueOrDefault<JsonArray>("definitions"); 287 var definitionsJson = json.GetValueOrDefault<JsonArray>("definitions");
288 288
@@ -290,8 +290,8 @@ namespace WixToolset.Data
290 { 290 {
291 foreach (JsonObject definitionJson in definitionsJson) 291 foreach (JsonObject definitionJson in definitionsJson)
292 { 292 {
293 var definition = IntermediateTupleDefinition.Deserialize(definitionJson); 293 var definition = IntermediateSymbolDefinition.Deserialize(definitionJson);
294 creator.AddCustomTupleDefinition(definition); 294 creator.AddCustomSymbolDefinition(definition);
295 } 295 }
296 } 296 }
297 } 297 }
@@ -301,9 +301,9 @@ namespace WixToolset.Data
301 /// </summary> 301 /// </summary>
302 /// <param name="json">Json version of intermediate.</param> 302 /// <param name="json">Json version of intermediate.</param>
303 /// <param name="baseUri">Path to the intermediate.</param> 303 /// <param name="baseUri">Path to the intermediate.</param>
304 /// <param name="creator">ITupleDefinitionCreator to use when reconstituting the intermediate.</param> 304 /// <param name="creator">ISymbolDefinitionCreator to use when reconstituting the intermediate.</param>
305 /// <returns>The finalized intermediate.</returns> 305 /// <returns>The finalized intermediate.</returns>
306 private static Intermediate FinalizeLoad(JsonObject json, Uri baseUri, ITupleDefinitionCreator creator) 306 private static Intermediate FinalizeLoad(JsonObject json, Uri baseUri, ISymbolDefinitionCreator creator)
307 { 307 {
308 var id = json.GetValueOrDefault<string>("id"); 308 var id = json.GetValueOrDefault<string>("id");
309 var level = json.GetValueOrDefault<string>("level"); 309 var level = json.GetValueOrDefault<string>("level");
@@ -331,7 +331,7 @@ namespace WixToolset.Data
331 331
332 private void SaveEmbedFiles(WixOutput wixout) 332 private void SaveEmbedFiles(WixOutput wixout)
333 { 333 {
334 var embeddedFields = this.Sections.SelectMany(s => s.Tuples) 334 var embeddedFields = this.Sections.SelectMany(s => s.Symbols)
335 .SelectMany(t => t.Fields) 335 .SelectMany(t => t.Fields)
336 .Where(f => f?.Type == IntermediateFieldType.Path) 336 .Where(f => f?.Type == IntermediateFieldType.Path)
337 .Select(f => f.AsPath()) 337 .Select(f => f.AsPath())
@@ -440,15 +440,15 @@ namespace WixToolset.Data
440 return entryName; 440 return entryName;
441 } 441 }
442 442
443 private Dictionary<string, IntermediateTupleDefinition> GetCustomDefinitionsInSections() 443 private Dictionary<string, IntermediateSymbolDefinition> GetCustomDefinitionsInSections()
444 { 444 {
445 var customDefinitions = new Dictionary<string, IntermediateTupleDefinition>(); 445 var customDefinitions = new Dictionary<string, IntermediateSymbolDefinition>();
446 446
447 foreach (var tuple in this.Sections.SelectMany(s => s.Tuples).Where(t => t.Definition.Type == TupleDefinitionType.MustBeFromAnExtension)) 447 foreach (var symbol in this.Sections.SelectMany(s => s.Symbols).Where(t => t.Definition.Type == SymbolDefinitionType.MustBeFromAnExtension))
448 { 448 {
449 if (!customDefinitions.ContainsKey(tuple.Definition.Name)) 449 if (!customDefinitions.ContainsKey(symbol.Definition.Name))
450 { 450 {
451 customDefinitions.Add(tuple.Definition.Name, tuple.Definition); 451 customDefinitions.Add(symbol.Definition.Name, symbol.Definition);
452 } 452 }
453 } 453 }
454 454