aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs4
-rw-r--r--src/wixext/DependencyCompiler.cs182
-rw-r--r--src/wixext/DependencyTableDefinitions.cs57
-rw-r--r--src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs18
-rw-r--r--src/wixext/Tuples/DependencyTupleDefinitions.cs4
-rw-r--r--src/wixext/Tuples/WixDependencyProviderTuple.cs87
-rw-r--r--src/wixext/Tuples/WixDependencyRefTuple.cs20
-rw-r--r--src/wixext/Tuples/WixDependencyTuple.cs8
-rw-r--r--src/wixext/WixToolset.Dependency.wixext.csproj1
-rw-r--r--src/wixext/tables.xml38
10 files changed, 151 insertions, 268 deletions
diff --git a/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs b/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs
index 07d6228e..823532ee 100644
--- a/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs
+++ b/src/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs
@@ -19,8 +19,8 @@ namespace WixToolsetTest.Dependency
19 var results = build.BuildAndQuery(Build, "WixDependencyProvider"); 19 var results = build.BuildAndQuery(Build, "WixDependencyProvider");
20 Assert.Equal(new[] 20 Assert.Equal(new[]
21 { 21 {
22 "WixDependencyProvider:depJQsOasf1FRUsKxq8THB9sXk8yws\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t0", 22 "WixDependencyProvider:depJQsOasf1FRUsKxq8THB9sXk8yws\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t",
23 }, results.OrderBy(s => s).ToArray()); 23 }, results);
24 } 24 }
25 25
26 private static void Build(string[] args) 26 private static void Build(string[] args)
diff --git a/src/wixext/DependencyCompiler.cs b/src/wixext/DependencyCompiler.cs
index dafcfb3e..4ec6f477 100644
--- a/src/wixext/DependencyCompiler.cs
+++ b/src/wixext/DependencyCompiler.cs
@@ -8,6 +8,8 @@ namespace WixToolset.Dependency
8 using System.Text; 8 using System.Text;
9 using System.Xml.Linq; 9 using System.Xml.Linq;
10 using WixToolset.Data; 10 using WixToolset.Data;
11 using WixToolset.Data.Tuples;
12 using WixToolset.Dependency.Tuples;
11 using WixToolset.Extensibility; 13 using WixToolset.Extensibility;
12 using WixToolset.Extensibility.Data; 14 using WixToolset.Extensibility.Data;
13 15
@@ -38,7 +40,7 @@ namespace WixToolset.Dependency
38 /// <param name="attribute">Attribute to process.</param> 40 /// <param name="attribute">Attribute to process.</param>
39 public override void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary<string, string> context) 41 public override void ParseAttribute(Intermediate intermediate, IntermediateSection section, XElement parentElement, XAttribute attribute, IDictionary<string, string> context)
40 { 42 {
41 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement); 43 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement);
42 switch (parentElement.Name.LocalName) 44 switch (parentElement.Name.LocalName)
43 { 45 {
44 case "Bundle": 46 case "Bundle":
@@ -67,7 +69,7 @@ namespace WixToolset.Dependency
67 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> 69 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
68 public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) 70 public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
69 { 71 {
70 PackageType packageType = PackageType.None; 72 var packageType = PackageType.None;
71 73
72 switch (parentElement.Name.LocalName) 74 switch (parentElement.Name.LocalName)
73 { 75 {
@@ -104,7 +106,7 @@ namespace WixToolset.Dependency
104 106
105 if (PackageType.None != packageType) 107 if (PackageType.None != packageType)
106 { 108 {
107 string packageId = context["PackageId"]; 109 var packageId = context["PackageId"];
108 110
109 switch (element.Name.LocalName) 111 switch (element.Name.LocalName)
110 { 112 {
@@ -127,17 +129,16 @@ namespace WixToolset.Dependency
127 /// <returns>The component key path type if set.</returns> 129 /// <returns>The component key path type if set.</returns>
128 public override IComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context) 130 public override IComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
129 { 131 {
130 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement); 132 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(parentElement);
131 IComponentKeyPath keyPath = null; 133 IComponentKeyPath keyPath = null;
132 134
133 switch (parentElement.Name.LocalName) 135 switch (parentElement.Name.LocalName)
134 { 136 {
135 case "Component": 137 case "Component":
136 string componentId = context["ComponentId"]; 138 var componentId = context["ComponentId"];
137 139
138 // 64-bit components may cause issues downlevel. 140 // 64-bit components may cause issues downlevel.
139 bool win64 = false; 141 Boolean.TryParse(context["Win64"], out var win64);
140 Boolean.TryParse(context["Win64"], out win64);
141 142
142 switch (element.Name.LocalName) 143 switch (element.Name.LocalName)
143 { 144 {
@@ -191,7 +192,7 @@ namespace WixToolset.Dependency
191 } 192 }
192 else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters))) 193 else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters)))
193 { 194 {
194 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); 195 var sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2);
195 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); 196 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" "));
196 197
197 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString())); 198 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString()));
@@ -206,12 +207,14 @@ namespace WixToolset.Dependency
206 207
207 if (!this.Messaging.EncounteredError) 208 if (!this.Messaging.EncounteredError)
208 { 209 {
209 // Create the provider row for the bundle. The Component_ field is required 210 // Create the provider tuple for the bundle. The Component_ field is required
210 // in the table definition but unused for bundles, so just set it to the valid ID. 211 // in the table definition but unused for bundles, so just set it to the valid ID.
211 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyProvider", id); 212 section.AddTuple(new WixDependencyProviderTuple(sourceLineNumbers, id)
212 row.Set(1, id.Id); 213 {
213 row.Set(2, providerKey); 214 ComponentRef = id.Id,
214 row.Set(5, DependencyCommon.ProvidesAttributesBundle); 215 ProviderKey = providerKey,
216 Attributes = WixDependencyProviderAttributes.ProvidesAttributesBundle,
217 });
215 } 218 }
216 } 219 }
217 220
@@ -225,16 +228,15 @@ namespace WixToolset.Dependency
225 /// <returns>The type of key path if set.</returns> 228 /// <returns>The type of key path if set.</returns>
226 private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, IntermediateSection section, XElement node, PackageType packageType, string parentId) 229 private IComponentKeyPath ParseProvidesElement(Intermediate intermediate, IntermediateSection section, XElement node, PackageType packageType, string parentId)
227 { 230 {
228 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); 231 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
229 IComponentKeyPath keyPath = null; 232 IComponentKeyPath keyPath = null;
230 Identifier id = null; 233 Identifier id = null;
231 string key = null; 234 string key = null;
232 string version = null; 235 string version = null;
233 string displayName = null; 236 string displayName = null;
234 int attributes = 0;
235 int illegalChar = -1; 237 int illegalChar = -1;
236 238
237 foreach (XAttribute attrib in node.Attributes()) 239 foreach (var attrib in node.Attributes())
238 { 240 {
239 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) 241 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
240 { 242 {
@@ -270,7 +272,7 @@ namespace WixToolset.Dependency
270 // Make sure the key does not contain any illegal characters or values. 272 // Make sure the key does not contain any illegal characters or values.
271 if (0 <= (illegalChar = key.IndexOfAny(DependencyCommon.InvalidCharacters))) 273 if (0 <= (illegalChar = key.IndexOfAny(DependencyCommon.InvalidCharacters)))
272 { 274 {
273 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); 275 var sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2);
274 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); 276 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" "));
275 277
276 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "Key", key[illegalChar], sb.ToString())); 278 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "Key", key[illegalChar], sb.ToString()));
@@ -288,7 +290,7 @@ namespace WixToolset.Dependency
288 else if (PackageType.None == packageType) 290 else if (PackageType.None == packageType)
289 { 291 {
290 // Make sure the ProductCode is authored and set the key. 292 // Make sure the ProductCode is authored and set the key.
291 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Property", "ProductCode"); 293 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.Property, "ProductCode");
292 key = "!(bind.property.ProductCode)"; 294 key = "!(bind.property.ProductCode)";
293 } 295 }
294 296
@@ -317,7 +319,7 @@ namespace WixToolset.Dependency
317 id = this.ParseHelper.CreateIdentifier("dep", node.Name.LocalName, parentId, key); 319 id = this.ParseHelper.CreateIdentifier("dep", node.Name.LocalName, parentId, key);
318 } 320 }
319 321
320 foreach (XElement child in node.Elements()) 322 foreach (var child in node.Elements())
321 { 323 {
322 if (this.Namespace == child.Name.Namespace) 324 if (this.Namespace == child.Name.Namespace)
323 { 325 {
@@ -342,24 +344,20 @@ namespace WixToolset.Dependency
342 344
343 if (!this.Messaging.EncounteredError) 345 if (!this.Messaging.EncounteredError)
344 { 346 {
345 // Create the row in the provider table. 347 var tuple = section.AddTuple(new WixDependencyProviderTuple(sourceLineNumbers, id)
346 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyProvider", id); 348 {
347 row.Set(1, parentId); 349 ComponentRef = parentId,
348 row.Set(2, key); 350 ProviderKey = key,
351 });
349 352
350 if (!String.IsNullOrEmpty(version)) 353 if (!String.IsNullOrEmpty(version))
351 { 354 {
352 row.Set(3, version); 355 tuple.Version = version;
353 } 356 }
354 357
355 if (!String.IsNullOrEmpty(displayName)) 358 if (!String.IsNullOrEmpty(displayName))
356 { 359 {
357 row.Set(4, displayName); 360 tuple.DisplayName = displayName;
358 }
359
360 if (0 != attributes)
361 {
362 row.Set(5, attributes);
363 } 361 }
364 362
365 if (PackageType.None == packageType) 363 if (PackageType.None == packageType)
@@ -377,44 +375,24 @@ namespace WixToolset.Dependency
377 } 375 }
378 376
379 // Generate registry rows for the provider using binder properties. 377 // Generate registry rows for the provider using binder properties.
380 string keyProvides = String.Concat(DependencyCommon.RegistryRoot, key); 378 var keyProvides = String.Concat(DependencyCommon.RegistryRoot, key);
379 var root = RegistryRootType.MachineUser;
380
381 var value = "[ProductCode]";
382 this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, null, value, parentId, false);
381 383
382 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "(Default)")); 384 value = !String.IsNullOrEmpty(version) ? version : "[ProductVersion]";
383 row.Set(1, -1); 385 var versionRegistryTuple =
384 row.Set(2, keyProvides); 386 this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, "Version", value, parentId, false);
385 row.Set(4, "[ProductCode]"); 387
386 row.Set(5, parentId); 388 value = !String.IsNullOrEmpty(displayName) ? displayName : "[ProductName]";
389 this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, root, keyProvides, "DisplayName", value, parentId, false);
387 390
388 // Use the Version registry value and use that as a potential key path. 391 // Use the Version registry value and use that as a potential key path.
389 Identifier idVersion = this.ParseHelper.CreateIdentifier("reg", id.Id, "Version");
390 keyPath = this.CreateComponentKeyPath(); 392 keyPath = this.CreateComponentKeyPath();
391 keyPath.Id = idVersion.Id; 393 keyPath.Id = versionRegistryTuple.Id;
392 keyPath.Explicit = false; 394 keyPath.Explicit = false;
393 keyPath.Type = PossibleKeyPathType.Registry; 395 keyPath.Type = PossibleKeyPathType.Registry;
394
395 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", idVersion);
396 row.Set(1, -1);
397 row.Set(2, keyProvides);
398 row.Set(3, "Version");
399 row.Set(4, !String.IsNullOrEmpty(version) ? version : "[ProductVersion]");
400 row.Set(5, parentId);
401
402 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "DisplayName"));
403 row.Set(1, -1);
404 row.Set(2, keyProvides);
405 row.Set(3, "DisplayName");
406 row.Set(4, !String.IsNullOrEmpty(displayName) ? displayName : "[ProductName]");
407 row.Set(5, parentId);
408
409 if (0 != attributes)
410 {
411 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "Registry", this.ParseHelper.CreateIdentifier("reg", id.Id, "Attributes"));
412 row.Set(1, -1);
413 row.Set(2, keyProvides);
414 row.Set(3, "Attributes");
415 row.Set(4, String.Concat("#", attributes.ToString(CultureInfo.InvariantCulture.NumberFormat)));
416 row.Set(5, parentId);
417 }
418 } 396 }
419 } 397 }
420 398
@@ -429,7 +407,7 @@ namespace WixToolset.Dependency
429 /// <param name="requiresAction">Whether the Requires custom action should be referenced.</param> 407 /// <param name="requiresAction">Whether the Requires custom action should be referenced.</param>
430 private void ParseRequiresElement(Intermediate intermediate, IntermediateSection section, XElement node, string providerId, bool requiresAction) 408 private void ParseRequiresElement(Intermediate intermediate, IntermediateSection section, XElement node, string providerId, bool requiresAction)
431 { 409 {
432 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); 410 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
433 Identifier id = null; 411 Identifier id = null;
434 string providerKey = null; 412 string providerKey = null;
435 string minVersion = null; 413 string minVersion = null;
@@ -437,7 +415,7 @@ namespace WixToolset.Dependency
437 int attributes = 0; 415 int attributes = 0;
438 int illegalChar = -1; 416 int illegalChar = -1;
439 417
440 foreach (XAttribute attrib in node.Attributes()) 418 foreach (var attrib in node.Attributes())
441 { 419 {
442 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) 420 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
443 { 421 {
@@ -502,47 +480,40 @@ namespace WixToolset.Dependency
502 // Make sure the key does not contain any illegal characters. 480 // Make sure the key does not contain any illegal characters.
503 else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters))) 481 else if (0 <= (illegalChar = providerKey.IndexOfAny(DependencyCommon.InvalidCharacters)))
504 { 482 {
505 StringBuilder sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2); 483 var sb = new StringBuilder(DependencyCommon.InvalidCharacters.Length * 2);
506 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" ")); 484 Array.ForEach<char>(DependencyCommon.InvalidCharacters, c => sb.Append(c).Append(" "));
507 485
508 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString())); 486 this.Messaging.Write(DependencyErrors.IllegalCharactersInProvider(sourceLineNumbers, "ProviderKey", providerKey[illegalChar], sb.ToString()));
509 } 487 }
510 488
511
512 if (!this.Messaging.EncounteredError) 489 if (!this.Messaging.EncounteredError)
513 { 490 {
514 // Reference the Require custom action if required. 491 // Reference the Require custom action if required.
515 if (requiresAction) 492 if (requiresAction)
516 { 493 {
517 if (Platform.ARM == this.Context.Platform) 494 this.AddReferenceToWixDependencyRequire(section, sourceLineNumbers);
518 {
519 // Ensure the ARM version of the CA is referenced.
520 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM");
521 }
522 else
523 {
524 // All other supported platforms use x86.
525 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire");
526 }
527 } 495 }
528 496
529 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependency", id); 497 var tuple = section.AddTuple(new WixDependencyTuple(sourceLineNumbers, id)
530 row.Set(1, providerKey); 498 {
531 row.Set(2, minVersion); 499 ProviderKey = providerKey,
532 row.Set(3, maxVersion); 500 MinVersion = minVersion,
501 MaxVersion = maxVersion,
502 });
533 503
534 if (0 != attributes) 504 if (0 != attributes)
535 { 505 {
536 row.Set(4, attributes); 506 tuple.Attributes = attributes;
537 } 507 }
538 508
539 // Create the relationship between this WixDependency row and the WixDependencyProvider row. 509 // Create the relationship between this WixDependency tuple and the WixDependencyProvider tuple.
540 if (!String.IsNullOrEmpty(providerId)) 510 if (!String.IsNullOrEmpty(providerId))
541 { 511 {
542 // Create the relationship between the WixDependency row and the parent WixDependencyProvider row. 512 section.AddTuple(new WixDependencyRefTuple(sourceLineNumbers)
543 row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyRef"); 513 {
544 row.Set(0, providerId); 514 WixDependencyProviderRef = providerId,
545 row.Set(1, id.Id); 515 WixDependencyRef = id.Id,
516 });
546 } 517 }
547 } 518 }
548 } 519 }
@@ -555,10 +526,10 @@ namespace WixToolset.Dependency
555 /// <param name="requiresAction">Whether the Requires custom action should be referenced.</param> 526 /// <param name="requiresAction">Whether the Requires custom action should be referenced.</param>
556 private void ParseRequiresRefElement(Intermediate intermediate, IntermediateSection section, XElement node, string providerId, bool requiresAction) 527 private void ParseRequiresRefElement(Intermediate intermediate, IntermediateSection section, XElement node, string providerId, bool requiresAction)
557 { 528 {
558 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); 529 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
559 string id = null; 530 string id = null;
560 531
561 foreach (XAttribute attrib in node.Attributes()) 532 foreach (var attrib in node.Attributes())
562 { 533 {
563 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) 534 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
564 { 535 {
@@ -590,25 +561,32 @@ namespace WixToolset.Dependency
590 // Reference the Require custom action if required. 561 // Reference the Require custom action if required.
591 if (requiresAction) 562 if (requiresAction)
592 { 563 {
593 if (Platform.ARM == this.Context.Platform) 564 this.AddReferenceToWixDependencyRequire(section, sourceLineNumbers);
594 {
595 // Ensure the ARM version of the CA is referenced.
596 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM");
597 }
598 else
599 {
600 // All other supported platforms use x86.
601 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire");
602 }
603 } 565 }
604 566
605 // Create a link dependency on the row that contains information we'll need during bind. 567 // Create a link dependency on the row that contains information we'll need during bind.
606 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixDependency", id); 568 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, DependencyTupleDefinitions.WixDependency, id);
607 569
608 // Create the relationship between the WixDependency row and the parent WixDependencyProvider row. 570 // Create the relationship between the WixDependency row and the parent WixDependencyProvider row.
609 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixDependencyRef"); 571 section.AddTuple(new WixDependencyRefTuple(sourceLineNumbers)
610 row.Set(0, providerId); 572 {
611 row.Set(1, id); 573 WixDependencyProviderRef = providerId,
574 WixDependencyRef = id,
575 });
576 }
577 }
578
579 private void AddReferenceToWixDependencyRequire(IntermediateSection section, SourceLineNumber sourceLineNumbers)
580 {
581 if (Platform.ARM == this.Context.Platform)
582 {
583 // Ensure the ARM version of the CA is referenced.
584 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire_ARM");
585 }
586 else
587 {
588 // All other supported platforms use x86.
589 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixDependencyRequire");
612 } 590 }
613 } 591 }
614 } 592 }
diff --git a/src/wixext/DependencyTableDefinitions.cs b/src/wixext/DependencyTableDefinitions.cs
new file mode 100644
index 00000000..bc3e880a
--- /dev/null
+++ b/src/wixext/DependencyTableDefinitions.cs
@@ -0,0 +1,57 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Dependency
4{
5 using WixToolset.Data;
6 using WixToolset.Data.WindowsInstaller;
7
8 public static class DependencyTableDefinitions
9 {
10 public static readonly TableDefinition WixDependencyProvider = new TableDefinition(
11 "WixDependencyProvider",
12 new[]
13 {
14 new ColumnDefinition("WixDependencyProvider", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column),
15 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "The foreign key into the Component table used to determine install state.", modularizeType: ColumnModularizeType.Column),
16 new ColumnDefinition("ProviderKey", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Text, description: "The name of the registry key that holds the provider identity."),
17 new ColumnDefinition("Version", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Version, description: "The version of the package."),
18 new ColumnDefinition("DisplayName", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "The display name of the package."),
19 new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "A 32-bit word that specifies the attribute flags to be applied."),
20 },
21 tupleDefinitionName: TupleDefinitions.WixDependencyProvider.Name,
22 tupleIdIsPrimaryKey: true
23 );
24
25 public static readonly TableDefinition WixDependency = new TableDefinition(
26 "WixDependency",
27 new[]
28 {
29 new ColumnDefinition("WixDependency", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column),
30 new ColumnDefinition("ProviderKey", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Text, description: "The name of the registry key that holds the provider identity."),
31 new ColumnDefinition("MinVersion", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Version, description: "The minimum version of the provider supported."),
32 new ColumnDefinition("MaxVersion", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Version, description: "The maximum version of the provider supported."),
33 new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "A 32-bit word that specifies the attribute flags to be applied."),
34 },
35 tupleDefinitionName: DependencyTupleDefinitions.WixDependency.Name,
36 tupleIdIsPrimaryKey: true
37 );
38
39 public static readonly TableDefinition WixDependencyRef = new TableDefinition(
40 "WixDependencyRef",
41 new[]
42 {
43 new ColumnDefinition("WixDependencyProvider_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "WixDependencyProvider", keyColumn: 1, description: "Foreign key into the Component table.", modularizeType: ColumnModularizeType.Column),
44 new ColumnDefinition("WixDependency_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "WixDependency", keyColumn: 1, description: "Foreign key into the WixDependency table.", modularizeType: ColumnModularizeType.Column),
45 },
46 tupleDefinitionName: DependencyTupleDefinitions.WixDependencyRef.Name,
47 tupleIdIsPrimaryKey: false
48 );
49
50 public static readonly TableDefinition[] All = new[]
51 {
52 WixDependencyProvider,
53 WixDependency,
54 WixDependencyRef,
55 };
56 }
57}
diff --git a/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs b/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs
index 265fdd4f..f52f97f3 100644
--- a/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs
+++ b/src/wixext/DependencyWindowsInstallerBackendBinderExtension.cs
@@ -3,28 +3,14 @@
3namespace WixToolset.Dependency 3namespace WixToolset.Dependency
4{ 4{
5 using System.Collections.Generic; 5 using System.Collections.Generic;
6 using System.Linq;
7 using System.Xml;
8 using WixToolset.Data.WindowsInstaller; 6 using WixToolset.Data.WindowsInstaller;
9 using WixToolset.Extensibility; 7 using WixToolset.Extensibility;
10 8
11 public class DependencyWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension 9 public class DependencyWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension
12 { 10 {
13 private static readonly TableDefinition[] Tables = LoadTables(); 11 public override IEnumerable<TableDefinition> TableDefinitions => DependencyTableDefinitions.All;
14 12
15 public override IEnumerable<TableDefinition> TableDefinitions => Tables; 13#if TODO_DEPENDENCY_BINDER_EXTENSION
16
17 private static TableDefinition[] LoadTables()
18 {
19 using (var resourceStream = typeof(DependencyWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Dependency.tables.xml"))
20 using (var reader = XmlReader.Create(resourceStream))
21 {
22 var tables = TableDefinitionCollection.Load(reader);
23 return tables.ToArray();
24 }
25 }
26
27#if TODO_TAG_BINDER_EXTENSION
28 private Output output; 14 private Output output;
29 15
30 /// <summary> 16 /// <summary>
diff --git a/src/wixext/Tuples/DependencyTupleDefinitions.cs b/src/wixext/Tuples/DependencyTupleDefinitions.cs
index fdd3f0b5..3309b0a5 100644
--- a/src/wixext/Tuples/DependencyTupleDefinitions.cs
+++ b/src/wixext/Tuples/DependencyTupleDefinitions.cs
@@ -8,7 +8,6 @@ namespace WixToolset.Dependency
8 public enum DependencyTupleDefinitionType 8 public enum DependencyTupleDefinitionType
9 { 9 {
10 WixDependency, 10 WixDependency,
11 WixDependencyProvider,
12 WixDependencyRef, 11 WixDependencyRef,
13 } 12 }
14 13
@@ -33,9 +32,6 @@ namespace WixToolset.Dependency
33 case DependencyTupleDefinitionType.WixDependency: 32 case DependencyTupleDefinitionType.WixDependency:
34 return DependencyTupleDefinitions.WixDependency; 33 return DependencyTupleDefinitions.WixDependency;
35 34
36 case DependencyTupleDefinitionType.WixDependencyProvider:
37 return DependencyTupleDefinitions.WixDependencyProvider;
38
39 case DependencyTupleDefinitionType.WixDependencyRef: 35 case DependencyTupleDefinitionType.WixDependencyRef:
40 return DependencyTupleDefinitions.WixDependencyRef; 36 return DependencyTupleDefinitions.WixDependencyRef;
41 37
diff --git a/src/wixext/Tuples/WixDependencyProviderTuple.cs b/src/wixext/Tuples/WixDependencyProviderTuple.cs
deleted file mode 100644
index 2fd6a805..00000000
--- a/src/wixext/Tuples/WixDependencyProviderTuple.cs
+++ /dev/null
@@ -1,87 +0,0 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Dependency
4{
5 using WixToolset.Data;
6 using WixToolset.Dependency.Tuples;
7
8 public static partial class DependencyTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition WixDependencyProvider = new IntermediateTupleDefinition(
11 DependencyTupleDefinitionType.WixDependencyProvider.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.WixDependencyProvider), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Component_), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.ProviderKey), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Version), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.DisplayName), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Attributes), IntermediateFieldType.Number),
20 },
21 typeof(WixDependencyProviderTuple));
22 }
23}
24
25namespace WixToolset.Dependency.Tuples
26{
27 using WixToolset.Data;
28
29 public enum WixDependencyProviderTupleFields
30 {
31 WixDependencyProvider,
32 Component_,
33 ProviderKey,
34 Version,
35 DisplayName,
36 Attributes,
37 }
38
39 public class WixDependencyProviderTuple : IntermediateTuple
40 {
41 public WixDependencyProviderTuple() : base(DependencyTupleDefinitions.WixDependencyProvider, null, null)
42 {
43 }
44
45 public WixDependencyProviderTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DependencyTupleDefinitions.WixDependencyProvider, sourceLineNumber, id)
46 {
47 }
48
49 public IntermediateField this[WixDependencyProviderTupleFields index] => this.Fields[(int)index];
50
51 public string WixDependencyProvider
52 {
53 get => this.Fields[(int)WixDependencyProviderTupleFields.WixDependencyProvider].AsString();
54 set => this.Set((int)WixDependencyProviderTupleFields.WixDependencyProvider, value);
55 }
56
57 public string Component_
58 {
59 get => this.Fields[(int)WixDependencyProviderTupleFields.Component_].AsString();
60 set => this.Set((int)WixDependencyProviderTupleFields.Component_, value);
61 }
62
63 public string ProviderKey
64 {
65 get => this.Fields[(int)WixDependencyProviderTupleFields.ProviderKey].AsString();
66 set => this.Set((int)WixDependencyProviderTupleFields.ProviderKey, value);
67 }
68
69 public string Version
70 {
71 get => this.Fields[(int)WixDependencyProviderTupleFields.Version].AsString();
72 set => this.Set((int)WixDependencyProviderTupleFields.Version, value);
73 }
74
75 public string DisplayName
76 {
77 get => this.Fields[(int)WixDependencyProviderTupleFields.DisplayName].AsString();
78 set => this.Set((int)WixDependencyProviderTupleFields.DisplayName, value);
79 }
80
81 public int Attributes
82 {
83 get => this.Fields[(int)WixDependencyProviderTupleFields.Attributes].AsNumber();
84 set => this.Set((int)WixDependencyProviderTupleFields.Attributes, value);
85 }
86 }
87} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixDependencyRefTuple.cs b/src/wixext/Tuples/WixDependencyRefTuple.cs
index 3e996f5f..9b5a5eed 100644
--- a/src/wixext/Tuples/WixDependencyRefTuple.cs
+++ b/src/wixext/Tuples/WixDependencyRefTuple.cs
@@ -11,8 +11,8 @@ namespace WixToolset.Dependency
11 DependencyTupleDefinitionType.WixDependencyRef.ToString(), 11 DependencyTupleDefinitionType.WixDependencyRef.ToString(),
12 new[] 12 new[]
13 { 13 {
14 new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyProvider_), IntermediateFieldType.String), 14 new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyProviderRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependency_), IntermediateFieldType.String), 15 new IntermediateFieldDefinition(nameof(WixDependencyRefTupleFields.WixDependencyRef), IntermediateFieldType.String),
16 }, 16 },
17 typeof(WixDependencyRefTuple)); 17 typeof(WixDependencyRefTuple));
18 } 18 }
@@ -24,8 +24,8 @@ namespace WixToolset.Dependency.Tuples
24 24
25 public enum WixDependencyRefTupleFields 25 public enum WixDependencyRefTupleFields
26 { 26 {
27 WixDependencyProvider_, 27 WixDependencyProviderRef,
28 WixDependency_, 28 WixDependencyRef,
29 } 29 }
30 30
31 public class WixDependencyRefTuple : IntermediateTuple 31 public class WixDependencyRefTuple : IntermediateTuple
@@ -40,16 +40,16 @@ namespace WixToolset.Dependency.Tuples
40 40
41 public IntermediateField this[WixDependencyRefTupleFields index] => this.Fields[(int)index]; 41 public IntermediateField this[WixDependencyRefTupleFields index] => this.Fields[(int)index];
42 42
43 public string WixDependencyProvider_ 43 public string WixDependencyProviderRef
44 { 44 {
45 get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyProvider_].AsString(); 45 get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyProviderRef].AsString();
46 set => this.Set((int)WixDependencyRefTupleFields.WixDependencyProvider_, value); 46 set => this.Set((int)WixDependencyRefTupleFields.WixDependencyProviderRef, value);
47 } 47 }
48 48
49 public string WixDependency_ 49 public string WixDependencyRef
50 { 50 {
51 get => this.Fields[(int)WixDependencyRefTupleFields.WixDependency_].AsString(); 51 get => this.Fields[(int)WixDependencyRefTupleFields.WixDependencyRef].AsString();
52 set => this.Set((int)WixDependencyRefTupleFields.WixDependency_, value); 52 set => this.Set((int)WixDependencyRefTupleFields.WixDependencyRef, value);
53 } 53 }
54 } 54 }
55} \ No newline at end of file 55} \ No newline at end of file
diff --git a/src/wixext/Tuples/WixDependencyTuple.cs b/src/wixext/Tuples/WixDependencyTuple.cs
index 81e05ad1..1d62ae58 100644
--- a/src/wixext/Tuples/WixDependencyTuple.cs
+++ b/src/wixext/Tuples/WixDependencyTuple.cs
@@ -11,7 +11,6 @@ namespace WixToolset.Dependency
11 DependencyTupleDefinitionType.WixDependency.ToString(), 11 DependencyTupleDefinitionType.WixDependency.ToString(),
12 new[] 12 new[]
13 { 13 {
14 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.WixDependency), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.ProviderKey), IntermediateFieldType.String), 14 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.ProviderKey), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MinVersion), IntermediateFieldType.String), 15 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MinVersion), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MaxVersion), IntermediateFieldType.String), 16 new IntermediateFieldDefinition(nameof(WixDependencyTupleFields.MaxVersion), IntermediateFieldType.String),
@@ -27,7 +26,6 @@ namespace WixToolset.Dependency.Tuples
27 26
28 public enum WixDependencyTupleFields 27 public enum WixDependencyTupleFields
29 { 28 {
30 WixDependency,
31 ProviderKey, 29 ProviderKey,
32 MinVersion, 30 MinVersion,
33 MaxVersion, 31 MaxVersion,
@@ -46,12 +44,6 @@ namespace WixToolset.Dependency.Tuples
46 44
47 public IntermediateField this[WixDependencyTupleFields index] => this.Fields[(int)index]; 45 public IntermediateField this[WixDependencyTupleFields index] => this.Fields[(int)index];
48 46
49 public string WixDependency
50 {
51 get => this.Fields[(int)WixDependencyTupleFields.WixDependency].AsString();
52 set => this.Set((int)WixDependencyTupleFields.WixDependency, value);
53 }
54
55 public string ProviderKey 47 public string ProviderKey
56 { 48 {
57 get => this.Fields[(int)WixDependencyTupleFields.ProviderKey].AsString(); 49 get => this.Fields[(int)WixDependencyTupleFields.ProviderKey].AsString();
diff --git a/src/wixext/WixToolset.Dependency.wixext.csproj b/src/wixext/WixToolset.Dependency.wixext.csproj
index 7e9f1e3a..0221c1c6 100644
--- a/src/wixext/WixToolset.Dependency.wixext.csproj
+++ b/src/wixext/WixToolset.Dependency.wixext.csproj
@@ -14,7 +14,6 @@
14 <ItemGroup> 14 <ItemGroup>
15 <Content Include="$(MSBuildThisFileName).targets" /> 15 <Content Include="$(MSBuildThisFileName).targets" />
16 <Content Include="dependency.xsd" PackagePath="tools" /> 16 <Content Include="dependency.xsd" PackagePath="tools" />
17 <EmbeddedResource Include="tables.xml" />
18 <EmbeddedResource Include="$(OutputPath)..\dependency.wixlib" /> 17 <EmbeddedResource Include="$(OutputPath)..\dependency.wixlib" />
19 </ItemGroup> 18 </ItemGroup>
20 19
diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml
deleted file mode 100644
index 03c9f267..00000000
--- a/src/wixext/tables.xml
+++ /dev/null
@@ -1,38 +0,0 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<tableDefinitions xmlns="http://wixtoolset.org/schemas/v4/wi/tables">
6 <tableDefinition name="WixDependencyProvider" createSymbols="yes">
7 <columnDefinition name="WixDependencyProvider" type="string" length="72" primaryKey="yes" modularize="column"
8 category="identifier" description="The non-localized primary key for the table."/>
9 <columnDefinition name="Component_" type="string" length="72" keyTable="Component" keyColumn="1" modularize="column"
10 category="identifier" description="The foreign key into the Component table used to determine install state."/>
11 <columnDefinition name="ProviderKey" type="string" length="255"
12 category="text" description="The name of the registry key that holds the provider identity."/>
13 <columnDefinition name="Version" type="string" length="72" nullable="yes"
14 category="version" description="The version of the package."/>
15 <columnDefinition name="DisplayName" type="string" length="255" nullable="yes"
16 category="text" description="The display name of the package."/>
17 <columnDefinition name="Attributes" type="number" length="4" nullable="yes"
18 minValue="0" maxValue="2147483647" description="A 32-bit word that specifies the attribute flags to be applied."/>
19 </tableDefinition>
20 <tableDefinition name="WixDependency" createSymbols="yes">
21 <columnDefinition name="WixDependency" type="string" length="72" primaryKey="yes" modularize="column"
22 category="identifier" description="The non-localized primary key for the table."/>
23 <columnDefinition name="ProviderKey" type="string" length="255"
24 category="text" description="The name of the registry key that holds the provider identity."/>
25 <columnDefinition name="MinVersion" type="string" length="72" nullable="yes"
26 category="version" description="The minimum version of the provider supported."/>
27 <columnDefinition name="MaxVersion" type="string" length="72" nullable="yes"
28 category="version" description="The maximum version of the provider supported."/>
29 <columnDefinition name="Attributes" type="number" length="4" nullable="yes"
30 minValue="0" maxValue="2147483647" description="A 32-bit word that specifies the attribute flags to be applied."/>
31 </tableDefinition>
32 <tableDefinition name="WixDependencyRef" createSymbols="yes">
33 <columnDefinition name="WixDependencyProvider_" type="string" length="72" primaryKey="yes" keyTable="WixDependencyProvider" keyColumn="1" modularize="column"
34 category="identifier" description="Foreign key into the Component table." />
35 <columnDefinition name="WixDependency_" type="string" length="72" primaryKey="yes" keyTable="WixDependency" keyColumn="1" modularize="column"
36 category="identifier" description="Foreign key into the WixDependency table." />
37 </tableDefinition>
38</tableDefinitions>