diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-07 17:48:46 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-07 20:38:38 +1000 |
commit | 75f30802e00401df576ba351a24b0d26711e900e (patch) | |
tree | 6102575664d0a9d3d36509459f5cbbf744b49701 /src/wixext | |
parent | bee269e29d80e1f4b7df60b92808780f7489183d (diff) | |
download | wix-75f30802e00401df576ba351a24b0d26711e900e.tar.gz wix-75f30802e00401df576ba351a24b0d26711e900e.tar.bz2 wix-75f30802e00401df576ba351a24b0d26711e900e.zip |
Modernize UtilCompiler.
Diffstat (limited to 'src/wixext')
-rw-r--r-- | src/wixext/Tuples/GroupTuple.cs | 8 | ||||
-rw-r--r-- | src/wixext/UtilCompiler.cs | 505 | ||||
-rw-r--r-- | src/wixext/UtilTableDefinitions.cs | 300 | ||||
-rw-r--r-- | src/wixext/UtilWindowsInstallerBackendExtension.cs | 16 | ||||
-rw-r--r-- | src/wixext/WixToolset.Util.wixext.csproj | 1 | ||||
-rw-r--r-- | src/wixext/tables.xml | 238 |
6 files changed, 535 insertions, 533 deletions
diff --git a/src/wixext/Tuples/GroupTuple.cs b/src/wixext/Tuples/GroupTuple.cs index 6061b1f4..2b270103 100644 --- a/src/wixext/Tuples/GroupTuple.cs +++ b/src/wixext/Tuples/GroupTuple.cs | |||
@@ -11,7 +11,6 @@ namespace WixToolset.Util | |||
11 | UtilTupleDefinitionType.Group.ToString(), | 11 | UtilTupleDefinitionType.Group.ToString(), |
12 | new[] | 12 | new[] |
13 | { | 13 | { |
14 | new IntermediateFieldDefinition(nameof(GroupTupleFields.Group), IntermediateFieldType.String), | ||
15 | new IntermediateFieldDefinition(nameof(GroupTupleFields.ComponentRef), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(GroupTupleFields.ComponentRef), IntermediateFieldType.String), |
16 | new IntermediateFieldDefinition(nameof(GroupTupleFields.Name), IntermediateFieldType.String), | 15 | new IntermediateFieldDefinition(nameof(GroupTupleFields.Name), IntermediateFieldType.String), |
17 | new IntermediateFieldDefinition(nameof(GroupTupleFields.Domain), IntermediateFieldType.String), | 16 | new IntermediateFieldDefinition(nameof(GroupTupleFields.Domain), IntermediateFieldType.String), |
@@ -26,7 +25,6 @@ namespace WixToolset.Util.Tuples | |||
26 | 25 | ||
27 | public enum GroupTupleFields | 26 | public enum GroupTupleFields |
28 | { | 27 | { |
29 | Group, | ||
30 | ComponentRef, | 28 | ComponentRef, |
31 | Name, | 29 | Name, |
32 | Domain, | 30 | Domain, |
@@ -44,12 +42,6 @@ namespace WixToolset.Util.Tuples | |||
44 | 42 | ||
45 | public IntermediateField this[GroupTupleFields index] => this.Fields[(int)index]; | 43 | public IntermediateField this[GroupTupleFields index] => this.Fields[(int)index]; |
46 | 44 | ||
47 | public string Group | ||
48 | { | ||
49 | get => this.Fields[(int)GroupTupleFields.Group].AsString(); | ||
50 | set => this.Set((int)GroupTupleFields.Group, value); | ||
51 | } | ||
52 | |||
53 | public string ComponentRef | 45 | public string ComponentRef |
54 | { | 46 | { |
55 | get => this.Fields[(int)GroupTupleFields.ComponentRef].AsString(); | 47 | get => this.Fields[(int)GroupTupleFields.ComponentRef].AsString(); |
diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs index fef9175e..65ca406d 100644 --- a/src/wixext/UtilCompiler.cs +++ b/src/wixext/UtilCompiler.cs | |||
@@ -112,11 +112,11 @@ namespace WixToolset.Util | |||
112 | switch (parentElement.Name.LocalName) | 112 | switch (parentElement.Name.LocalName) |
113 | { | 113 | { |
114 | case "CreateFolder": | 114 | case "CreateFolder": |
115 | string createFolderId = context["DirectoryId"]; | 115 | var createFolderId = context["DirectoryId"]; |
116 | string createFolderComponentId = context["ComponentId"]; | 116 | var createFolderComponentId = context["ComponentId"]; |
117 | 117 | ||
118 | // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown | 118 | // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown |
119 | bool createFolderWin64 = Boolean.Parse(context["Win64"]); | 119 | var createFolderWin64 = Boolean.Parse(context["Win64"]); |
120 | 120 | ||
121 | switch (element.Name.LocalName) | 121 | switch (element.Name.LocalName) |
122 | { | 122 | { |
@@ -129,9 +129,9 @@ namespace WixToolset.Util | |||
129 | } | 129 | } |
130 | break; | 130 | break; |
131 | case "Component": | 131 | case "Component": |
132 | string componentId = context["ComponentId"]; | 132 | var componentId = context["ComponentId"]; |
133 | string directoryId = context["DirectoryId"]; | 133 | var directoryId = context["DirectoryId"]; |
134 | bool componentWin64 = Boolean.Parse(context["Win64"]); | 134 | var componentWin64 = Boolean.Parse(context["Win64"]); |
135 | 135 | ||
136 | switch (element.Name.LocalName) | 136 | switch (element.Name.LocalName) |
137 | { | 137 | { |
@@ -174,11 +174,11 @@ namespace WixToolset.Util | |||
174 | } | 174 | } |
175 | break; | 175 | break; |
176 | case "File": | 176 | case "File": |
177 | string fileId = context["FileId"]; | 177 | var fileId = context["FileId"]; |
178 | string fileComponentId = context["ComponentId"]; | 178 | var fileComponentId = context["ComponentId"]; |
179 | 179 | ||
180 | // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown | 180 | // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown |
181 | bool fileWin64 = Boolean.Parse(context["Win64"]); | 181 | var fileWin64 = Boolean.Parse(context["Win64"]); |
182 | 182 | ||
183 | switch (element.Name.LocalName) | 183 | switch (element.Name.LocalName) |
184 | { | 184 | { |
@@ -298,11 +298,11 @@ namespace WixToolset.Util | |||
298 | case "Registry": | 298 | case "Registry": |
299 | case "RegistryKey": | 299 | case "RegistryKey": |
300 | case "RegistryValue": | 300 | case "RegistryValue": |
301 | string registryId = context["RegistryId"]; | 301 | var registryId = context["RegistryId"]; |
302 | string registryComponentId = context["ComponentId"]; | 302 | var registryComponentId = context["ComponentId"]; |
303 | 303 | ||
304 | // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown | 304 | // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown |
305 | bool registryWin64 = Boolean.Parse(context["Win64"]); | 305 | var registryWin64 = Boolean.Parse(context["Win64"]); |
306 | 306 | ||
307 | switch (element.Name.LocalName) | 307 | switch (element.Name.LocalName) |
308 | { | 308 | { |
@@ -315,12 +315,12 @@ namespace WixToolset.Util | |||
315 | } | 315 | } |
316 | break; | 316 | break; |
317 | case "ServiceInstall": | 317 | case "ServiceInstall": |
318 | string serviceInstallId = context["ServiceInstallId"]; | 318 | var serviceInstallId = context["ServiceInstallId"]; |
319 | string serviceInstallName = context["ServiceInstallName"]; | 319 | var serviceInstallName = context["ServiceInstallName"]; |
320 | string serviceInstallComponentId = context["ServiceInstallComponentId"]; | 320 | var serviceInstallComponentId = context["ServiceInstallComponentId"]; |
321 | 321 | ||
322 | // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown | 322 | // If this doesn't parse successfully, something really odd is going on, so let the exception get thrown |
323 | bool serviceInstallWin64 = Boolean.Parse(context["Win64"]); | 323 | var serviceInstallWin64 = Boolean.Parse(context["Win64"]); |
324 | 324 | ||
325 | switch (element.Name.LocalName) | 325 | switch (element.Name.LocalName) |
326 | { | 326 | { |
@@ -381,16 +381,16 @@ namespace WixToolset.Util | |||
381 | /// <param name="element">Element to parse.</param> | 381 | /// <param name="element">Element to parse.</param> |
382 | private void ParseComponentSearchElement(Intermediate intermediate, IntermediateSection section, XElement element) | 382 | private void ParseComponentSearchElement(Intermediate intermediate, IntermediateSection section, XElement element) |
383 | { | 383 | { |
384 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 384 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
385 | Identifier id = null; | 385 | Identifier id = null; |
386 | string variable = null; | 386 | string variable = null; |
387 | string condition = null; | 387 | string condition = null; |
388 | string after = null; | 388 | string after = null; |
389 | string guid = null; | 389 | string guid = null; |
390 | string productCode = null; | 390 | string productCode = null; |
391 | Serialize.ComponentSearch.ResultType result = Serialize.ComponentSearch.ResultType.NotSet; | 391 | var result = Serialize.ComponentSearch.ResultType.NotSet; |
392 | 392 | ||
393 | foreach (XAttribute attrib in element.Attributes()) | 393 | foreach (var attrib in element.Attributes()) |
394 | { | 394 | { |
395 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 395 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
396 | { | 396 | { |
@@ -409,7 +409,7 @@ namespace WixToolset.Util | |||
409 | productCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib); | 409 | productCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib); |
410 | break; | 410 | break; |
411 | case "Result": | 411 | case "Result": |
412 | string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 412 | var resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
413 | if (!Serialize.ComponentSearch.TryParseResultType(resultValue, out result)) | 413 | if (!Serialize.ComponentSearch.TryParseResultType(resultValue, out result)) |
414 | { | 414 | { |
415 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, | 415 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, |
@@ -446,7 +446,7 @@ namespace WixToolset.Util | |||
446 | 446 | ||
447 | if (!this.Messaging.EncounteredError) | 447 | if (!this.Messaging.EncounteredError) |
448 | { | 448 | { |
449 | WixComponentSearchAttributes attributes = WixComponentSearchAttributes.KeyPath; | 449 | var attributes = WixComponentSearchAttributes.KeyPath; |
450 | switch (result) | 450 | switch (result) |
451 | { | 451 | { |
452 | case Serialize.ComponentSearch.ResultType.directory: | 452 | case Serialize.ComponentSearch.ResultType.directory: |
@@ -460,7 +460,7 @@ namespace WixToolset.Util | |||
460 | break; | 460 | break; |
461 | } | 461 | } |
462 | 462 | ||
463 | section.Tuples.Add(new WixComponentSearchTuple(sourceLineNumbers, id) | 463 | section.AddTuple(new WixComponentSearchTuple(sourceLineNumbers, id) |
464 | { | 464 | { |
465 | Guid = guid, | 465 | Guid = guid, |
466 | ProductCode = productCode, | 466 | ProductCode = productCode, |
@@ -475,10 +475,10 @@ namespace WixToolset.Util | |||
475 | /// <param name="element">Element to parse.</param> | 475 | /// <param name="element">Element to parse.</param> |
476 | private void ParseComponentSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement element) | 476 | private void ParseComponentSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement element) |
477 | { | 477 | { |
478 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 478 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
479 | string refId = null; | 479 | string refId = null; |
480 | 480 | ||
481 | foreach (XAttribute attrib in element.Attributes()) | 481 | foreach (var attrib in element.Attributes()) |
482 | { | 482 | { |
483 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 483 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
484 | { | 484 | { |
@@ -486,7 +486,7 @@ namespace WixToolset.Util | |||
486 | { | 486 | { |
487 | case "Id": | 487 | case "Id": |
488 | refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 488 | refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
489 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixComponentSearch", refId); | 489 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.WixComponentSearch, refId); |
490 | break; | 490 | break; |
491 | default: | 491 | default: |
492 | this.ParseHelper.UnexpectedAttribute(element, attrib); | 492 | this.ParseHelper.UnexpectedAttribute(element, attrib); |
@@ -548,7 +548,7 @@ namespace WixToolset.Util | |||
548 | 548 | ||
549 | if (!this.Messaging.EncounteredError) | 549 | if (!this.Messaging.EncounteredError) |
550 | { | 550 | { |
551 | section.Tuples.Add(new WixDetectSHA2SupportTuple(sourceLineNumbers, id)); | 551 | section.AddTuple(new WixDetectSHA2SupportTuple(sourceLineNumbers, id)); |
552 | } | 552 | } |
553 | } | 553 | } |
554 | 554 | ||
@@ -559,7 +559,6 @@ namespace WixToolset.Util | |||
559 | private void ParseDetectSHA2SupportRefElement(Intermediate intermediate, IntermediateSection section, XElement element) | 559 | private void ParseDetectSHA2SupportRefElement(Intermediate intermediate, IntermediateSection section, XElement element) |
560 | { | 560 | { |
561 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 561 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
562 | string refId = null; | ||
563 | 562 | ||
564 | foreach (var attrib in element.Attributes()) | 563 | foreach (var attrib in element.Attributes()) |
565 | { | 564 | { |
@@ -568,8 +567,8 @@ namespace WixToolset.Util | |||
568 | switch (attrib.Name.LocalName) | 567 | switch (attrib.Name.LocalName) |
569 | { | 568 | { |
570 | case "Id": | 569 | case "Id": |
571 | refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 570 | var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
572 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixDetectSHA2Support", refId); | 571 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilTupleDefinitions.WixDetectSHA2Support, refId); |
573 | break; | 572 | break; |
574 | default: | 573 | default: |
575 | this.ParseHelper.UnexpectedAttribute(element, attrib); | 574 | this.ParseHelper.UnexpectedAttribute(element, attrib); |
@@ -592,17 +591,17 @@ namespace WixToolset.Util | |||
592 | /// <param name="componentId">Identifier of parent component.</param> | 591 | /// <param name="componentId">Identifier of parent component.</param> |
593 | private IComponentKeyPath ParseEventSourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 592 | private IComponentKeyPath ParseEventSourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
594 | { | 593 | { |
595 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 594 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
596 | string sourceName = null; | 595 | string sourceName = null; |
597 | string logName = null; | 596 | string logName = null; |
598 | string categoryMessageFile = null; | 597 | string categoryMessageFile = null; |
599 | int categoryCount = CompilerConstants.IntegerNotSet; | 598 | var categoryCount = CompilerConstants.IntegerNotSet; |
600 | string eventMessageFile = null; | 599 | string eventMessageFile = null; |
601 | string parameterMessageFile = null; | 600 | string parameterMessageFile = null; |
602 | int typesSupported = 0; | 601 | int typesSupported = 0; |
603 | bool isKeyPath = false; | 602 | var isKeyPath = false; |
604 | 603 | ||
605 | foreach (XAttribute attrib in element.Attributes()) | 604 | foreach (var attrib in element.Attributes()) |
606 | { | 605 | { |
607 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 606 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
608 | { | 607 | { |
@@ -702,7 +701,7 @@ namespace WixToolset.Util | |||
702 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | 701 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); |
703 | 702 | ||
704 | string eventSourceKey = $@"SYSTEM\CurrentControlSet\Services\EventLog\{logName}\{sourceName}"; | 703 | string eventSourceKey = $@"SYSTEM\CurrentControlSet\Services\EventLog\{logName}\{sourceName}"; |
705 | Identifier id = this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "EventMessageFile", String.Concat("#%", eventMessageFile), componentId, false); | 704 | var id = this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, eventSourceKey, "EventMessageFile", String.Concat("#%", eventMessageFile), componentId, false); |
706 | 705 | ||
707 | if (null != categoryMessageFile) | 706 | if (null != categoryMessageFile) |
708 | { | 707 | { |
@@ -737,18 +736,18 @@ namespace WixToolset.Util | |||
737 | /// <param name="element">Element to parse.</param> | 736 | /// <param name="element">Element to parse.</param> |
738 | private void ParseCloseApplicationElement(Intermediate intermediate, IntermediateSection section, XElement element) | 737 | private void ParseCloseApplicationElement(Intermediate intermediate, IntermediateSection section, XElement element) |
739 | { | 738 | { |
740 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 739 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
741 | string condition = null; | 740 | string condition = null; |
742 | string description = null; | 741 | string description = null; |
743 | string target = null; | 742 | string target = null; |
744 | string property = null; | 743 | string property = null; |
745 | Identifier id = null; | 744 | Identifier id = null; |
746 | int attributes = 2; // default to CLOSEAPP_ATTRIBUTE_REBOOTPROMPT enabled | 745 | int attributes = 2; // default to CLOSEAPP_ATTRIBUTE_REBOOTPROMPT enabled |
747 | int sequence = CompilerConstants.IntegerNotSet; | 746 | var sequence = CompilerConstants.IntegerNotSet; |
748 | int terminateExitCode = CompilerConstants.IntegerNotSet; | 747 | var terminateExitCode = CompilerConstants.IntegerNotSet; |
749 | int timeout = CompilerConstants.IntegerNotSet; | 748 | var timeout = CompilerConstants.IntegerNotSet; |
750 | 749 | ||
751 | foreach (XAttribute attrib in element.Attributes()) | 750 | foreach (var attrib in element.Attributes()) |
752 | { | 751 | { |
753 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 752 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
754 | { | 753 | { |
@@ -875,14 +874,14 @@ namespace WixToolset.Util | |||
875 | 874 | ||
876 | if (!this.Messaging.EncounteredError) | 875 | if (!this.Messaging.EncounteredError) |
877 | { | 876 | { |
878 | var tuple = new WixCloseApplicationTuple(sourceLineNumbers, id) | 877 | var tuple = section.AddTuple(new WixCloseApplicationTuple(sourceLineNumbers, id) |
879 | { | 878 | { |
880 | Target = target, | 879 | Target = target, |
881 | Description = description, | 880 | Description = description, |
882 | Condition = condition, | 881 | Condition = condition, |
883 | Attributes = attributes, | 882 | Attributes = attributes, |
884 | Property = property, | 883 | Property = property, |
885 | }; | 884 | }); |
886 | if (CompilerConstants.IntegerNotSet != sequence) | 885 | if (CompilerConstants.IntegerNotSet != sequence) |
887 | { | 886 | { |
888 | tuple.Sequence = sequence; | 887 | tuple.Sequence = sequence; |
@@ -895,8 +894,6 @@ namespace WixToolset.Util | |||
895 | { | 894 | { |
896 | tuple.Timeout = timeout * 1000; // make the timeout milliseconds in the table. | 895 | tuple.Timeout = timeout * 1000; // make the timeout milliseconds in the table. |
897 | } | 896 | } |
898 | |||
899 | section.Tuples.Add(tuple); | ||
900 | } | 897 | } |
901 | } | 898 | } |
902 | 899 | ||
@@ -906,15 +903,15 @@ namespace WixToolset.Util | |||
906 | /// <param name="element">Element to parse.</param> | 903 | /// <param name="element">Element to parse.</param> |
907 | private void ParseDirectorySearchElement(Intermediate intermediate, IntermediateSection section, XElement element) | 904 | private void ParseDirectorySearchElement(Intermediate intermediate, IntermediateSection section, XElement element) |
908 | { | 905 | { |
909 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 906 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
910 | Identifier id = null; | 907 | Identifier id = null; |
911 | string variable = null; | 908 | string variable = null; |
912 | string condition = null; | 909 | string condition = null; |
913 | string after = null; | 910 | string after = null; |
914 | string path = null; | 911 | string path = null; |
915 | Serialize.DirectorySearch.ResultType result = Serialize.DirectorySearch.ResultType.NotSet; | 912 | var result = Serialize.DirectorySearch.ResultType.NotSet; |
916 | 913 | ||
917 | foreach (XAttribute attrib in element.Attributes()) | 914 | foreach (var attrib in element.Attributes()) |
918 | { | 915 | { |
919 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 916 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
920 | { | 917 | { |
@@ -964,7 +961,7 @@ namespace WixToolset.Util | |||
964 | 961 | ||
965 | if (!this.Messaging.EncounteredError) | 962 | if (!this.Messaging.EncounteredError) |
966 | { | 963 | { |
967 | WixFileSearchAttributes attributes = WixFileSearchAttributes.IsDirectory; | 964 | var attributes = WixFileSearchAttributes.IsDirectory; |
968 | switch (result) | 965 | switch (result) |
969 | { | 966 | { |
970 | case Serialize.DirectorySearch.ResultType.exists: | 967 | case Serialize.DirectorySearch.ResultType.exists: |
@@ -982,8 +979,7 @@ namespace WixToolset.Util | |||
982 | /// <param name="node">Element to parse.</param> | 979 | /// <param name="node">Element to parse.</param> |
983 | private void ParseWixSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement node) | 980 | private void ParseWixSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement node) |
984 | { | 981 | { |
985 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); | 982 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); |
986 | string refId = null; | ||
987 | 983 | ||
988 | foreach (XAttribute attrib in node.Attributes()) | 984 | foreach (XAttribute attrib in node.Attributes()) |
989 | { | 985 | { |
@@ -992,8 +988,8 @@ namespace WixToolset.Util | |||
992 | switch (attrib.Name.LocalName) | 988 | switch (attrib.Name.LocalName) |
993 | { | 989 | { |
994 | case "Id": | 990 | case "Id": |
995 | refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 991 | var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
996 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", refId); | 992 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.WixSearch, refId); |
997 | break; | 993 | break; |
998 | default: | 994 | default: |
999 | this.ParseHelper.UnexpectedAttribute(node, attrib); | 995 | this.ParseHelper.UnexpectedAttribute(node, attrib); |
@@ -1015,15 +1011,15 @@ namespace WixToolset.Util | |||
1015 | /// <param name="node">Element to parse.</param> | 1011 | /// <param name="node">Element to parse.</param> |
1016 | private void ParseFileSearchElement(Intermediate intermediate, IntermediateSection section, XElement node) | 1012 | private void ParseFileSearchElement(Intermediate intermediate, IntermediateSection section, XElement node) |
1017 | { | 1013 | { |
1018 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); | 1014 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); |
1019 | Identifier id = null; | 1015 | Identifier id = null; |
1020 | string variable = null; | 1016 | string variable = null; |
1021 | string condition = null; | 1017 | string condition = null; |
1022 | string after = null; | 1018 | string after = null; |
1023 | string path = null; | 1019 | string path = null; |
1024 | Serialize.FileSearch.ResultType result = Serialize.FileSearch.ResultType.NotSet; | 1020 | var result = Serialize.FileSearch.ResultType.NotSet; |
1025 | 1021 | ||
1026 | foreach (XAttribute attrib in node.Attributes()) | 1022 | foreach (var attrib in node.Attributes()) |
1027 | { | 1023 | { |
1028 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 1024 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
1029 | { | 1025 | { |
@@ -1075,7 +1071,7 @@ namespace WixToolset.Util | |||
1075 | 1071 | ||
1076 | if (!this.Messaging.EncounteredError) | 1072 | if (!this.Messaging.EncounteredError) |
1077 | { | 1073 | { |
1078 | WixFileSearchAttributes attributes = WixFileSearchAttributes.Default; | 1074 | var attributes = WixFileSearchAttributes.Default; |
1079 | switch (result) | 1075 | switch (result) |
1080 | { | 1076 | { |
1081 | case Serialize.FileSearch.ResultType.exists: | 1077 | case Serialize.FileSearch.ResultType.exists: |
@@ -1099,7 +1095,7 @@ namespace WixToolset.Util | |||
1099 | /// <param name="attributes"></param> | 1095 | /// <param name="attributes"></param> |
1100 | private void CreateWixFileSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string path, WixFileSearchAttributes attributes) | 1096 | private void CreateWixFileSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string path, WixFileSearchAttributes attributes) |
1101 | { | 1097 | { |
1102 | section.Tuples.Add(new WixFileSearchTuple(sourceLineNumbers, id) | 1098 | section.AddTuple(new WixFileSearchTuple(sourceLineNumbers, id) |
1103 | { | 1099 | { |
1104 | Path = path, | 1100 | Path = path, |
1105 | Attributes = attributes, | 1101 | Attributes = attributes, |
@@ -1114,12 +1110,12 @@ namespace WixToolset.Util | |||
1114 | /// <param name="directoryId">Identifier of referred to directory.</param> | 1110 | /// <param name="directoryId">Identifier of referred to directory.</param> |
1115 | private void ParseFileShareElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string directoryId) | 1111 | private void ParseFileShareElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string directoryId) |
1116 | { | 1112 | { |
1117 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1113 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1118 | string description = null; | 1114 | string description = null; |
1119 | string name = null; | 1115 | string name = null; |
1120 | Identifier id = null; | 1116 | Identifier id = null; |
1121 | 1117 | ||
1122 | foreach (XAttribute attrib in element.Attributes()) | 1118 | foreach (var attrib in element.Attributes()) |
1123 | { | 1119 | { |
1124 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 1120 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
1125 | { | 1121 | { |
@@ -1147,7 +1143,7 @@ namespace WixToolset.Util | |||
1147 | 1143 | ||
1148 | if (null == id) | 1144 | if (null == id) |
1149 | { | 1145 | { |
1150 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); | 1146 | id = this.ParseHelper.CreateIdentifier("ufs", componentId, name); |
1151 | } | 1147 | } |
1152 | 1148 | ||
1153 | if (null == name) | 1149 | if (null == name) |
@@ -1160,7 +1156,7 @@ namespace WixToolset.Util | |||
1160 | this.Messaging.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, element.Name.LocalName, "FileSharePermission")); | 1156 | this.Messaging.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, element.Name.LocalName, "FileSharePermission")); |
1161 | } | 1157 | } |
1162 | 1158 | ||
1163 | foreach (XElement child in element.Elements()) | 1159 | foreach (var child in element.Elements()) |
1164 | { | 1160 | { |
1165 | if (this.Namespace == child.Name.Namespace) | 1161 | if (this.Namespace == child.Name.Namespace) |
1166 | { | 1162 | { |
@@ -1185,15 +1181,13 @@ namespace WixToolset.Util | |||
1185 | 1181 | ||
1186 | if (!this.Messaging.EncounteredError) | 1182 | if (!this.Messaging.EncounteredError) |
1187 | { | 1183 | { |
1188 | var tuple = new FileShareTuple(sourceLineNumbers, id) | 1184 | section.AddTuple(new FileShareTuple(sourceLineNumbers, id) |
1189 | { | 1185 | { |
1190 | ShareName = name, | 1186 | ShareName = name, |
1191 | ComponentRef = componentId, | 1187 | ComponentRef = componentId, |
1192 | Description = description, | 1188 | Description = description, |
1193 | DirectoryRef = directoryId, | 1189 | DirectoryRef = directoryId, |
1194 | }; | 1190 | }); |
1195 | |||
1196 | section.Tuples.Add(tuple); | ||
1197 | } | 1191 | } |
1198 | } | 1192 | } |
1199 | 1193 | ||
@@ -1204,12 +1198,11 @@ namespace WixToolset.Util | |||
1204 | /// <param name="fileShareId">The identifier of the parent FileShare element.</param> | 1198 | /// <param name="fileShareId">The identifier of the parent FileShare element.</param> |
1205 | private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, Identifier fileShareId) | 1199 | private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, Identifier fileShareId) |
1206 | { | 1200 | { |
1207 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1201 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1208 | BitArray bits = new BitArray(32); | 1202 | var bits = new BitArray(32); |
1209 | int permission = 0; | ||
1210 | string user = null; | 1203 | string user = null; |
1211 | 1204 | ||
1212 | foreach (XAttribute attrib in element.Attributes()) | 1205 | foreach (var attrib in element.Attributes()) |
1213 | { | 1206 | { |
1214 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 1207 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
1215 | { | 1208 | { |
@@ -1217,10 +1210,10 @@ namespace WixToolset.Util | |||
1217 | { | 1210 | { |
1218 | case "User": | 1211 | case "User": |
1219 | user = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1212 | user = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
1220 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "User", user); | 1213 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilTupleDefinitions.User, user); |
1221 | break; | 1214 | break; |
1222 | default: | 1215 | default: |
1223 | YesNoType attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 1216 | var attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
1224 | if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16)) | 1217 | if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16)) |
1225 | { | 1218 | { |
1226 | if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28)) | 1219 | if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28)) |
@@ -1241,7 +1234,7 @@ namespace WixToolset.Util | |||
1241 | } | 1234 | } |
1242 | } | 1235 | } |
1243 | 1236 | ||
1244 | permission = this.CreateIntegerFromBitArray(bits); | 1237 | var permission = this.CreateIntegerFromBitArray(bits); |
1245 | 1238 | ||
1246 | if (null == user) | 1239 | if (null == user) |
1247 | { | 1240 | { |
@@ -1257,14 +1250,12 @@ namespace WixToolset.Util | |||
1257 | 1250 | ||
1258 | if (!this.Messaging.EncounteredError) | 1251 | if (!this.Messaging.EncounteredError) |
1259 | { | 1252 | { |
1260 | var tuple = new FileSharePermissionsTuple(sourceLineNumbers) | 1253 | section.AddTuple(new FileSharePermissionsTuple(sourceLineNumbers) |
1261 | { | 1254 | { |
1262 | FileShareRef = fileShareId.Id, | 1255 | FileShareRef = fileShareId.Id, |
1263 | UserRef = user, | 1256 | UserRef = user, |
1264 | Permissions = permission, | 1257 | Permissions = permission, |
1265 | }; | 1258 | }); |
1266 | |||
1267 | section.Tuples.Add(tuple); | ||
1268 | } | 1259 | } |
1269 | } | 1260 | } |
1270 | 1261 | ||
@@ -1275,12 +1266,12 @@ namespace WixToolset.Util | |||
1275 | /// <param name="componentId">Component Id of the parent component of this element.</param> | 1266 | /// <param name="componentId">Component Id of the parent component of this element.</param> |
1276 | private void ParseGroupElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 1267 | private void ParseGroupElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
1277 | { | 1268 | { |
1278 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1269 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1279 | Identifier id = null; | 1270 | Identifier id = null; |
1280 | string domain = null; | 1271 | string domain = null; |
1281 | string name = null; | 1272 | string name = null; |
1282 | 1273 | ||
1283 | foreach (XAttribute attrib in element.Attributes()) | 1274 | foreach (var attrib in element.Attributes()) |
1284 | { | 1275 | { |
1285 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 1276 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
1286 | { | 1277 | { |
@@ -1308,21 +1299,19 @@ namespace WixToolset.Util | |||
1308 | 1299 | ||
1309 | if (null == id) | 1300 | if (null == id) |
1310 | { | 1301 | { |
1311 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); | 1302 | id = this.ParseHelper.CreateIdentifier("ugr", componentId, domain, name); |
1312 | } | 1303 | } |
1313 | 1304 | ||
1314 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | 1305 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); |
1315 | 1306 | ||
1316 | if (!this.Messaging.EncounteredError) | 1307 | if (!this.Messaging.EncounteredError) |
1317 | { | 1308 | { |
1318 | var tuple = new GroupTuple(sourceLineNumbers, id) | 1309 | section.AddTuple(new GroupTuple(sourceLineNumbers, id) |
1319 | { | 1310 | { |
1320 | ComponentRef = componentId, | 1311 | ComponentRef = componentId, |
1321 | Name = name, | 1312 | Name = name, |
1322 | Domain = domain, | 1313 | Domain = domain, |
1323 | }; | 1314 | }); |
1324 | |||
1325 | section.Tuples.Add(tuple); | ||
1326 | } | 1315 | } |
1327 | } | 1316 | } |
1328 | 1317 | ||
@@ -1333,10 +1322,10 @@ namespace WixToolset.Util | |||
1333 | /// <param name="userId">Required user id to be joined to the group.</param> | 1322 | /// <param name="userId">Required user id to be joined to the group.</param> |
1334 | private void ParseGroupRefElement(Intermediate intermediate, IntermediateSection section, XElement element, string userId) | 1323 | private void ParseGroupRefElement(Intermediate intermediate, IntermediateSection section, XElement element, string userId) |
1335 | { | 1324 | { |
1336 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1325 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1337 | string groupId = null; | 1326 | string groupId = null; |
1338 | 1327 | ||
1339 | foreach (XAttribute attrib in element.Attributes()) | 1328 | foreach (var attrib in element.Attributes()) |
1340 | { | 1329 | { |
1341 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 1330 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
1342 | { | 1331 | { |
@@ -1344,7 +1333,7 @@ namespace WixToolset.Util | |||
1344 | { | 1333 | { |
1345 | case "Id": | 1334 | case "Id": |
1346 | groupId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1335 | groupId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
1347 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Group", groupId); | 1336 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilTupleDefinitions.Group, groupId); |
1348 | break; | 1337 | break; |
1349 | default: | 1338 | default: |
1350 | this.ParseHelper.UnexpectedAttribute(element, attrib); | 1339 | this.ParseHelper.UnexpectedAttribute(element, attrib); |
@@ -1361,13 +1350,11 @@ namespace WixToolset.Util | |||
1361 | 1350 | ||
1362 | if (!this.Messaging.EncounteredError) | 1351 | if (!this.Messaging.EncounteredError) |
1363 | { | 1352 | { |
1364 | var tuple = new UserGroupTuple(sourceLineNumbers) | 1353 | section.AddTuple(new UserGroupTuple(sourceLineNumbers) |
1365 | { | 1354 | { |
1366 | UserRef = userId, | 1355 | UserRef = userId, |
1367 | GroupRef = groupId, | 1356 | GroupRef = groupId, |
1368 | }; | 1357 | }); |
1369 | |||
1370 | section.Tuples.Add(tuple); | ||
1371 | } | 1358 | } |
1372 | } | 1359 | } |
1373 | 1360 | ||
@@ -1379,7 +1366,7 @@ namespace WixToolset.Util | |||
1379 | /// <param name="defaultTarget">Default directory if none is specified on the InternetShortcut element.</param> | 1366 | /// <param name="defaultTarget">Default directory if none is specified on the InternetShortcut element.</param> |
1380 | private void ParseInternetShortcutElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string defaultTarget) | 1367 | private void ParseInternetShortcutElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string defaultTarget) |
1381 | { | 1368 | { |
1382 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1369 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1383 | Identifier id = null; | 1370 | Identifier id = null; |
1384 | string name = null; | 1371 | string name = null; |
1385 | string target = null; | 1372 | string target = null; |
@@ -1388,7 +1375,7 @@ namespace WixToolset.Util | |||
1388 | string iconFile = null; | 1375 | string iconFile = null; |
1389 | int iconIndex = 0; | 1376 | int iconIndex = 0; |
1390 | 1377 | ||
1391 | foreach (XAttribute attrib in element.Attributes()) | 1378 | foreach (var attrib in element.Attributes()) |
1392 | { | 1379 | { |
1393 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 1380 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
1394 | { | 1381 | { |
@@ -1435,7 +1422,7 @@ namespace WixToolset.Util | |||
1435 | 1422 | ||
1436 | if (null == id) | 1423 | if (null == id) |
1437 | { | 1424 | { |
1438 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); | 1425 | id = this.ParseHelper.CreateIdentifier("uis", componentId, directoryId, name, target); |
1439 | } | 1426 | } |
1440 | 1427 | ||
1441 | // In theory this can never be the case, since InternetShortcut can only be under | 1428 | // In theory this can never be the case, since InternetShortcut can only be under |
@@ -1459,8 +1446,8 @@ namespace WixToolset.Util | |||
1459 | 1446 | ||
1460 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | 1447 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); |
1461 | 1448 | ||
1462 | InternetShortcutType shortcutType = InternetShortcutType.Link; | 1449 | var shortcutType = InternetShortcutType.Link; |
1463 | if (0 == String.Compare(type, "url", StringComparison.OrdinalIgnoreCase)) | 1450 | if (String.Equals(type, "url", StringComparison.OrdinalIgnoreCase)) |
1464 | { | 1451 | { |
1465 | shortcutType = InternetShortcutType.Url; | 1452 | shortcutType = InternetShortcutType.Url; |
1466 | } | 1453 | } |
@@ -1486,7 +1473,7 @@ namespace WixToolset.Util | |||
1486 | // add the appropriate extension based on type of shortcut | 1473 | // add the appropriate extension based on type of shortcut |
1487 | name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk"); | 1474 | name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk"); |
1488 | 1475 | ||
1489 | var tuple = new WixInternetShortcutTuple(sourceLineNumbers, shortcutId) | 1476 | section.AddTuple(new WixInternetShortcutTuple(sourceLineNumbers, shortcutId) |
1490 | { | 1477 | { |
1491 | ComponentRef = componentId, | 1478 | ComponentRef = componentId, |
1492 | DirectoryRef = directoryId, | 1479 | DirectoryRef = directoryId, |
@@ -1495,9 +1482,7 @@ namespace WixToolset.Util | |||
1495 | Attributes = (int)type, | 1482 | Attributes = (int)type, |
1496 | IconFile = iconFile, | 1483 | IconFile = iconFile, |
1497 | IconIndex = iconIndex, | 1484 | IconIndex = iconIndex, |
1498 | }; | 1485 | }); |
1499 | |||
1500 | section.Tuples.Add(tuple); | ||
1501 | 1486 | ||
1502 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedInternetShortcuts", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | 1487 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedInternetShortcuts", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
1503 | 1488 | ||
@@ -1505,16 +1490,14 @@ namespace WixToolset.Util | |||
1505 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder"); | 1490 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder"); |
1506 | 1491 | ||
1507 | // use built-in MSI functionality to remove the shortcuts rather than doing so via CA | 1492 | // use built-in MSI functionality to remove the shortcuts rather than doing so via CA |
1508 | var removeFileTuple = new RemoveFileTuple(sourceLineNumbers, shortcutId) | 1493 | section.AddTuple(new RemoveFileTuple(sourceLineNumbers, shortcutId) |
1509 | { | 1494 | { |
1510 | ComponentRef = componentId, | 1495 | ComponentRef = componentId, |
1511 | DirProperty = directoryId, | 1496 | DirProperty = directoryId, |
1512 | OnUninstall = true, | 1497 | OnUninstall = true, |
1513 | // TODO: A better way? | 1498 | // TODO: A better way? |
1514 | FileName = this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name), | 1499 | FileName = this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name), |
1515 | }; | 1500 | }); |
1516 | |||
1517 | section.Tuples.Add(removeFileTuple); | ||
1518 | } | 1501 | } |
1519 | 1502 | ||
1520 | /// <summary> | 1503 | /// <summary> |
@@ -1524,22 +1507,22 @@ namespace WixToolset.Util | |||
1524 | /// <param name="componentId">Identifier of parent component.</param> | 1507 | /// <param name="componentId">Identifier of parent component.</param> |
1525 | private void ParsePerformanceCategoryElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 1508 | private void ParsePerformanceCategoryElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
1526 | { | 1509 | { |
1527 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1510 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1528 | Identifier id = null; | 1511 | Identifier id = null; |
1529 | string name = null; | 1512 | string name = null; |
1530 | string help = null; | 1513 | string help = null; |
1531 | YesNoType multiInstance = YesNoType.No; | 1514 | var multiInstance = YesNoType.No; |
1532 | int defaultLanguage = 0x09; // default to "english" | 1515 | int defaultLanguage = 0x09; // default to "english" |
1533 | 1516 | ||
1534 | ArrayList parsedPerformanceCounters = new ArrayList(); | 1517 | var parsedPerformanceCounters = new List<ParsedPerformanceCounter>(); |
1535 | 1518 | ||
1536 | // default to managed performance counter | 1519 | // default to managed performance counter |
1537 | string library = "netfxperf.dll"; | 1520 | var library = "netfxperf.dll"; |
1538 | string openEntryPoint = "OpenPerformanceData"; | 1521 | var openEntryPoint = "OpenPerformanceData"; |
1539 | string collectEntryPoint = "CollectPerformanceData"; | 1522 | var collectEntryPoint = "CollectPerformanceData"; |
1540 | string closeEntryPoint = "ClosePerformanceData"; | 1523 | var closeEntryPoint = "ClosePerformanceData"; |
1541 | 1524 | ||
1542 | foreach (XAttribute attrib in element.Attributes()) | 1525 | foreach (var attrib in element.Attributes()) |
1543 | { | 1526 | { |
1544 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 1527 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
1545 | { | 1528 | { |
@@ -1583,25 +1566,28 @@ namespace WixToolset.Util | |||
1583 | } | 1566 | } |
1584 | } | 1567 | } |
1585 | 1568 | ||
1586 | if (null == id) | 1569 | if (null == id && null == name) |
1587 | { | 1570 | { |
1588 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); | 1571 | this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "Id", "Name")); |
1589 | } | 1572 | } |
1590 | 1573 | else if (null == id) | |
1591 | if (null == name) | ||
1592 | { | 1574 | { |
1593 | name = id?.Id; | 1575 | id = this.ParseHelper.CreateIdentifier("upc", componentId, name); |
1576 | } | ||
1577 | else if (null == name) | ||
1578 | { | ||
1579 | name = id.Id; | ||
1594 | } | 1580 | } |
1595 | 1581 | ||
1596 | // Process the child counter elements. | 1582 | // Process the child counter elements. |
1597 | foreach (XElement child in element.Elements()) | 1583 | foreach (var child in element.Elements()) |
1598 | { | 1584 | { |
1599 | if (this.Namespace == child.Name.Namespace) | 1585 | if (this.Namespace == child.Name.Namespace) |
1600 | { | 1586 | { |
1601 | switch (child.Name.LocalName) | 1587 | switch (child.Name.LocalName) |
1602 | { | 1588 | { |
1603 | case "PerformanceCounter": | 1589 | case "PerformanceCounter": |
1604 | ParsedPerformanceCounter counter = this.ParsePerformanceCounterElement(intermediate, section, child, defaultLanguage); | 1590 | var counter = this.ParsePerformanceCounterElement(intermediate, section, child, defaultLanguage); |
1605 | if (null != counter) | 1591 | if (null != counter) |
1606 | { | 1592 | { |
1607 | parsedPerformanceCounters.Add(counter); | 1593 | parsedPerformanceCounters.Add(counter); |
@@ -1622,10 +1608,10 @@ namespace WixToolset.Util | |||
1622 | if (!this.Messaging.EncounteredError) | 1608 | if (!this.Messaging.EncounteredError) |
1623 | { | 1609 | { |
1624 | // Calculate the ini and h file content. | 1610 | // Calculate the ini and h file content. |
1625 | string objectName = "OBJECT_1"; | 1611 | var objectName = "OBJECT_1"; |
1626 | string objectLanguage = defaultLanguage.ToString("D3", CultureInfo.InvariantCulture); | 1612 | var objectLanguage = defaultLanguage.ToString("D3", CultureInfo.InvariantCulture); |
1627 | 1613 | ||
1628 | StringBuilder sbIniData = new StringBuilder(); | 1614 | var sbIniData = new StringBuilder(); |
1629 | sbIniData.AppendFormat("[info]\r\ndrivername={0}\r\nsymbolfile=wixperf.h\r\n\r\n[objects]\r\n{1}_{2}_NAME=\r\n\r\n[languages]\r\n{2}=LANG{2}\r\n\r\n", name, objectName, objectLanguage); | 1615 | sbIniData.AppendFormat("[info]\r\ndrivername={0}\r\nsymbolfile=wixperf.h\r\n\r\n[objects]\r\n{1}_{2}_NAME=\r\n\r\n[languages]\r\n{2}=LANG{2}\r\n\r\n", name, objectName, objectLanguage); |
1630 | sbIniData.AppendFormat("[text]\r\n{0}_{1}_NAME={2}\r\n", objectName, objectLanguage, name); | 1616 | sbIniData.AppendFormat("[text]\r\n{0}_{1}_NAME={2}\r\n", objectName, objectLanguage, name); |
1631 | if (null != help) | 1617 | if (null != help) |
@@ -1634,15 +1620,15 @@ namespace WixToolset.Util | |||
1634 | } | 1620 | } |
1635 | 1621 | ||
1636 | int symbolConstantsCounter = 0; | 1622 | int symbolConstantsCounter = 0; |
1637 | StringBuilder sbSymbolicConstants = new StringBuilder(); | 1623 | var sbSymbolicConstants = new StringBuilder(); |
1638 | sbSymbolicConstants.AppendFormat("#define {0} {1}\r\n", objectName, symbolConstantsCounter); | 1624 | sbSymbolicConstants.AppendFormat("#define {0} {1}\r\n", objectName, symbolConstantsCounter); |
1639 | 1625 | ||
1640 | StringBuilder sbCounterNames = new StringBuilder("[~]"); | 1626 | var sbCounterNames = new StringBuilder("[~]"); |
1641 | StringBuilder sbCounterTypes = new StringBuilder("[~]"); | 1627 | var sbCounterTypes = new StringBuilder("[~]"); |
1642 | for (int i = 0; i < parsedPerformanceCounters.Count; ++i) | 1628 | for (int i = 0; i < parsedPerformanceCounters.Count; ++i) |
1643 | { | 1629 | { |
1644 | ParsedPerformanceCounter counter = (ParsedPerformanceCounter)parsedPerformanceCounters[i]; | 1630 | var counter = parsedPerformanceCounters[i]; |
1645 | string counterName = String.Concat("DEVICE_COUNTER_", i + 1); | 1631 | var counterName = String.Concat("DEVICE_COUNTER_", i + 1); |
1646 | 1632 | ||
1647 | sbIniData.AppendFormat("{0}_{1}_NAME={2}\r\n", counterName, counter.Language, counter.Name); | 1633 | sbIniData.AppendFormat("{0}_{1}_NAME={2}\r\n", counterName, counter.Language, counter.Name); |
1648 | if (null != counter.Help) | 1634 | if (null != counter.Help) |
@@ -1662,20 +1648,18 @@ namespace WixToolset.Util | |||
1662 | sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter); | 1648 | sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter); |
1663 | 1649 | ||
1664 | // Add the calculated INI and H strings to the PerformanceCategory table. | 1650 | // Add the calculated INI and H strings to the PerformanceCategory table. |
1665 | var tuple = new PerformanceCategoryTuple(sourceLineNumbers, id) | 1651 | section.AddTuple(new PerformanceCategoryTuple(sourceLineNumbers, id) |
1666 | { | 1652 | { |
1667 | ComponentRef = componentId, | 1653 | ComponentRef = componentId, |
1668 | Name = name, | 1654 | Name = name, |
1669 | IniData = sbIniData.ToString(), | 1655 | IniData = sbIniData.ToString(), |
1670 | ConstantData = sbSymbolicConstants.ToString(), | 1656 | ConstantData = sbSymbolicConstants.ToString(), |
1671 | }; | 1657 | }); |
1672 | |||
1673 | section.Tuples.Add(tuple); | ||
1674 | 1658 | ||
1675 | // Set up the application's performance key. | 1659 | // Set up the application's performance key. |
1676 | string escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties); | 1660 | var escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties); |
1677 | string linkageKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Linkage", escapedName); | 1661 | var linkageKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Linkage", escapedName); |
1678 | string performanceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Performance", escapedName); | 1662 | var performanceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Performance", escapedName); |
1679 | 1663 | ||
1680 | this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, linkageKey, "Export", escapedName, componentId, false); | 1664 | this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, linkageKey, "Export", escapedName, componentId, false); |
1681 | this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "-", null, componentId, false); | 1665 | this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "-", null, componentId, false); |
@@ -1951,14 +1935,14 @@ namespace WixToolset.Util | |||
1951 | /// <param name="defaultLanguage">Default language for the performance counter.</param> | 1935 | /// <param name="defaultLanguage">Default language for the performance counter.</param> |
1952 | private ParsedPerformanceCounter ParsePerformanceCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, int defaultLanguage) | 1936 | private ParsedPerformanceCounter ParsePerformanceCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, int defaultLanguage) |
1953 | { | 1937 | { |
1954 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1938 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1955 | ParsedPerformanceCounter parsedPerformanceCounter = null; | 1939 | ParsedPerformanceCounter parsedPerformanceCounter = null; |
1956 | string name = null; | 1940 | string name = null; |
1957 | string help = null; | 1941 | string help = null; |
1958 | System.Diagnostics.PerformanceCounterType type = System.Diagnostics.PerformanceCounterType.NumberOfItems32; | 1942 | var type = System.Diagnostics.PerformanceCounterType.NumberOfItems32; |
1959 | int language = defaultLanguage; | 1943 | int language = defaultLanguage; |
1960 | 1944 | ||
1961 | foreach (XAttribute attrib in element.Attributes()) | 1945 | foreach (var attrib in element.Attributes()) |
1962 | { | 1946 | { |
1963 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 1947 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
1964 | { | 1948 | { |
@@ -2015,7 +1999,7 @@ namespace WixToolset.Util | |||
2015 | /// <returns>Numeric representation of the language as per WinNT.h.</returns> | 1999 | /// <returns>Numeric representation of the language as per WinNT.h.</returns> |
2016 | private System.Diagnostics.PerformanceCounterType GetPerformanceCounterType(SourceLineNumber sourceLineNumbers, XAttribute attribute) | 2000 | private System.Diagnostics.PerformanceCounterType GetPerformanceCounterType(SourceLineNumber sourceLineNumbers, XAttribute attribute) |
2017 | { | 2001 | { |
2018 | System.Diagnostics.PerformanceCounterType type = System.Diagnostics.PerformanceCounterType.NumberOfItems32; | 2002 | var type = System.Diagnostics.PerformanceCounterType.NumberOfItems32; |
2019 | if (String.Empty == attribute.Value) | 2003 | if (String.Empty == attribute.Value) |
2020 | { | 2004 | { |
2021 | this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); | 2005 | this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); |
@@ -2125,12 +2109,12 @@ namespace WixToolset.Util | |||
2125 | /// <param name="fileId">Identifier of referenced file.</param> | 2109 | /// <param name="fileId">Identifier of referenced file.</param> |
2126 | private void ParsePerfCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) | 2110 | private void ParsePerfCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) |
2127 | { | 2111 | { |
2128 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2112 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2129 | string name = null; | 2113 | string name = null; |
2130 | 2114 | ||
2131 | this.Messaging.Write(UtilWarnings.DeprecatedPerfCounterElement(sourceLineNumbers)); | 2115 | this.Messaging.Write(UtilWarnings.DeprecatedPerfCounterElement(sourceLineNumbers)); |
2132 | 2116 | ||
2133 | foreach (XAttribute attrib in element.Attributes()) | 2117 | foreach (var attrib in element.Attributes()) |
2134 | { | 2118 | { |
2135 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2119 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2136 | { | 2120 | { |
@@ -2159,14 +2143,12 @@ namespace WixToolset.Util | |||
2159 | 2143 | ||
2160 | if (!this.Messaging.EncounteredError) | 2144 | if (!this.Messaging.EncounteredError) |
2161 | { | 2145 | { |
2162 | var tuple = new PerfmonTuple(sourceLineNumbers) | 2146 | section.AddTuple(new PerfmonTuple(sourceLineNumbers) |
2163 | { | 2147 | { |
2164 | ComponentRef = componentId, | 2148 | ComponentRef = componentId, |
2165 | File = $"[#{fileId}]", | 2149 | File = $"[#{fileId}]", |
2166 | Name = name, | 2150 | Name = name, |
2167 | }; | 2151 | }); |
2168 | |||
2169 | section.Tuples.Add(tuple); | ||
2170 | } | 2152 | } |
2171 | 2153 | ||
2172 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | 2154 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
@@ -2182,10 +2164,10 @@ namespace WixToolset.Util | |||
2182 | /// <param name="fileId">Identifier of referenced file.</param> | 2164 | /// <param name="fileId">Identifier of referenced file.</param> |
2183 | private void ParsePerfCounterManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) | 2165 | private void ParsePerfCounterManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) |
2184 | { | 2166 | { |
2185 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2167 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2186 | string resourceFileDirectory = null; | 2168 | string resourceFileDirectory = null; |
2187 | 2169 | ||
2188 | foreach (XAttribute attrib in element.Attributes()) | 2170 | foreach (var attrib in element.Attributes()) |
2189 | { | 2171 | { |
2190 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2172 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2191 | { | 2173 | { |
@@ -2209,14 +2191,12 @@ namespace WixToolset.Util | |||
2209 | 2191 | ||
2210 | if (!this.Messaging.EncounteredError) | 2192 | if (!this.Messaging.EncounteredError) |
2211 | { | 2193 | { |
2212 | var tuple = new PerfmonManifestTuple(sourceLineNumbers) | 2194 | section.AddTuple(new PerfmonManifestTuple(sourceLineNumbers) |
2213 | { | 2195 | { |
2214 | ComponentRef = componentId, | 2196 | ComponentRef = componentId, |
2215 | File = $"[#{fileId}]", | 2197 | File = $"[#{fileId}]", |
2216 | ResourceFileDirectory = resourceFileDirectory, | 2198 | ResourceFileDirectory = resourceFileDirectory, |
2217 | }; | 2199 | }); |
2218 | |||
2219 | section.Tuples.Add(tuple); | ||
2220 | } | 2200 | } |
2221 | 2201 | ||
2222 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonManifestRegister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | 2202 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonManifestRegister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
@@ -2231,10 +2211,10 @@ namespace WixToolset.Util | |||
2231 | /// <param name="win64">Flag to determine whether the component is 64-bit.</param> | 2211 | /// <param name="win64">Flag to determine whether the component is 64-bit.</param> |
2232 | private void ParseFormatFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileId, bool win64) | 2212 | private void ParseFormatFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileId, bool win64) |
2233 | { | 2213 | { |
2234 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2214 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2235 | string binaryId = null; | 2215 | string binaryId = null; |
2236 | 2216 | ||
2237 | foreach (XAttribute attrib in element.Attributes()) | 2217 | foreach (var attrib in element.Attributes()) |
2238 | { | 2218 | { |
2239 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2219 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2240 | { | 2220 | { |
@@ -2265,15 +2245,13 @@ namespace WixToolset.Util | |||
2265 | { | 2245 | { |
2266 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedFormatFiles", this.Context.Platform, CustomActionPlatforms.X64 | CustomActionPlatforms.X86); | 2246 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedFormatFiles", this.Context.Platform, CustomActionPlatforms.X64 | CustomActionPlatforms.X86); |
2267 | 2247 | ||
2268 | var tuple = new WixFormatFilesTuple(sourceLineNumbers) | 2248 | section.AddTuple(new WixFormatFilesTuple(sourceLineNumbers) |
2269 | { | 2249 | { |
2270 | BinaryRef = binaryId, | 2250 | BinaryRef = binaryId, |
2271 | FileRef = fileId, | 2251 | FileRef = fileId, |
2272 | }; | 2252 | }); |
2273 | |||
2274 | section.Tuples.Add(tuple); | ||
2275 | 2253 | ||
2276 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Binary", binaryId); | 2254 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.Binary, binaryId); |
2277 | } | 2255 | } |
2278 | } | 2256 | } |
2279 | 2257 | ||
@@ -2285,12 +2263,12 @@ namespace WixToolset.Util | |||
2285 | /// <param name="fileId">Identifier of referenced file.</param> | 2263 | /// <param name="fileId">Identifier of referenced file.</param> |
2286 | private void ParseEventManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) | 2264 | private void ParseEventManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId) |
2287 | { | 2265 | { |
2288 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2266 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2289 | string messageFile = null; | 2267 | string messageFile = null; |
2290 | string resourceFile = null; | 2268 | string resourceFile = null; |
2291 | string parameterFile = null; | 2269 | string parameterFile = null; |
2292 | 2270 | ||
2293 | foreach (XAttribute attrib in element.Attributes()) | 2271 | foreach (var attrib in element.Attributes()) |
2294 | { | 2272 | { |
2295 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2273 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2296 | { | 2274 | { |
@@ -2320,17 +2298,15 @@ namespace WixToolset.Util | |||
2320 | 2298 | ||
2321 | if (!this.Messaging.EncounteredError) | 2299 | if (!this.Messaging.EncounteredError) |
2322 | { | 2300 | { |
2323 | var tuple = new EventManifestTuple(sourceLineNumbers) | 2301 | section.AddTuple(new EventManifestTuple(sourceLineNumbers) |
2324 | { | 2302 | { |
2325 | ComponentRef = componentId, | 2303 | ComponentRef = componentId, |
2326 | File = $"[#{fileId}]", | 2304 | File = $"[#{fileId}]", |
2327 | }; | 2305 | }); |
2328 | |||
2329 | section.Tuples.Add(tuple); | ||
2330 | 2306 | ||
2331 | if (null != messageFile) | 2307 | if (null != messageFile) |
2332 | { | 2308 | { |
2333 | var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}MessageFile")) | 2309 | section.AddTuple(new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}MessageFile")) |
2334 | { | 2310 | { |
2335 | File = $"[#{fileId}]", | 2311 | File = $"[#{fileId}]", |
2336 | ElementPath = "/*/*/*/*[\\[]@messageFileName[\\]]", | 2312 | ElementPath = "/*/*/*/*[\\[]@messageFileName[\\]]", |
@@ -2338,12 +2314,11 @@ namespace WixToolset.Util | |||
2338 | Value = messageFile, | 2314 | Value = messageFile, |
2339 | Flags = 4 | 0x00001000, //bulk write | preserve modified date | 2315 | Flags = 4 | 0x00001000, //bulk write | preserve modified date |
2340 | ComponentRef = componentId, | 2316 | ComponentRef = componentId, |
2341 | }; | 2317 | }); |
2342 | section.Tuples.Add(xmlTuple); | ||
2343 | } | 2318 | } |
2344 | if (null != parameterFile) | 2319 | if (null != parameterFile) |
2345 | { | 2320 | { |
2346 | var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}ParameterFile")) | 2321 | section.AddTuple(new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}ParameterFile")) |
2347 | { | 2322 | { |
2348 | File = $"[#{fileId}]", | 2323 | File = $"[#{fileId}]", |
2349 | ElementPath = "/*/*/*/*[\\[]@parameterFileName[\\]]", | 2324 | ElementPath = "/*/*/*/*[\\[]@parameterFileName[\\]]", |
@@ -2351,12 +2326,11 @@ namespace WixToolset.Util | |||
2351 | Value = parameterFile, | 2326 | Value = parameterFile, |
2352 | Flags = 4 | 0x00001000, //bulk write | preserve modified date | 2327 | Flags = 4 | 0x00001000, //bulk write | preserve modified date |
2353 | ComponentRef = componentId, | 2328 | ComponentRef = componentId, |
2354 | }; | 2329 | }); |
2355 | section.Tuples.Add(xmlTuple); | ||
2356 | } | 2330 | } |
2357 | if (null != resourceFile) | 2331 | if (null != resourceFile) |
2358 | { | 2332 | { |
2359 | var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}ResourceFile")) | 2333 | section.AddTuple(new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}ResourceFile")) |
2360 | { | 2334 | { |
2361 | File = $"[#{fileId}]", | 2335 | File = $"[#{fileId}]", |
2362 | ElementPath = "/*/*/*/*[\\[]@resourceFileName[\\]]", | 2336 | ElementPath = "/*/*/*/*[\\[]@resourceFileName[\\]]", |
@@ -2364,8 +2338,7 @@ namespace WixToolset.Util | |||
2364 | Value = resourceFile, | 2338 | Value = resourceFile, |
2365 | Flags = 4 | 0x00001000, //bulk write | preserve modified date | 2339 | Flags = 4 | 0x00001000, //bulk write | preserve modified date |
2366 | ComponentRef = componentId, | 2340 | ComponentRef = componentId, |
2367 | }; | 2341 | }); |
2368 | section.Tuples.Add(xmlTuple); | ||
2369 | } | 2342 | } |
2370 | 2343 | ||
2371 | } | 2344 | } |
@@ -2375,7 +2348,7 @@ namespace WixToolset.Util | |||
2375 | 2348 | ||
2376 | if (null != messageFile || null != parameterFile || null != resourceFile) | 2349 | if (null != messageFile || null != parameterFile || null != resourceFile) |
2377 | { | 2350 | { |
2378 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | 2351 | this.AddReferenceToSchedXmlFile(sourceLineNumbers, section); |
2379 | } | 2352 | } |
2380 | } | 2353 | } |
2381 | 2354 | ||
@@ -2389,14 +2362,13 @@ namespace WixToolset.Util | |||
2389 | /// <param name="tableName">Name of table that contains objectId.</param> | 2362 | /// <param name="tableName">Name of table that contains objectId.</param> |
2390 | private void ParsePermissionExElement(Intermediate intermediate, IntermediateSection section, XElement element, string objectId, string componentId, bool win64, string tableName) | 2363 | private void ParsePermissionExElement(Intermediate intermediate, IntermediateSection section, XElement element, string objectId, string componentId, bool win64, string tableName) |
2391 | { | 2364 | { |
2392 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2365 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2393 | BitArray bits = new BitArray(32); | 2366 | var bits = new BitArray(32); |
2394 | string domain = null; | 2367 | string domain = null; |
2395 | int permission = 0; | ||
2396 | string[] specialPermissions = null; | 2368 | string[] specialPermissions = null; |
2397 | string user = null; | 2369 | string user = null; |
2398 | 2370 | ||
2399 | PermissionType permissionType = PermissionType.SecureObjects; | 2371 | var permissionType = PermissionType.SecureObjects; |
2400 | 2372 | ||
2401 | switch (tableName) | 2373 | switch (tableName) |
2402 | { | 2374 | { |
@@ -2422,7 +2394,7 @@ namespace WixToolset.Util | |||
2422 | break; | 2394 | break; |
2423 | } | 2395 | } |
2424 | 2396 | ||
2425 | foreach (XAttribute attrib in element.Attributes()) | 2397 | foreach (var attrib in element.Attributes()) |
2426 | { | 2398 | { |
2427 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2399 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2428 | { | 2400 | { |
@@ -2439,7 +2411,7 @@ namespace WixToolset.Util | |||
2439 | user = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 2411 | user = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
2440 | break; | 2412 | break; |
2441 | default: | 2413 | default: |
2442 | YesNoType attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 2414 | var attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
2443 | if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16)) | 2415 | if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16)) |
2444 | { | 2416 | { |
2445 | if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28)) | 2417 | if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28)) |
@@ -2460,7 +2432,7 @@ namespace WixToolset.Util | |||
2460 | } | 2432 | } |
2461 | } | 2433 | } |
2462 | 2434 | ||
2463 | permission = this.CreateIntegerFromBitArray(bits); | 2435 | var permission = this.CreateIntegerFromBitArray(bits); |
2464 | 2436 | ||
2465 | if (null == user) | 2437 | if (null == user) |
2466 | { | 2438 | { |
@@ -2479,7 +2451,7 @@ namespace WixToolset.Util | |||
2479 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedSecureObjects", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X64 | CustomActionPlatforms.X86); | 2451 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedSecureObjects", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X64 | CustomActionPlatforms.X86); |
2480 | 2452 | ||
2481 | var id = this.ParseHelper.CreateIdentifier("sec", objectId, tableName, domain, user); | 2453 | var id = this.ParseHelper.CreateIdentifier("sec", objectId, tableName, domain, user); |
2482 | var tuple = new SecureObjectsTuple(sourceLineNumbers, id) | 2454 | section.AddTuple(new SecureObjectsTuple(sourceLineNumbers, id) |
2483 | { | 2455 | { |
2484 | SecureObject = objectId, | 2456 | SecureObject = objectId, |
2485 | Table = tableName, | 2457 | Table = tableName, |
@@ -2487,9 +2459,7 @@ namespace WixToolset.Util | |||
2487 | User = user, | 2459 | User = user, |
2488 | Permission = permission, | 2460 | Permission = permission, |
2489 | ComponentRef = componentId, | 2461 | ComponentRef = componentId, |
2490 | }; | 2462 | }); |
2491 | |||
2492 | section.Tuples.Add(tuple); | ||
2493 | } | 2463 | } |
2494 | } | 2464 | } |
2495 | 2465 | ||
@@ -2499,7 +2469,7 @@ namespace WixToolset.Util | |||
2499 | /// <param name="element">Element to parse.</param> | 2469 | /// <param name="element">Element to parse.</param> |
2500 | private void ParseProductSearchElement(Intermediate intermediate, IntermediateSection section, XElement element) | 2470 | private void ParseProductSearchElement(Intermediate intermediate, IntermediateSection section, XElement element) |
2501 | { | 2471 | { |
2502 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2472 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2503 | Identifier id = null; | 2473 | Identifier id = null; |
2504 | string variable = null; | 2474 | string variable = null; |
2505 | string condition = null; | 2475 | string condition = null; |
@@ -2507,9 +2477,9 @@ namespace WixToolset.Util | |||
2507 | string productCode = null; | 2477 | string productCode = null; |
2508 | string upgradeCode = null; | 2478 | string upgradeCode = null; |
2509 | 2479 | ||
2510 | Serialize.ProductSearch.ResultType result = Serialize.ProductSearch.ResultType.NotSet; | 2480 | var result = Serialize.ProductSearch.ResultType.NotSet; |
2511 | 2481 | ||
2512 | foreach (XAttribute attrib in element.Attributes()) | 2482 | foreach (var attrib in element.Attributes()) |
2513 | { | 2483 | { |
2514 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2484 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2515 | { | 2485 | { |
@@ -2528,7 +2498,7 @@ namespace WixToolset.Util | |||
2528 | upgradeCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib, false); | 2498 | upgradeCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib, false); |
2529 | break; | 2499 | break; |
2530 | case "Result": | 2500 | case "Result": |
2531 | string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 2501 | var resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
2532 | if (!Serialize.ProductSearch.TryParseResultType(resultValue, out result)) | 2502 | if (!Serialize.ProductSearch.TryParseResultType(resultValue, out result)) |
2533 | { | 2503 | { |
2534 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, | 2504 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, |
@@ -2571,7 +2541,7 @@ namespace WixToolset.Util | |||
2571 | 2541 | ||
2572 | if (!this.Messaging.EncounteredError) | 2542 | if (!this.Messaging.EncounteredError) |
2573 | { | 2543 | { |
2574 | WixProductSearchAttributes attributes = WixProductSearchAttributes.Version; | 2544 | var attributes = WixProductSearchAttributes.Version; |
2575 | switch (result) | 2545 | switch (result) |
2576 | { | 2546 | { |
2577 | case Serialize.ProductSearch.ResultType.version: | 2547 | case Serialize.ProductSearch.ResultType.version: |
@@ -2594,7 +2564,7 @@ namespace WixToolset.Util | |||
2594 | attributes |= WixProductSearchAttributes.UpgradeCode; | 2564 | attributes |= WixProductSearchAttributes.UpgradeCode; |
2595 | } | 2565 | } |
2596 | 2566 | ||
2597 | section.Tuples.Add(new WixProductSearchTuple(sourceLineNumbers, id) | 2567 | section.AddTuple(new WixProductSearchTuple(sourceLineNumbers, id) |
2598 | { | 2568 | { |
2599 | Guid = productCode ?? upgradeCode, | 2569 | Guid = productCode ?? upgradeCode, |
2600 | Attributes = attributes, | 2570 | Attributes = attributes, |
@@ -2608,7 +2578,7 @@ namespace WixToolset.Util | |||
2608 | /// <param name="element">Element to parse.</param> | 2578 | /// <param name="element">Element to parse.</param> |
2609 | private void ParseRegistrySearchElement(Intermediate intermediate, IntermediateSection section, XElement element) | 2579 | private void ParseRegistrySearchElement(Intermediate intermediate, IntermediateSection section, XElement element) |
2610 | { | 2580 | { |
2611 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2581 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2612 | Identifier id = null; | 2582 | Identifier id = null; |
2613 | string variable = null; | 2583 | string variable = null; |
2614 | string condition = null; | 2584 | string condition = null; |
@@ -2616,12 +2586,12 @@ namespace WixToolset.Util | |||
2616 | RegistryRootType? root = null; | 2586 | RegistryRootType? root = null; |
2617 | string key = null; | 2587 | string key = null; |
2618 | string value = null; | 2588 | string value = null; |
2619 | YesNoType expand = YesNoType.NotSet; | 2589 | var expand = YesNoType.NotSet; |
2620 | YesNoType win64 = YesNoType.NotSet; | 2590 | var win64 = YesNoType.NotSet; |
2621 | Serialize.RegistrySearch.ResultType result = Serialize.RegistrySearch.ResultType.NotSet; | 2591 | var result = Serialize.RegistrySearch.ResultType.NotSet; |
2622 | Serialize.RegistrySearch.FormatType format = Serialize.RegistrySearch.FormatType.raw; | 2592 | var format = Serialize.RegistrySearch.FormatType.raw; |
2623 | 2593 | ||
2624 | foreach (XAttribute attrib in element.Attributes()) | 2594 | foreach (var attrib in element.Attributes()) |
2625 | { | 2595 | { |
2626 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2596 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2627 | { | 2597 | { |
@@ -2657,7 +2627,7 @@ namespace WixToolset.Util | |||
2657 | } | 2627 | } |
2658 | break; | 2628 | break; |
2659 | case "Result": | 2629 | case "Result": |
2660 | string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 2630 | var resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
2661 | if (!Serialize.RegistrySearch.TryParseResultType(resultValue, out result)) | 2631 | if (!Serialize.RegistrySearch.TryParseResultType(resultValue, out result)) |
2662 | { | 2632 | { |
2663 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, | 2633 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName, |
@@ -2698,7 +2668,7 @@ namespace WixToolset.Util | |||
2698 | id = this.ParseHelper.CreateIdentifier("wrs", variable, condition, after, root.ToString(), key, value, result.ToString()); | 2668 | id = this.ParseHelper.CreateIdentifier("wrs", variable, condition, after, root.ToString(), key, value, result.ToString()); |
2699 | } | 2669 | } |
2700 | 2670 | ||
2701 | WixRegistrySearchAttributes attributes = WixRegistrySearchAttributes.Raw; | 2671 | var attributes = WixRegistrySearchAttributes.Raw; |
2702 | switch (format) | 2672 | switch (format) |
2703 | { | 2673 | { |
2704 | case Serialize.RegistrySearch.FormatType.raw: | 2674 | case Serialize.RegistrySearch.FormatType.raw: |
@@ -2741,9 +2711,9 @@ namespace WixToolset.Util | |||
2741 | 2711 | ||
2742 | if (!this.Messaging.EncounteredError) | 2712 | if (!this.Messaging.EncounteredError) |
2743 | { | 2713 | { |
2744 | section.Tuples.Add(new WixRegistrySearchTuple(sourceLineNumbers, id) | 2714 | section.AddTuple(new WixRegistrySearchTuple(sourceLineNumbers, id) |
2745 | { | 2715 | { |
2746 | Root = (RegistryRootType)root, | 2716 | Root = root.Value, |
2747 | Key = key, | 2717 | Key = key, |
2748 | Value = value, | 2718 | Value = value, |
2749 | Attributes = attributes, | 2719 | Attributes = attributes, |
@@ -2758,12 +2728,12 @@ namespace WixToolset.Util | |||
2758 | /// <param name="componentId">Identifier of parent component.</param> | 2728 | /// <param name="componentId">Identifier of parent component.</param> |
2759 | private void ParseRemoveFolderExElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 2729 | private void ParseRemoveFolderExElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
2760 | { | 2730 | { |
2761 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2731 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2762 | Identifier id = null; | 2732 | Identifier id = null; |
2763 | int on = (int)WixRemoveFolderExOn.Uninstall; | 2733 | var on = (int)WixRemoveFolderExOn.Uninstall; |
2764 | string property = null; | 2734 | string property = null; |
2765 | 2735 | ||
2766 | foreach (XAttribute attrib in element.Attributes()) | 2736 | foreach (var attrib in element.Attributes()) |
2767 | { | 2737 | { |
2768 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2738 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2769 | { | 2739 | { |
@@ -2773,7 +2743,7 @@ namespace WixToolset.Util | |||
2773 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); | 2743 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); |
2774 | break; | 2744 | break; |
2775 | case "On": | 2745 | case "On": |
2776 | string onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 2746 | var onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
2777 | if (onValue.Length == 0) | 2747 | if (onValue.Length == 0) |
2778 | { | 2748 | { |
2779 | on = CompilerConstants.IllegalInteger; | 2749 | on = CompilerConstants.IllegalInteger; |
@@ -2828,14 +2798,12 @@ namespace WixToolset.Util | |||
2828 | { | 2798 | { |
2829 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RemoveFoldersEx", this.Context.Platform, CustomActionPlatforms.X86); | 2799 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RemoveFoldersEx", this.Context.Platform, CustomActionPlatforms.X86); |
2830 | 2800 | ||
2831 | var tuple = new WixRemoveFolderExTuple(sourceLineNumbers) | 2801 | section.AddTuple(new WixRemoveFolderExTuple(sourceLineNumbers, id) |
2832 | { | 2802 | { |
2833 | ComponentRef = componentId, | 2803 | ComponentRef = componentId, |
2834 | Property = property, | 2804 | Property = property, |
2835 | InstallMode = (int)on, | 2805 | InstallMode = on, |
2836 | }; | 2806 | }); |
2837 | |||
2838 | section.Tuples.Add(tuple); | ||
2839 | 2807 | ||
2840 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile"); | 2808 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile"); |
2841 | } | 2809 | } |
@@ -2848,12 +2816,12 @@ namespace WixToolset.Util | |||
2848 | /// <param name="componentId">The identity of the parent component.</param> | 2816 | /// <param name="componentId">The identity of the parent component.</param> |
2849 | private void ParseRestartResourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 2817 | private void ParseRestartResourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
2850 | { | 2818 | { |
2851 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2819 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2852 | Identifier id = null; | 2820 | Identifier id = null; |
2853 | string resource = null; | 2821 | string resource = null; |
2854 | int attributes = CompilerConstants.IntegerNotSet; | 2822 | var attributes = CompilerConstants.IntegerNotSet; |
2855 | 2823 | ||
2856 | foreach (XAttribute attrib in element.Attributes()) | 2824 | foreach (var attrib in element.Attributes()) |
2857 | { | 2825 | { |
2858 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2826 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2859 | { | 2827 | { |
@@ -2906,14 +2874,12 @@ namespace WixToolset.Util | |||
2906 | { | 2874 | { |
2907 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RegisterRestartResources", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | 2875 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RegisterRestartResources", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
2908 | 2876 | ||
2909 | var tuple = new WixRestartResourceTuple(sourceLineNumbers) | 2877 | section.AddTuple(new WixRestartResourceTuple(sourceLineNumbers, id) |
2910 | { | 2878 | { |
2911 | ComponentRef = componentId, | 2879 | ComponentRef = componentId, |
2912 | Resource = resource, | 2880 | Resource = resource, |
2913 | Attributes = attributes, | 2881 | Attributes = attributes, |
2914 | }; | 2882 | }); |
2915 | |||
2916 | section.Tuples.Add(tuple); | ||
2917 | } | 2883 | } |
2918 | } | 2884 | } |
2919 | 2885 | ||
@@ -2926,18 +2892,18 @@ namespace WixToolset.Util | |||
2926 | /// <param name="parentTableServiceName">Optional name of service </param> | 2892 | /// <param name="parentTableServiceName">Optional name of service </param> |
2927 | private void ParseServiceConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string parentTableName, string parentTableServiceName) | 2893 | private void ParseServiceConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string parentTableName, string parentTableServiceName) |
2928 | { | 2894 | { |
2929 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2895 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
2930 | string firstFailureActionType = null; | 2896 | string firstFailureActionType = null; |
2931 | bool newService = false; | 2897 | var newService = false; |
2932 | string programCommandLine = null; | 2898 | string programCommandLine = null; |
2933 | string rebootMessage = null; | 2899 | string rebootMessage = null; |
2934 | int resetPeriod = CompilerConstants.IntegerNotSet; | 2900 | var resetPeriod = CompilerConstants.IntegerNotSet; |
2935 | int restartServiceDelay = CompilerConstants.IntegerNotSet; | 2901 | var restartServiceDelay = CompilerConstants.IntegerNotSet; |
2936 | string secondFailureActionType = null; | 2902 | string secondFailureActionType = null; |
2937 | string serviceName = null; | 2903 | string serviceName = null; |
2938 | string thirdFailureActionType = null; | 2904 | string thirdFailureActionType = null; |
2939 | 2905 | ||
2940 | foreach (XAttribute attrib in element.Attributes()) | 2906 | foreach (var attrib in element.Attributes()) |
2941 | { | 2907 | { |
2942 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 2908 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
2943 | { | 2909 | { |
@@ -3000,7 +2966,7 @@ namespace WixToolset.Util | |||
3000 | { | 2966 | { |
3001 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedServiceConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | 2967 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedServiceConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
3002 | 2968 | ||
3003 | var tuple = new ServiceConfigTuple(sourceLineNumbers) | 2969 | section.AddTuple(new ServiceConfigTuple(sourceLineNumbers) |
3004 | { | 2970 | { |
3005 | ServiceName = serviceName, | 2971 | ServiceName = serviceName, |
3006 | ComponentRef = componentId, | 2972 | ComponentRef = componentId, |
@@ -3012,9 +2978,7 @@ namespace WixToolset.Util | |||
3012 | RestartServiceDelayInSeconds = restartServiceDelay, | 2978 | RestartServiceDelayInSeconds = restartServiceDelay, |
3013 | ProgramCommandLine = programCommandLine, | 2979 | ProgramCommandLine = programCommandLine, |
3014 | RebootMessage = rebootMessage, | 2980 | RebootMessage = rebootMessage, |
3015 | }; | 2981 | }); |
3016 | |||
3017 | section.Tuples.Add(tuple); | ||
3018 | } | 2982 | } |
3019 | } | 2983 | } |
3020 | 2984 | ||
@@ -3026,16 +2990,16 @@ namespace WixToolset.Util | |||
3026 | /// <param name="win64">Indicates whether the path is a 64-bit path.</param> | 2990 | /// <param name="win64">Indicates whether the path is a 64-bit path.</param> |
3027 | private void ParseTouchFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool win64) | 2991 | private void ParseTouchFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool win64) |
3028 | { | 2992 | { |
3029 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 2993 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
3030 | Identifier id = null; | 2994 | Identifier id = null; |
3031 | string path = null; | 2995 | string path = null; |
3032 | YesNoType onInstall = YesNoType.NotSet; | 2996 | var onInstall = YesNoType.NotSet; |
3033 | YesNoType onReinstall = YesNoType.NotSet; | 2997 | var onReinstall = YesNoType.NotSet; |
3034 | YesNoType onUninstall = YesNoType.NotSet; | 2998 | var onUninstall = YesNoType.NotSet; |
3035 | YesNoType nonvital = YesNoType.NotSet; | 2999 | var nonvital = YesNoType.NotSet; |
3036 | int attributes = 0; | 3000 | int attributes = 0; |
3037 | 3001 | ||
3038 | foreach (XAttribute attrib in element.Attributes()) | 3002 | foreach (var attrib in element.Attributes()) |
3039 | { | 3003 | { |
3040 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 3004 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
3041 | { | 3005 | { |
@@ -3097,14 +3061,12 @@ namespace WixToolset.Util | |||
3097 | 3061 | ||
3098 | if (!this.Messaging.EncounteredError) | 3062 | if (!this.Messaging.EncounteredError) |
3099 | { | 3063 | { |
3100 | var tuple = new WixTouchFileTuple(sourceLineNumbers) | 3064 | section.AddTuple(new WixTouchFileTuple(sourceLineNumbers, id) |
3101 | { | 3065 | { |
3102 | ComponentRef = componentId, | 3066 | ComponentRef = componentId, |
3103 | Path = path, | 3067 | Path = path, |
3104 | Attributes = attributes, | 3068 | Attributes = attributes, |
3105 | }; | 3069 | }); |
3106 | |||
3107 | section.Tuples.Add(tuple); | ||
3108 | 3070 | ||
3109 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "TouchFileDuringInstall", this.Context.Platform, CustomActionPlatforms.X86); | 3071 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "TouchFileDuringInstall", this.Context.Platform, CustomActionPlatforms.X86); |
3110 | } | 3072 | } |
@@ -3117,14 +3079,14 @@ namespace WixToolset.Util | |||
3117 | /// <param name="componentId">Optional identifier of parent component.</param> | 3079 | /// <param name="componentId">Optional identifier of parent component.</param> |
3118 | private void ParseUserElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 3080 | private void ParseUserElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
3119 | { | 3081 | { |
3120 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 3082 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
3121 | Identifier id = null; | 3083 | Identifier id = null; |
3122 | int attributes = 0; | 3084 | int attributes = 0; |
3123 | string domain = null; | 3085 | string domain = null; |
3124 | string name = null; | 3086 | string name = null; |
3125 | string password = null; | 3087 | string password = null; |
3126 | 3088 | ||
3127 | foreach (XAttribute attrib in element.Attributes()) | 3089 | foreach (var attrib in element.Attributes()) |
3128 | { | 3090 | { |
3129 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 3091 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
3130 | { | 3092 | { |
@@ -3274,7 +3236,7 @@ namespace WixToolset.Util | |||
3274 | 3236 | ||
3275 | if (null == id) | 3237 | if (null == id) |
3276 | { | 3238 | { |
3277 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); | 3239 | id = this.ParseHelper.CreateIdentifier("usr", componentId, name); |
3278 | } | 3240 | } |
3279 | 3241 | ||
3280 | if (null == name) | 3242 | if (null == name) |
@@ -3282,7 +3244,7 @@ namespace WixToolset.Util | |||
3282 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name")); | 3244 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name")); |
3283 | } | 3245 | } |
3284 | 3246 | ||
3285 | foreach (XElement child in element.Elements()) | 3247 | foreach (var child in element.Elements()) |
3286 | { | 3248 | { |
3287 | if (this.Namespace == child.Name.Namespace) | 3249 | if (this.Namespace == child.Name.Namespace) |
3288 | { | 3250 | { |
@@ -3291,7 +3253,7 @@ namespace WixToolset.Util | |||
3291 | case "GroupRef": | 3253 | case "GroupRef": |
3292 | if (null == componentId) | 3254 | if (null == componentId) |
3293 | { | 3255 | { |
3294 | SourceLineNumber childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child); | 3256 | var childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child); |
3295 | this.Messaging.Write(UtilErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName)); | 3257 | this.Messaging.Write(UtilErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName)); |
3296 | } | 3258 | } |
3297 | 3259 | ||
@@ -3315,16 +3277,14 @@ namespace WixToolset.Util | |||
3315 | 3277 | ||
3316 | if (!this.Messaging.EncounteredError) | 3278 | if (!this.Messaging.EncounteredError) |
3317 | { | 3279 | { |
3318 | var tuple = new UserTuple(sourceLineNumbers, id) | 3280 | section.AddTuple(new UserTuple(sourceLineNumbers, id) |
3319 | { | 3281 | { |
3320 | ComponentRef = componentId, | 3282 | ComponentRef = componentId, |
3321 | Name = name, | 3283 | Name = name, |
3322 | Domain = domain, | 3284 | Domain = domain, |
3323 | Password = password, | 3285 | Password = password, |
3324 | Attributes = attributes, | 3286 | Attributes = attributes, |
3325 | }; | 3287 | }); |
3326 | |||
3327 | section.Tuples.Add(tuple); | ||
3328 | } | 3288 | } |
3329 | } | 3289 | } |
3330 | 3290 | ||
@@ -3335,7 +3295,7 @@ namespace WixToolset.Util | |||
3335 | /// <param name="componentId">Identifier of parent component.</param> | 3295 | /// <param name="componentId">Identifier of parent component.</param> |
3336 | private void ParseXmlFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 3296 | private void ParseXmlFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
3337 | { | 3297 | { |
3338 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 3298 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
3339 | Identifier id = null; | 3299 | Identifier id = null; |
3340 | string file = null; | 3300 | string file = null; |
3341 | string elementPath = null; | 3301 | string elementPath = null; |
@@ -3344,14 +3304,14 @@ namespace WixToolset.Util | |||
3344 | int sequence = -1; | 3304 | int sequence = -1; |
3345 | int flags = 0; | 3305 | int flags = 0; |
3346 | 3306 | ||
3347 | foreach (XAttribute attrib in element.Attributes()) | 3307 | foreach (var attrib in element.Attributes()) |
3348 | { | 3308 | { |
3349 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 3309 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
3350 | { | 3310 | { |
3351 | switch (attrib.Name.LocalName) | 3311 | switch (attrib.Name.LocalName) |
3352 | { | 3312 | { |
3353 | case "Action": | 3313 | case "Action": |
3354 | string actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 3314 | var actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
3355 | switch (actionValue) | 3315 | switch (actionValue) |
3356 | { | 3316 | { |
3357 | case "createElement": | 3317 | case "createElement": |
@@ -3429,7 +3389,7 @@ namespace WixToolset.Util | |||
3429 | 3389 | ||
3430 | if (null == id) | 3390 | if (null == id) |
3431 | { | 3391 | { |
3432 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); | 3392 | id = this.ParseHelper.CreateIdentifier("uxf", componentId, file, elementPath, name); |
3433 | } | 3393 | } |
3434 | 3394 | ||
3435 | if (null == file) | 3395 | if (null == file) |
@@ -3451,7 +3411,7 @@ namespace WixToolset.Util | |||
3451 | 3411 | ||
3452 | if (!this.Messaging.EncounteredError) | 3412 | if (!this.Messaging.EncounteredError) |
3453 | { | 3413 | { |
3454 | var tuple = new XmlFileTuple(sourceLineNumbers, id) | 3414 | var tuple = section.AddTuple(new XmlFileTuple(sourceLineNumbers, id) |
3455 | { | 3415 | { |
3456 | File = file, | 3416 | File = file, |
3457 | ElementPath = elementPath, | 3417 | ElementPath = elementPath, |
@@ -3459,15 +3419,14 @@ namespace WixToolset.Util | |||
3459 | Value = value, | 3419 | Value = value, |
3460 | Flags = flags, | 3420 | Flags = flags, |
3461 | ComponentRef = componentId, | 3421 | ComponentRef = componentId, |
3462 | }; | 3422 | }); |
3463 | if (-1 != sequence) | 3423 | if (-1 != sequence) |
3464 | { | 3424 | { |
3465 | tuple.Sequence = sequence; | 3425 | tuple.Sequence = sequence; |
3466 | } | 3426 | } |
3467 | section.Tuples.Add(tuple); | ||
3468 | } | 3427 | } |
3469 | 3428 | ||
3470 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | 3429 | this.AddReferenceToSchedXmlFile(sourceLineNumbers, section); |
3471 | } | 3430 | } |
3472 | 3431 | ||
3473 | /// <summary> | 3432 | /// <summary> |
@@ -3478,18 +3437,18 @@ namespace WixToolset.Util | |||
3478 | /// <param name="nested">Whether or not the element is nested.</param> | 3437 | /// <param name="nested">Whether or not the element is nested.</param> |
3479 | private void ParseXmlConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool nested) | 3438 | private void ParseXmlConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool nested) |
3480 | { | 3439 | { |
3481 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 3440 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
3482 | Identifier id = null; | 3441 | Identifier id = null; |
3483 | string elementId = null; | 3442 | string elementId = null; |
3484 | string elementPath = null; | 3443 | string elementPath = null; |
3485 | int flags = 0; | 3444 | int flags = 0; |
3486 | string file = null; | 3445 | string file = null; |
3487 | string name = null; | 3446 | string name = null; |
3488 | int sequence = CompilerConstants.IntegerNotSet; | 3447 | var sequence = CompilerConstants.IntegerNotSet; |
3489 | string value = null; | 3448 | string value = null; |
3490 | string verifyPath = null; | 3449 | string verifyPath = null; |
3491 | 3450 | ||
3492 | foreach (XAttribute attrib in element.Attributes()) | 3451 | foreach (var attrib in element.Attributes()) |
3493 | { | 3452 | { |
3494 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | 3453 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) |
3495 | { | 3454 | { |
@@ -3539,7 +3498,7 @@ namespace WixToolset.Util | |||
3539 | } | 3498 | } |
3540 | else | 3499 | else |
3541 | { | 3500 | { |
3542 | string nodeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 3501 | var nodeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
3543 | switch (nodeValue) | 3502 | switch (nodeValue) |
3544 | { | 3503 | { |
3545 | case "element": | 3504 | case "element": |
@@ -3564,7 +3523,7 @@ namespace WixToolset.Util | |||
3564 | } | 3523 | } |
3565 | else | 3524 | else |
3566 | { | 3525 | { |
3567 | string onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 3526 | var onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
3568 | switch (onValue) | 3527 | switch (onValue) |
3569 | { | 3528 | { |
3570 | case "install": | 3529 | case "install": |
@@ -3607,7 +3566,7 @@ namespace WixToolset.Util | |||
3607 | 3566 | ||
3608 | if (null == id) | 3567 | if (null == id) |
3609 | { | 3568 | { |
3610 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id")); | 3569 | id = this.ParseHelper.CreateIdentifier("uxc", componentId, file, elementId, elementPath); |
3611 | } | 3570 | } |
3612 | 3571 | ||
3613 | if (null == file) | 3572 | if (null == file) |
@@ -3631,10 +3590,10 @@ namespace WixToolset.Util | |||
3631 | this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, element.Name.LocalName, "ElementId", "Action", "Node", "On")); | 3590 | this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, element.Name.LocalName, "ElementId", "Action", "Node", "On")); |
3632 | } | 3591 | } |
3633 | 3592 | ||
3634 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "XmlConfig", elementId); | 3593 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilTupleDefinitions.XmlConfig, elementId); |
3635 | } | 3594 | } |
3636 | 3595 | ||
3637 | string innerText = this.ParseHelper.GetTrimmedInnerText(element); | 3596 | var innerText = this.ParseHelper.GetTrimmedInnerText(element); |
3638 | if (null != value) | 3597 | if (null != value) |
3639 | { | 3598 | { |
3640 | // cannot specify both the value attribute and inner text | 3599 | // cannot specify both the value attribute and inner text |
@@ -3652,7 +3611,7 @@ namespace WixToolset.Util | |||
3652 | } | 3611 | } |
3653 | 3612 | ||
3654 | // find unexpected child elements | 3613 | // find unexpected child elements |
3655 | foreach (XElement child in element.Elements()) | 3614 | foreach (var child in element.Elements()) |
3656 | { | 3615 | { |
3657 | if (this.Namespace == child.Name.Namespace) | 3616 | if (this.Namespace == child.Name.Namespace) |
3658 | { | 3617 | { |
@@ -3681,21 +3640,20 @@ namespace WixToolset.Util | |||
3681 | 3640 | ||
3682 | if (!this.Messaging.EncounteredError) | 3641 | if (!this.Messaging.EncounteredError) |
3683 | { | 3642 | { |
3684 | var tuple = new XmlConfigTuple(sourceLineNumbers, id) | 3643 | var tuple = section.AddTuple(new XmlConfigTuple(sourceLineNumbers, id) |
3685 | { | 3644 | { |
3686 | File=file, | 3645 | File = file, |
3687 | ElementPath=elementId ??elementPath, | 3646 | ElementPath = elementId ?? elementPath, |
3688 | VerifyPath=verifyPath, | 3647 | VerifyPath = verifyPath, |
3689 | Name=name, | 3648 | Name = name, |
3690 | Value=value, | 3649 | Value = value, |
3691 | Flags=flags, | 3650 | Flags = flags, |
3692 | ComponentRef=componentId, | 3651 | ComponentRef = componentId, |
3693 | }; | 3652 | }); |
3694 | if (CompilerConstants.IntegerNotSet != sequence) | 3653 | if (CompilerConstants.IntegerNotSet != sequence) |
3695 | { | 3654 | { |
3696 | tuple.Sequence = sequence; | 3655 | tuple.Sequence = sequence; |
3697 | } | 3656 | } |
3698 | section.Tuples.Add(tuple); | ||
3699 | } | 3657 | } |
3700 | 3658 | ||
3701 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | 3659 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
@@ -3727,7 +3685,7 @@ namespace WixToolset.Util | |||
3727 | throw new ArgumentException(String.Format("Can only convert a bit array with 32-bits to integer. Actual number of bits in array: {0}", bits.Length), "bits"); | 3685 | throw new ArgumentException(String.Format("Can only convert a bit array with 32-bits to integer. Actual number of bits in array: {0}", bits.Length), "bits"); |
3728 | } | 3686 | } |
3729 | 3687 | ||
3730 | int[] intArray = new int[1]; | 3688 | var intArray = new int[1]; |
3731 | bits.CopyTo(intArray, 0); | 3689 | bits.CopyTo(intArray, 0); |
3732 | 3690 | ||
3733 | return intArray[0]; | 3691 | return intArray[0]; |
@@ -3735,7 +3693,7 @@ namespace WixToolset.Util | |||
3735 | 3693 | ||
3736 | private bool TrySetBitFromName(string[] attributeNames, string attributeName, YesNoType attributeValue, BitArray bits, int offset) | 3694 | private bool TrySetBitFromName(string[] attributeNames, string attributeName, YesNoType attributeValue, BitArray bits, int offset) |
3737 | { | 3695 | { |
3738 | for (int i = 0; i < attributeNames.Length; i++) | 3696 | for (var i = 0; i < attributeNames.Length; i++) |
3739 | { | 3697 | { |
3740 | if (attributeName.Equals(attributeNames[i], StringComparison.Ordinal)) | 3698 | if (attributeName.Equals(attributeNames[i], StringComparison.Ordinal)) |
3741 | { | 3699 | { |
@@ -3747,6 +3705,11 @@ namespace WixToolset.Util | |||
3747 | return false; | 3705 | return false; |
3748 | } | 3706 | } |
3749 | 3707 | ||
3708 | private void AddReferenceToSchedXmlFile(SourceLineNumber sourceLineNumbers, IntermediateSection section) | ||
3709 | { | ||
3710 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | ||
3711 | } | ||
3712 | |||
3750 | /// <summary> | 3713 | /// <summary> |
3751 | /// Private class that stores the data from a parsed PerformanceCounter element. | 3714 | /// Private class that stores the data from a parsed PerformanceCounter element. |
3752 | /// </summary> | 3715 | /// </summary> |
diff --git a/src/wixext/UtilTableDefinitions.cs b/src/wixext/UtilTableDefinitions.cs new file mode 100644 index 00000000..78f21ebc --- /dev/null +++ b/src/wixext/UtilTableDefinitions.cs | |||
@@ -0,0 +1,300 @@ | |||
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 | |||
3 | namespace WixToolset.Util | ||
4 | { | ||
5 | using WixToolset.Data.WindowsInstaller; | ||
6 | |||
7 | public static class UtilTableDefinitions | ||
8 | { | ||
9 | public static readonly TableDefinition Wix4CloseApplication = new TableDefinition( | ||
10 | "Wix4CloseApplication", | ||
11 | new[] | ||
12 | { | ||
13 | new ColumnDefinition("Wix4CloseApplication", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token in table.", modularizeType: ColumnModularizeType.Column), | ||
14 | new ColumnDefinition("Target", ColumnType.Localized, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name of executable to ensure is closed.", modularizeType: ColumnModularizeType.Property), | ||
15 | new ColumnDefinition("Description", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Description string displayed to user when executable is in use.", modularizeType: ColumnModularizeType.Property, forceLocalizable: true), | ||
16 | new ColumnDefinition("Condition", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Condition, description: "Optional expression which skips the closing.", modularizeType: ColumnModularizeType.Condition, forceLocalizable: true), | ||
17 | new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "A 32-bit word that specifies the attribute flags to be applied."), | ||
18 | new ColumnDefinition("Sequence", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 1, maxValue: 2147483647, description: "Sequence to order the closings by."), | ||
19 | new ColumnDefinition("Property", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, description: "Optional property that is set to the number of running instances of the app.", modularizeType: ColumnModularizeType.Property, forceLocalizable: true), | ||
20 | new ColumnDefinition("TerminateExitCode", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "Exit code to return from a terminated application."), | ||
21 | new ColumnDefinition("Timeout", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 1, maxValue: 2147483647, description: "Timeout in milliseconds before scheduling restart or terminating application."), | ||
22 | }, | ||
23 | tupleDefinitionName: UtilTupleDefinitions.WixCloseApplication.Name, | ||
24 | tupleIdIsPrimaryKey: true | ||
25 | ); | ||
26 | |||
27 | public static readonly TableDefinition Wix4RemoveFolderEx = new TableDefinition( | ||
28 | "Wix4RemoveFolderEx", | ||
29 | new[] | ||
30 | { | ||
31 | new ColumnDefinition("Wix4RemoveFolderEx", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Identifier for the WixRemoveFolderEx row in the package.", modularizeType: ColumnModularizeType.Column), | ||
32 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
33 | new ColumnDefinition("Property", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, description: "Name of Property that contains the root of the directory tree to remove.", modularizeType: ColumnModularizeType.Property), | ||
34 | new ColumnDefinition("InstallMode", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 3, description: "1 == Remove only when the associated component is being installed (msiInstallStateLocal or msiInstallStateSource), 2 == Remove only when the associated component is being removed (msiInstallStateAbsent), 3 = Remove in either of the above cases."), | ||
35 | }, | ||
36 | tupleDefinitionName: UtilTupleDefinitions.WixRemoveFolderEx.Name, | ||
37 | tupleIdIsPrimaryKey: true | ||
38 | ); | ||
39 | |||
40 | public static readonly TableDefinition Wix4RestartResource = new TableDefinition( | ||
41 | "Wix4RestartResource", | ||
42 | new[] | ||
43 | { | ||
44 | new ColumnDefinition("Wix4RestartResource", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized identifier.", modularizeType: ColumnModularizeType.Column), | ||
45 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table used to determine install state.", modularizeType: ColumnModularizeType.Column), | ||
46 | new ColumnDefinition("Resource", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "The resource to be registered with the Restart Manager.", modularizeType: ColumnModularizeType.Property), | ||
47 | new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "A 32-bit word that specifies the type of resource and flags used for processing."), | ||
48 | }, | ||
49 | tupleDefinitionName: UtilTupleDefinitions.WixRestartResource.Name, | ||
50 | tupleIdIsPrimaryKey: true | ||
51 | ); | ||
52 | |||
53 | public static readonly TableDefinition Wix4FileShare = new TableDefinition( | ||
54 | "Wix4FileShare", | ||
55 | new[] | ||
56 | { | ||
57 | new ColumnDefinition("Wix4FileShare", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized identifier", modularizeType: ColumnModularizeType.Column), | ||
58 | new ColumnDefinition("ShareName", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "The actual share name used"), | ||
59 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
60 | new ColumnDefinition("Description", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Description string displayed for the file share"), | ||
61 | new ColumnDefinition("Directory_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Directory", keyColumn: 1, description: "Foreign key referencing directory that the share is created on", modularizeType: ColumnModularizeType.Column), | ||
62 | }, | ||
63 | tupleDefinitionName: UtilTupleDefinitions.FileShare.Name, | ||
64 | tupleIdIsPrimaryKey: true | ||
65 | ); | ||
66 | |||
67 | public static readonly TableDefinition Wix4FileSharePermissions = new TableDefinition( | ||
68 | "Wix4FileSharePermissions", | ||
69 | new[] | ||
70 | { | ||
71 | new ColumnDefinition("Wix4FileShare_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "FileShare", keyColumn: 1, description: "FileShare that these premissions are to be applied to.", modularizeType: ColumnModularizeType.Column), | ||
72 | new ColumnDefinition("Wix4User_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4User", description: "User that these premissions are to apply to.", modularizeType: ColumnModularizeType.Column), | ||
73 | new ColumnDefinition("Permissions", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, description: "Permissions int, as in EXPLICIT_ACCESS.grfAccessPermissions in MSDN"), | ||
74 | }, | ||
75 | tupleDefinitionName: UtilTupleDefinitions.FileSharePermissions.Name, | ||
76 | tupleIdIsPrimaryKey: false | ||
77 | ); | ||
78 | |||
79 | public static readonly TableDefinition Wix4Group = new TableDefinition( | ||
80 | "Wix4Group", | ||
81 | new[] | ||
82 | { | ||
83 | new ColumnDefinition("Wix4Group", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column), | ||
84 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Text, keyTable: "Component", keyColumn: 1, description: "Foreign key, Component used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
85 | new ColumnDefinition("Name", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Group name", modularizeType: ColumnModularizeType.Property), | ||
86 | new ColumnDefinition("Domain", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Group domain", modularizeType: ColumnModularizeType.Property), | ||
87 | }, | ||
88 | tupleDefinitionName: UtilTupleDefinitions.Group.Name, | ||
89 | tupleIdIsPrimaryKey: true | ||
90 | ); | ||
91 | |||
92 | public static readonly TableDefinition Wix4InternetShortcut = new TableDefinition( | ||
93 | "Wix4InternetShortcut", | ||
94 | new[] | ||
95 | { | ||
96 | new ColumnDefinition("Wix4InternetShortcut", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token in table.", modularizeType: ColumnModularizeType.Column), | ||
97 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Text, keyTable: "Component", keyColumn: 1, description: "Foreign key, Component used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
98 | new ColumnDefinition("Directory_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Directory", keyColumn: 1, description: "Foreign key referencing directory that the shortcut is created in", modularizeType: ColumnModularizeType.Column), | ||
99 | new ColumnDefinition("Name", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Name used for shortcut.", modularizeType: ColumnModularizeType.Property), | ||
100 | new ColumnDefinition("Target", ColumnType.Localized, 0, primaryKey: false, nullable: false, ColumnCategory.Text, description: "URL target."), | ||
101 | new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, description: "Attribute flags that control how the shortcut is created."), | ||
102 | new ColumnDefinition("IconFile", ColumnType.Localized, 0, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Icon file for shortcut"), | ||
103 | new ColumnDefinition("IconIndex", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Index of the icon being referenced."), | ||
104 | }, | ||
105 | tupleDefinitionName: UtilTupleDefinitions.WixInternetShortcut.Name, | ||
106 | tupleIdIsPrimaryKey: true | ||
107 | ); | ||
108 | |||
109 | public static readonly TableDefinition Wix4PerformanceCategory = new TableDefinition( | ||
110 | "Wix4PerformanceCategory", | ||
111 | new[] | ||
112 | { | ||
113 | new ColumnDefinition("Wix4PerformanceCategory", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token in table.", modularizeType: ColumnModularizeType.Column), | ||
114 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Component used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
115 | new ColumnDefinition("Name", ColumnType.String, 80, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Name of the performance counter category."), | ||
116 | new ColumnDefinition("IniData", ColumnType.Localized, 0, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Data that goes into the performance counter .ini file."), | ||
117 | new ColumnDefinition("ConstantData", ColumnType.Localized, 0, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Data that goes into the performance counter .h file."), | ||
118 | }, | ||
119 | tupleDefinitionName: UtilTupleDefinitions.PerformanceCategory.Name, | ||
120 | tupleIdIsPrimaryKey: true | ||
121 | ); | ||
122 | |||
123 | public static readonly TableDefinition Wix4Perfmon = new TableDefinition( | ||
124 | "Wix4Perfmon", | ||
125 | new[] | ||
126 | { | ||
127 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Component used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
128 | new ColumnDefinition("File", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Formatted, description: "Name of .INI file", modularizeType: ColumnModularizeType.Property), | ||
129 | new ColumnDefinition("Name", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Text, description: "Service name in registry"), | ||
130 | }, | ||
131 | tupleDefinitionName: UtilTupleDefinitions.Perfmon.Name, | ||
132 | tupleIdIsPrimaryKey: false | ||
133 | ); | ||
134 | |||
135 | public static readonly TableDefinition Wix4PerfmonManifest = new TableDefinition( | ||
136 | "Wix4PerfmonManifest", | ||
137 | new[] | ||
138 | { | ||
139 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Component used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
140 | new ColumnDefinition("File", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Formatted, description: "Name of perfmon manifest file", modularizeType: ColumnModularizeType.Property), | ||
141 | new ColumnDefinition("ResourceFileDirectory", ColumnType.String, 255, primaryKey: true, nullable: false, ColumnCategory.Formatted, description: "The path of the Resource File Directory"), | ||
142 | }, | ||
143 | tupleDefinitionName: UtilTupleDefinitions.PerfmonManifest.Name, | ||
144 | tupleIdIsPrimaryKey: false | ||
145 | ); | ||
146 | |||
147 | public static readonly TableDefinition Wix4EventManifest = new TableDefinition( | ||
148 | "Wix4EventManifest", | ||
149 | new[] | ||
150 | { | ||
151 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Component used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
152 | new ColumnDefinition("File", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Formatted, description: "Name of event manifest file", modularizeType: ColumnModularizeType.Property), | ||
153 | }, | ||
154 | tupleDefinitionName: UtilTupleDefinitions.EventManifest.Name, | ||
155 | tupleIdIsPrimaryKey: false | ||
156 | ); | ||
157 | |||
158 | public static readonly TableDefinition Wix4SecureObject = new TableDefinition( | ||
159 | "Wix4SecureObject", | ||
160 | new[] | ||
161 | { | ||
162 | new ColumnDefinition("Wix4SecureObject", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token in Table", modularizeType: ColumnModularizeType.Column), | ||
163 | new ColumnDefinition("Table", ColumnType.String, 32, primaryKey: true, nullable: false, ColumnCategory.Text, description: "Table SecureObject should be securing"), | ||
164 | new ColumnDefinition("Domain", ColumnType.String, 255, primaryKey: true, nullable: true, ColumnCategory.Text, description: "Domain half of user account to secure", modularizeType: ColumnModularizeType.Property), | ||
165 | new ColumnDefinition("User", ColumnType.String, 255, primaryKey: true, nullable: false, ColumnCategory.Text, description: "User name half of user account to secure", modularizeType: ColumnModularizeType.Property), | ||
166 | new ColumnDefinition("Permission", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: -2147483647, maxValue: 2147483647, description: "Permissions to grant to User"), | ||
167 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
168 | }, | ||
169 | tupleDefinitionName: UtilTupleDefinitions.SecureObjects.Name, | ||
170 | tupleIdIsPrimaryKey: false | ||
171 | ); | ||
172 | |||
173 | public static readonly TableDefinition Wix4ServiceConfig = new TableDefinition( | ||
174 | "Wix4ServiceConfig", | ||
175 | new[] | ||
176 | { | ||
177 | new ColumnDefinition("ServiceName", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Formatted, description: "Primary key, non-localized token"), | ||
178 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key, Component used to determine install state ", modularizeType: ColumnModularizeType.Column), | ||
179 | new ColumnDefinition("NewService", ColumnType.Number, 1, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 1, description: "Whether the affected service is being installed or already exists."), | ||
180 | new ColumnDefinition("FirstFailureActionType", ColumnType.String, 32, primaryKey: false, nullable: false, ColumnCategory.Text, description: "First failure action type for configured service to take."), | ||
181 | new ColumnDefinition("SecondFailureActionType", ColumnType.String, 32, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Second failure action type for configured service to take."), | ||
182 | new ColumnDefinition("ThirdFailureActionType", ColumnType.String, 32, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Third failure action type for configured service to take."), | ||
183 | new ColumnDefinition("ResetPeriodInDays", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Integer, minValue: 0, description: "Period after which to reset the failure count for the service."), | ||
184 | new ColumnDefinition("RestartServiceDelayInSeconds", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Integer, minValue: 0, description: "Period after which to restart the service after a given failure."), | ||
185 | new ColumnDefinition("ProgramCommandLine", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Command line for program to run if failure action is RUN_COMMAND."), | ||
186 | new ColumnDefinition("RebootMessage", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Message to show to users when rebooting if failure action is REBOOT."), | ||
187 | }, | ||
188 | tupleDefinitionName: UtilTupleDefinitions.ServiceConfig.Name, | ||
189 | tupleIdIsPrimaryKey: false | ||
190 | ); | ||
191 | |||
192 | public static readonly TableDefinition Wix4TouchFile = new TableDefinition( | ||
193 | "Wix4TouchFile", | ||
194 | new[] | ||
195 | { | ||
196 | new ColumnDefinition("Wix4TouchFile", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Identifier for the Wix4TouchFile row in the package.", modularizeType: ColumnModularizeType.Column), | ||
197 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
198 | new ColumnDefinition("Path", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Formatted column that resolves to the path to touch.", modularizeType: ColumnModularizeType.Property), | ||
199 | new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 63, description: "1 == Touch only when the associated component is being installed, 2 == Touch only when the associated component is being repaired , 4 == Touch only when the associated component is being removed, 16 = path is in 64-bit location, 32 = touching the file is vital."), | ||
200 | }, | ||
201 | tupleDefinitionName: UtilTupleDefinitions.WixTouchFile.Name, | ||
202 | tupleIdIsPrimaryKey: true | ||
203 | ); | ||
204 | |||
205 | public static readonly TableDefinition Wix4User = new TableDefinition( | ||
206 | "Wix4User", | ||
207 | new[] | ||
208 | { | ||
209 | new ColumnDefinition("Wix4User", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column), | ||
210 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Text, keyTable: "Component", keyColumn: 1, description: "Foreign key, Component used to determine install state", modularizeType: ColumnModularizeType.Column), | ||
211 | new ColumnDefinition("Name", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "User name", modularizeType: ColumnModularizeType.Property), | ||
212 | new ColumnDefinition("Domain", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "User domain", modularizeType: ColumnModularizeType.Property), | ||
213 | new ColumnDefinition("Password", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "User password", modularizeType: ColumnModularizeType.Property), | ||
214 | new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, minValue: 0, maxValue: 65535, description: "Attributes describing how to create the user"), | ||
215 | }, | ||
216 | tupleDefinitionName: UtilTupleDefinitions.User.Name, | ||
217 | tupleIdIsPrimaryKey: true | ||
218 | ); | ||
219 | |||
220 | public static readonly TableDefinition Wix4UserGroup = new TableDefinition( | ||
221 | "Wix4UserGroup", | ||
222 | new[] | ||
223 | { | ||
224 | new ColumnDefinition("Wix4User_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4User", keyColumn: 1, description: "User to be joined to a Group.", modularizeType: ColumnModularizeType.Column), | ||
225 | new ColumnDefinition("Wix4Group_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4Group", keyColumn: 1, description: "Group to join User to.", modularizeType: ColumnModularizeType.Column), | ||
226 | }, | ||
227 | tupleDefinitionName: UtilTupleDefinitions.UserGroup.Name, | ||
228 | tupleIdIsPrimaryKey: false | ||
229 | ); | ||
230 | |||
231 | public static readonly TableDefinition Wix4XmlFile = new TableDefinition( | ||
232 | "Wix4XmlFile", | ||
233 | new[] | ||
234 | { | ||
235 | new ColumnDefinition("Wix4XmlFile", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token.", modularizeType: ColumnModularizeType.Column), | ||
236 | new ColumnDefinition("File", ColumnType.Localized, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "The .XML file in which to write the information", modularizeType: ColumnModularizeType.Property), | ||
237 | new ColumnDefinition("ElementPath", ColumnType.Localized, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "The .XML file element to modify.", modularizeType: ColumnModularizeType.Property), | ||
238 | new ColumnDefinition("Name", ColumnType.Localized, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "The .XML file node to set/add in the element.", modularizeType: ColumnModularizeType.Property), | ||
239 | new ColumnDefinition("Value", ColumnType.Localized, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "The value to be written.", modularizeType: ColumnModularizeType.Property), | ||
240 | new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 70143, description: "Flags"), | ||
241 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table referencing component that controls the installing of the .XML value.", modularizeType: ColumnModularizeType.Column), | ||
242 | new ColumnDefinition("Sequence", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Order to execute the XML modifications."), | ||
243 | }, | ||
244 | tupleDefinitionName: UtilTupleDefinitions.XmlFile.Name, | ||
245 | tupleIdIsPrimaryKey: true | ||
246 | ); | ||
247 | |||
248 | public static readonly TableDefinition Wix4XmlConfig = new TableDefinition( | ||
249 | "Wix4XmlConfig", | ||
250 | new[] | ||
251 | { | ||
252 | new ColumnDefinition("Wix4XmlConfig", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token.", modularizeType: ColumnModularizeType.Column), | ||
253 | new ColumnDefinition("File", ColumnType.Localized, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "The .XML file in which to write the information", modularizeType: ColumnModularizeType.Property), | ||
254 | new ColumnDefinition("ElementPath", ColumnType.Localized, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "The XPATH query for an element to modify or add children to. Can also be a foreign key reference to another Wix4XmlConfig row if no attributes are set and the row referenced is a create element row.", modularizeType: ColumnModularizeType.Property), | ||
255 | new ColumnDefinition("VerifyPath", ColumnType.Localized, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "The XPATH query run from ElementPath to verify whether a repair is necessary. Also used to uninstall.", modularizeType: ColumnModularizeType.Property), | ||
256 | new ColumnDefinition("Name", ColumnType.Localized, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "The .XML file node to set/add in the element.", modularizeType: ColumnModularizeType.Property), | ||
257 | new ColumnDefinition("Value", ColumnType.Localized, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "The value to be written.", modularizeType: ColumnModularizeType.Property), | ||
258 | new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 65536, description: "Element=1,Value=2,Document=4,Create=16,Delete=32,Install=256,Uninstall=512"), | ||
259 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key into the Component table referencing component that controls the installing of the .XML value.", modularizeType: ColumnModularizeType.Column), | ||
260 | new ColumnDefinition("Sequence", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Order to execute the XML modifications."), | ||
261 | }, | ||
262 | tupleDefinitionName: UtilTupleDefinitions.XmlConfig.Name, | ||
263 | tupleIdIsPrimaryKey: true | ||
264 | ); | ||
265 | |||
266 | public static readonly TableDefinition Wix4FormatFile = new TableDefinition( | ||
267 | "Wix4FormatFile", | ||
268 | new[] | ||
269 | { | ||
270 | new ColumnDefinition("Binary_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "Binary", keyColumn: 1, description: "Binary data to be formatted.", modularizeType: ColumnModularizeType.Column), | ||
271 | new ColumnDefinition("File_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "File whose component controls the custom action and where the formatted data is written.", modularizeType: ColumnModularizeType.Column), | ||
272 | }, | ||
273 | tupleDefinitionName: UtilTupleDefinitions.WixFormatFiles.Name, | ||
274 | tupleIdIsPrimaryKey: false | ||
275 | ); | ||
276 | |||
277 | public static readonly TableDefinition[] All = new[] | ||
278 | { | ||
279 | Wix4CloseApplication, | ||
280 | Wix4RemoveFolderEx, | ||
281 | Wix4RestartResource, | ||
282 | Wix4FileShare, | ||
283 | Wix4FileSharePermissions, | ||
284 | Wix4Group, | ||
285 | Wix4InternetShortcut, | ||
286 | Wix4PerformanceCategory, | ||
287 | Wix4Perfmon, | ||
288 | Wix4PerfmonManifest, | ||
289 | Wix4EventManifest, | ||
290 | Wix4SecureObject, | ||
291 | Wix4ServiceConfig, | ||
292 | Wix4TouchFile, | ||
293 | Wix4User, | ||
294 | Wix4UserGroup, | ||
295 | Wix4XmlFile, | ||
296 | Wix4XmlConfig, | ||
297 | Wix4FormatFile, | ||
298 | }; | ||
299 | } | ||
300 | } | ||
diff --git a/src/wixext/UtilWindowsInstallerBackendExtension.cs b/src/wixext/UtilWindowsInstallerBackendExtension.cs index 2365ed01..f872ec1a 100644 --- a/src/wixext/UtilWindowsInstallerBackendExtension.cs +++ b/src/wixext/UtilWindowsInstallerBackendExtension.cs | |||
@@ -3,25 +3,11 @@ | |||
3 | namespace WixToolset.Util | 3 | namespace WixToolset.Util |
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 UtilWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension | 9 | public class UtilWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension |
12 | { | 10 | { |
13 | private static readonly TableDefinition[] Tables = LoadTables(); | 11 | public override IEnumerable<TableDefinition> TableDefinitions => UtilTableDefinitions.All; |
14 | |||
15 | public override IEnumerable<TableDefinition> TableDefinitions { get => Tables; } | ||
16 | |||
17 | private static TableDefinition[] LoadTables() | ||
18 | { | ||
19 | using (var resourceStream = typeof(UtilWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Util.tables.xml")) | ||
20 | using (var reader = XmlReader.Create(resourceStream)) | ||
21 | { | ||
22 | var tables = TableDefinitionCollection.Load(reader); | ||
23 | return tables.ToArray(); | ||
24 | } | ||
25 | } | ||
26 | } | 12 | } |
27 | } | 13 | } |
diff --git a/src/wixext/WixToolset.Util.wixext.csproj b/src/wixext/WixToolset.Util.wixext.csproj index ed5a6a0f..240fbfb3 100644 --- a/src/wixext/WixToolset.Util.wixext.csproj +++ b/src/wixext/WixToolset.Util.wixext.csproj | |||
@@ -14,7 +14,6 @@ | |||
14 | <ItemGroup> | 14 | <ItemGroup> |
15 | <Content Include="$(MSBuildThisFileName).targets" /> | 15 | <Content Include="$(MSBuildThisFileName).targets" /> |
16 | <Content Include="util.xsd" PackagePath="tools" /> | 16 | <Content Include="util.xsd" PackagePath="tools" /> |
17 | <EmbeddedResource Include="tables.xml" /> | ||
18 | <EmbeddedResource Include="$(OutputPath)..\util.wixlib" /> | 17 | <EmbeddedResource Include="$(OutputPath)..\util.wixlib" /> |
19 | </ItemGroup> | 18 | </ItemGroup> |
20 | 19 | ||
diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml deleted file mode 100644 index b8d4246c..00000000 --- a/src/wixext/tables.xml +++ /dev/null | |||
@@ -1,238 +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="Wix4CloseApplication" tupleDefinitionName="WixCloseApplication"> | ||
7 | <columnDefinition name="Wix4CloseApplication" type="string" length="72" primaryKey="yes" modularize="column" | ||
8 | category="identifier" description="Primary key, non-localized token in table."/> | ||
9 | <columnDefinition name="Target" type="localized" length="0" modularize="property" | ||
10 | category="formatted" description="Name of executable to ensure is closed."/> | ||
11 | <columnDefinition name="Description" type="string" length="0" nullable="yes" localizable="yes" modularize="property" | ||
12 | category="formatted" description="Description string displayed to user when executable is in use."/> | ||
13 | <columnDefinition name="Condition" type="string" length="0" nullable="yes" localizable="yes" modularize="condition" | ||
14 | category="condition" description="Optional expression which skips the closing."/> | ||
15 | <columnDefinition name="Attributes" type="number" length="4" | ||
16 | minValue="0" maxValue="2147483647" description="A 32-bit word that specifies the attribute flags to be applied."/> | ||
17 | <columnDefinition name="Sequence" type="number" length="4" nullable="yes" | ||
18 | minValue="1" maxValue="2147483647" description="Sequence to order the closings by."/> | ||
19 | <columnDefinition name="Property" type="string" length="72" nullable="yes" localizable="yes" modularize="property" | ||
20 | category="identifier" description="Optional property that is set to the number of running instances of the app."/> | ||
21 | <columnDefinition name="TerminateExitCode" type="number" length="4" nullable="yes" | ||
22 | minValue="0" maxValue="2147483647" description="Exit code to return from a terminated application."/> | ||
23 | <columnDefinition name="Timeout" type="number" length="4" nullable="yes" | ||
24 | minValue="1" maxValue="2147483647" description="Timeout in milliseconds before scheduling restart or terminating application."/> | ||
25 | </tableDefinition> | ||
26 | <tableDefinition name="Wix4RemoveFolderEx" tupleDefinitionName="WixRemoveFolderEx" createSymbols="yes"> | ||
27 | <columnDefinition name="Wix4RemoveFolderEx" type="string" length="72" primaryKey="yes" modularize="column" | ||
28 | category="identifier" description="Identifier for the WixRemoveFolderEx row in the package."/> | ||
29 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
30 | keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state"/> | ||
31 | <columnDefinition name="Property" type="string" length="72" modularize="property" | ||
32 | category="identifier" description="Name of Property that contains the root of the directory tree to remove."/> | ||
33 | <columnDefinition name="InstallMode" type="number" length="2" | ||
34 | minValue="1" maxValue="3" description="1 == Remove only when the associated component is being installed (msiInstallStateLocal or msiInstallStateSource), 2 == Remove only when the associated component is being removed (msiInstallStateAbsent), 3 = Remove in either of the above cases."/> | ||
35 | </tableDefinition> | ||
36 | <tableDefinition name="Wix4RestartResource" tupleDefinitionName="WixRestartResource"> | ||
37 | <columnDefinition name="Wix4RestartResource" type="string" length="72" primaryKey="yes" modularize="column" | ||
38 | category="identifier" description="Primary key, non-localized identifier."/> | ||
39 | <columnDefinition name="Component_" type="string" length="72" nullable="yes" modularize="column" | ||
40 | keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state."/> | ||
41 | <columnDefinition name="Resource" type="string" length="0" modularize="property" | ||
42 | category="formatted" description="The resource to be registered with the Restart Manager."/> | ||
43 | <columnDefinition name="Attributes" type="number" length="4" | ||
44 | minValue="0" maxValue="2147483647" description="A 32-bit word that specifies the type of resource and flags used for processing."/> | ||
45 | </tableDefinition> | ||
46 | <tableDefinition name="Wix4FileShare" tupleDefinitionName="FileShare" createSymbols="yes"> | ||
47 | <columnDefinition name="Wix4FileShare" type="string" length="72" primaryKey="yes" modularize="column" | ||
48 | category="identifier" description="Primary key, non-localized identifier"/> | ||
49 | <columnDefinition name="ShareName" type="string" length="255" | ||
50 | category="formatted" description="The actual share name used"/> | ||
51 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
52 | keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state"/> | ||
53 | <columnDefinition name="Description" type="string" length="255" nullable="yes" | ||
54 | category="text" description="Description string displayed for the file share"/> | ||
55 | <columnDefinition name="Directory_" type="string" length="72" modularize="column" | ||
56 | keyTable="Directory" keyColumn="1" category="identifier" description="Foreign key referencing directory that the share is created on"/> | ||
57 | </tableDefinition> | ||
58 | <tableDefinition name="Wix4FileSharePermissions" tupleDefinitionName="FileSharePermissions"> | ||
59 | <columnDefinition name="Wix4FileShare_" type="string" length="72" primaryKey="yes" modularize="column" | ||
60 | keyTable="FileShare" keyColumn="1" category="identifier" description="FileShare that these premissions are to be applied to."/> | ||
61 | <columnDefinition name="Wix4User_" type="string" length="72" primaryKey="yes" modularize="column" | ||
62 | keyTable="Wix4User" category="identifier" description="User that these premissions are to apply to."/> | ||
63 | <columnDefinition name="Permissions" type="number" length="4" | ||
64 | description="Permissions int, as in EXPLICIT_ACCESS.grfAccessPermissions in MSDN"/> | ||
65 | </tableDefinition> | ||
66 | <tableDefinition name="Wix4Group" tupleDefinitionName="Group" createSymbols="yes"> | ||
67 | <columnDefinition name="Wix4Group" type="string" length="72" primaryKey="yes" modularize="column" | ||
68 | category="identifier" description="Primary key, non-localized token"/> | ||
69 | <columnDefinition name="Component_" type="string" length="72" nullable="yes" modularize="column" | ||
70 | keyTable="Component" keyColumn="1" category="text" description="Foreign key, Component used to determine install state"/> | ||
71 | <columnDefinition name="Name" type="string" length="255" modularize="property" | ||
72 | category="formatted" description="Group name"/> | ||
73 | <columnDefinition name="Domain" type="string" length="255" nullable="yes" modularize="property" | ||
74 | category="formatted" description="Group domain"/> | ||
75 | </tableDefinition> | ||
76 | <tableDefinition name="Wix4InternetShortcut" tupleDefinitionName="WixInternetShortcut" createSymbols="yes"> | ||
77 | <columnDefinition name="Wix4InternetShortcut" type="string" length="72" primaryKey="yes" modularize="column" | ||
78 | category="identifier" description="Primary key, non-localized token in table."/> | ||
79 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
80 | keyTable="Component" keyColumn="1" category="text" description="Foreign key, Component used to determine install state"/> | ||
81 | <columnDefinition name="Directory_" type="string" length="72" modularize="column" | ||
82 | keyTable="Directory" keyColumn="1" category="identifier" description="Foreign key referencing directory that the shortcut is created in"/> | ||
83 | <columnDefinition name="Name" type="string" length="72" modularize="property" | ||
84 | category="text" description="Name used for shortcut."/> | ||
85 | <columnDefinition name="Target" type="localized" length="0" escapeIdtCharacters="yes" | ||
86 | category="text" description="URL target."/> | ||
87 | <columnDefinition name="Attributes" type="number" length="2" | ||
88 | description="Attribute flags that control how the shortcut is created."/> | ||
89 | <columnDefinition name="IconFile" type="localized" length="0" escapeIdtCharacters="yes" | ||
90 | category="text" nullable="yes" description="Icon file for shortcut"/> | ||
91 | <columnDefinition name="IconIndex" type="number" length="4" | ||
92 | nullable="yes" description="Index of the icon being referenced."/> | ||
93 | </tableDefinition> | ||
94 | <tableDefinition name="Wix4PerformanceCategory" tupleDefinitionName="PerformanceCategory"> | ||
95 | <columnDefinition name="Wix4PerformanceCategory" type="string" length="72" primaryKey="yes" modularize="column" | ||
96 | category="identifier" description="Primary key, non-localized token in table."/> | ||
97 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
98 | keyTable="Component" keyColumn="1" category="identifier" description="Component used to determine install state"/> | ||
99 | <columnDefinition name="Name" type="string" length="80" | ||
100 | category="text" description="Name of the performance counter category."/> | ||
101 | <columnDefinition name="IniData" type="localized" length="0" escapeIdtCharacters="yes" | ||
102 | category="text" description="Data that goes into the performance counter .ini file."/> | ||
103 | <columnDefinition name="ConstantData" type="localized" length="0" escapeIdtCharacters="yes" | ||
104 | category="text" description="Data that goes into the performance counter .h file."/> | ||
105 | </tableDefinition> | ||
106 | <tableDefinition name="Wix4Perfmon" tupleDefinitionName="Perfmon"> | ||
107 | <columnDefinition name="Component_" type="string" length="72" primaryKey="yes" modularize="column" | ||
108 | keyTable="Component" keyColumn="1" category="identifier" description="Component used to determine install state"/> | ||
109 | <columnDefinition name="File" type="string" length="72" primaryKey="yes" modularize="property" | ||
110 | category="formatted" description="Name of .INI file"/> | ||
111 | <columnDefinition name="Name" type="string" length="72" primaryKey="yes" | ||
112 | category="text" description="Service name in registry"/> | ||
113 | </tableDefinition> | ||
114 | <tableDefinition name="Wix4PerfmonManifest" tupleDefinitionName="PerfmonManifest"> | ||
115 | <columnDefinition name="Component_" type="string" length="72" primaryKey="yes" modularize="column" | ||
116 | keyTable="Component" keyColumn="1" category="identifier" description="Component used to determine install state"/> | ||
117 | <columnDefinition name="File" type="string" length="72" primaryKey="yes" modularize="property" | ||
118 | category="formatted" description="Name of perfmon manifest file"/> | ||
119 | <columnDefinition name="ResourceFileDirectory" type="string" length="255" primaryKey="yes" | ||
120 | category="formatted" description="The path of the Resource File Directory"/> | ||
121 | </tableDefinition> | ||
122 | <tableDefinition name="Wix4EventManifest" tupleDefinitionName="EventManifest"> | ||
123 | <columnDefinition name="Component_" type="string" length="72" primaryKey="yes" modularize="column" | ||
124 | keyTable="Component" keyColumn="1" category="identifier" description="Component used to determine install state"/> | ||
125 | <columnDefinition name="File" type="string" length="72" primaryKey="yes" modularize="property" | ||
126 | category="formatted" description="Name of event manifest file"/> | ||
127 | </tableDefinition> | ||
128 | <tableDefinition name="Wix4SecureObject" tupleDefinitionName="SecureObjects"> | ||
129 | <columnDefinition name="Wix4SecureObject" type="string" length="72" primaryKey="yes" modularize="column" | ||
130 | category="identifier" description="Primary key, non-localized token in Table"/> | ||
131 | <columnDefinition name="Table" type="string" length="32" primaryKey="yes" | ||
132 | category="text" description="Table SecureObject should be securing"/> | ||
133 | <columnDefinition name="Domain" type="string" length="255" primaryKey="yes" nullable="yes" modularize="property" | ||
134 | category="text" description="Domain half of user account to secure"/> | ||
135 | <columnDefinition name="User" type="string" length="255" primaryKey="yes" modularize="property" | ||
136 | category="text" description="User name half of user account to secure"/> | ||
137 | <columnDefinition name="Permission" type="number" length="4" nullable="yes" | ||
138 | minValue="-2147483647" maxValue="2147483647" description="Permissions to grant to User"/> | ||
139 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
140 | keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state"/> | ||
141 | </tableDefinition> | ||
142 | <tableDefinition name="Wix4ServiceConfig" tupleDefinitionName="ServiceConfig"> | ||
143 | <columnDefinition name="ServiceName" type="string" length="72" primaryKey="yes" | ||
144 | category="formatted" description="Primary key, non-localized token"/> | ||
145 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
146 | keyTable="Component" keyColumn="1" category="identifier" description="Foreign key, Component used to determine install state "/> | ||
147 | <columnDefinition name="NewService" type="number" length="1" | ||
148 | minValue="0" maxValue="1" description="Whether the affected service is being installed or already exists."/> | ||
149 | <columnDefinition name="FirstFailureActionType" type="string" length="32" | ||
150 | category="text" description="First failure action type for configured service to take."/> | ||
151 | <columnDefinition name="SecondFailureActionType" type="string" length="32" | ||
152 | category="text" description="Second failure action type for configured service to take."/> | ||
153 | <columnDefinition name="ThirdFailureActionType" type="string" length="32" | ||
154 | category="text" description="Third failure action type for configured service to take."/> | ||
155 | <columnDefinition name="ResetPeriodInDays" type="number" length="4" nullable="yes" | ||
156 | category="integer" minValue="0" description="Period after which to reset the failure count for the service."/> | ||
157 | <columnDefinition name="RestartServiceDelayInSeconds" type="number" length="4" nullable="yes" | ||
158 | category="integer" minValue="0" description="Period after which to restart the service after a given failure."/> | ||
159 | <columnDefinition name="ProgramCommandLine" type="string" length="255" nullable="yes" | ||
160 | category="formatted" description="Command line for program to run if failure action is RUN_COMMAND."/> | ||
161 | <columnDefinition name="RebootMessage" type="string" length="255" nullable="yes" | ||
162 | category="text" description="Message to show to users when rebooting if failure action is REBOOT."/> | ||
163 | </tableDefinition> | ||
164 | <tableDefinition name="Wix4TouchFile" tupleDefinitionName="WixTouchFile" createSymbols="yes"> | ||
165 | <columnDefinition name="Wix4TouchFile" type="string" length="72" primaryKey="yes" modularize="column" | ||
166 | category="identifier" description="Identifier for the Wix4TouchFile row in the package."/> | ||
167 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
168 | keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table used to determine install state"/> | ||
169 | <columnDefinition name="Path" type="string" length="255" modularize="property" | ||
170 | category="formatted" description="Formatted column that resolves to the path to touch."/> | ||
171 | <columnDefinition name="Attributes" type="number" length="2" | ||
172 | minValue="1" maxValue="63" description="1 == Touch only when the associated component is being installed, 2 == Touch only when the associated component is being repaired , 4 == Touch only when the associated component is being removed, 16 = path is in 64-bit location, 32 = touching the file is vital."/> | ||
173 | </tableDefinition> | ||
174 | <tableDefinition name="Wix4User" tupleDefinitionName="User" createSymbols="yes"> | ||
175 | <columnDefinition name="Wix4User" type="string" length="72" primaryKey="yes" modularize="column" | ||
176 | category="identifier" description="Primary key, non-localized token"/> | ||
177 | <columnDefinition name="Component_" type="string" length="72" nullable="yes" modularize="column" | ||
178 | keyTable="Component" keyColumn="1" category="text" description="Foreign key, Component used to determine install state"/> | ||
179 | <columnDefinition name="Name" type="string" length="255" modularize="property" | ||
180 | category="formatted" description="User name"/> | ||
181 | <columnDefinition name="Domain" type="string" length="255" nullable="yes" modularize="property" | ||
182 | category="formatted" description="User domain"/> | ||
183 | <columnDefinition name="Password" type="string" length="255" nullable="yes" modularize="property" | ||
184 | category="formatted" description="User password"/> | ||
185 | <columnDefinition name="Attributes" type="number" length="4" nullable="yes" | ||
186 | minValue="0" maxValue="65535" description="Attributes describing how to create the user"/> | ||
187 | </tableDefinition> | ||
188 | <tableDefinition name="Wix4UserGroup" tupleDefinitionName="UserGroup"> | ||
189 | <columnDefinition name="Wix4User_" type="string" length="72" primaryKey="yes" modularize="column" | ||
190 | keyTable="Wix4User" keyColumn="1" category="identifier" description="User to be joined to a Group."/> | ||
191 | <columnDefinition name="Wix4Group_" type="string" length="72" primaryKey="yes" modularize="column" | ||
192 | keyTable="Wix4Group" keyColumn="1" category="identifier" description="Group to join User to."/> | ||
193 | </tableDefinition> | ||
194 | <tableDefinition name="Wix4XmlFile" tupleDefinitionName="XmlFile"> | ||
195 | <columnDefinition name="Wix4XmlFile" type="string" length="72" primaryKey="yes" modularize="column" | ||
196 | category="identifier" description="Primary key, non-localized token."/> | ||
197 | <columnDefinition name="File" type="localized" length="255" modularize="property" | ||
198 | category="formatted" description="The .XML file in which to write the information"/> | ||
199 | <columnDefinition name="ElementPath" type="localized" length="0" modularize="property" | ||
200 | category="formatted" description="The .XML file element to modify."/> | ||
201 | <columnDefinition name="Name" type="localized" length="255" modularize="property" nullable="yes" | ||
202 | category="formatted" description="The .XML file node to set/add in the element."/> | ||
203 | <columnDefinition name="Value" type="localized" length="0" modularize="property" nullable="yes" | ||
204 | category="formatted" description="The value to be written."/> | ||
205 | <columnDefinition name="Flags" type="number" length="4" | ||
206 | minValue="0" maxValue="70143" description="Flags"/> | ||
207 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
208 | keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table referencing component that controls the installing of the .XML value."/> | ||
209 | <columnDefinition name="Sequence" type="number" length="2" nullable="yes" | ||
210 | description="Order to execute the XML modifications."/> | ||
211 | </tableDefinition> | ||
212 | <tableDefinition name="Wix4XmlConfig" tupleDefinitionName="XmlConfig" createSymbols="yes"> | ||
213 | <columnDefinition name="Wix4XmlConfig" type="string" length="72" primaryKey="yes" modularize="column" | ||
214 | category="identifier" description="Primary key, non-localized token."/> | ||
215 | <columnDefinition name="File" type="localized" length="255" modularize="property" | ||
216 | category="formatted" description="The .XML file in which to write the information"/> | ||
217 | <columnDefinition name="ElementPath" type="localized" length="0" modularize="property" | ||
218 | category="formatted" description="The XPATH query for an element to modify or add children to. Can also be a foreign key reference to another Wix4XmlConfig row if no attributes are set and the row referenced is a create element row."/> | ||
219 | <columnDefinition name="VerifyPath" type="localized" length="0" modularize="property" nullable="yes" | ||
220 | category="formatted" description="The XPATH query run from ElementPath to verify whether a repair is necessary. Also used to uninstall."/> | ||
221 | <columnDefinition name="Name" type="localized" length="255" modularize="property" nullable="yes" | ||
222 | category="formatted" description="The .XML file node to set/add in the element."/> | ||
223 | <columnDefinition name="Value" type="localized" length="0" modularize="property" nullable="yes" escapeIdtCharacters="yes" | ||
224 | category="formatted" description="The value to be written."/> | ||
225 | <columnDefinition name="Flags" type="number" length="4" | ||
226 | minValue="0" maxValue="65536" description="Element=1,Value=2,Document=4,Create=16,Delete=32,Install=256,Uninstall=512"/> | ||
227 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
228 | keyTable="Component" keyColumn="1" category="identifier" description="Foreign key into the Component table referencing component that controls the installing of the .XML value."/> | ||
229 | <columnDefinition name="Sequence" type="number" length="2" nullable="yes" | ||
230 | description="Order to execute the XML modifications."/> | ||
231 | </tableDefinition> | ||
232 | <tableDefinition name="Wix4FormatFile" tupleDefinitionName="WixFormatFile"> | ||
233 | <columnDefinition name="Binary_" type="string" length="72" primaryKey="yes" modularize="column" | ||
234 | keyTable="Binary" keyColumn="1" category="identifier" description="Binary data to be formatted."/> | ||
235 | <columnDefinition name="File_" type="string" length="72" primaryKey="yes" modularize="column" | ||
236 | keyTable="File" keyColumn="1" category="identifier" description="File whose component controls the custom action and where the formatted data is written."/> | ||
237 | </tableDefinition> | ||
238 | </tableDefinitions> | ||