@joebigelow / wix / commits / 75f30802

Modernize UtilCompiler.

Sean Hall committed Apr 7, 2020 at 17:48 UTC 75f30802e00401df576ba351a24b0d26711e900e
6 files changed +535 -533
src/wixext/Tuples/GroupTuple.cs
-8
@@ -11,7 +11,6 @@ namespace WixToolset.Util
11 UtilTupleDefinitionType.Group.ToString(),
12 new[]
13 {
14 - new IntermediateFieldDefinition(nameof(GroupTupleFields.Group), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(GroupTupleFields.ComponentRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(GroupTupleFields.Name), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(GroupTupleFields.Domain), IntermediateFieldType.String),
@@ -26,7 +25,6 @@ namespace WixToolset.Util.Tuples
25
26 public enum GroupTupleFields
27 {
29 - Group,
28 ComponentRef,
29 Name,
30 Domain,
@@ -44,12 +42,6 @@ namespace WixToolset.Util.Tuples
42
43 public IntermediateField this[GroupTupleFields index] => this.Fields[(int)index];
44
47 - public string Group
48 - {
49 - get => this.Fields[(int)GroupTupleFields.Group].AsString();
50 - set => this.Set((int)GroupTupleFields.Group, value);
51 - }
52 -
45 public string ComponentRef
46 {
47 get => this.Fields[(int)GroupTupleFields.ComponentRef].AsString();
src/wixext/UtilCompiler.cs
+234 -271
@@ -112,11 +112,11 @@ namespace WixToolset.Util
112 switch (parentElement.Name.LocalName)
113 {
114 case "CreateFolder":
115 - string createFolderId = context["DirectoryId"];
116 - string createFolderComponentId = context["ComponentId"];
115 + var createFolderId = context["DirectoryId"];
116 + var createFolderComponentId = context["ComponentId"];
117
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
121 switch (element.Name.LocalName)
122 {
@@ -129,9 +129,9 @@ namespace WixToolset.Util
129 }
130 break;
131 case "Component":
132 - string componentId = context["ComponentId"];
133 - string directoryId = context["DirectoryId"];
134 - bool componentWin64 = Boolean.Parse(context["Win64"]);
132 + var componentId = context["ComponentId"];
133 + var directoryId = context["DirectoryId"];
134 + var componentWin64 = Boolean.Parse(context["Win64"]);
135
136 switch (element.Name.LocalName)
137 {
@@ -174,11 +174,11 @@ namespace WixToolset.Util
174 }
175 break;
176 case "File":
177 - string fileId = context["FileId"];
178 - string fileComponentId = context["ComponentId"];
177 + var fileId = context["FileId"];
178 + var fileComponentId = context["ComponentId"];
179
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
183 switch (element.Name.LocalName)
184 {
@@ -298,11 +298,11 @@ namespace WixToolset.Util
298 case "Registry":
299 case "RegistryKey":
300 case "RegistryValue":
301 - string registryId = context["RegistryId"];
302 - string registryComponentId = context["ComponentId"];
301 + var registryId = context["RegistryId"];
302 + var registryComponentId = context["ComponentId"];
303
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
307 switch (element.Name.LocalName)
308 {
@@ -315,12 +315,12 @@ namespace WixToolset.Util
315 }
316 break;
317 case "ServiceInstall":
318 - string serviceInstallId = context["ServiceInstallId"];
319 - string serviceInstallName = context["ServiceInstallName"];
320 - string serviceInstallComponentId = context["ServiceInstallComponentId"];
318 + var serviceInstallId = context["ServiceInstallId"];
319 + var serviceInstallName = context["ServiceInstallName"];
320 + var serviceInstallComponentId = context["ServiceInstallComponentId"];
321
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
325 switch (element.Name.LocalName)
326 {
@@ -381,16 +381,16 @@ namespace WixToolset.Util
381 /// <param name="element">Element to parse.</param>
382 private void ParseComponentSearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
383 {
384 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
384 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
385 Identifier id = null;
386 string variable = null;
387 string condition = null;
388 string after = null;
389 string guid = null;
390 string productCode = null;
391 - Serialize.ComponentSearch.ResultType result = Serialize.ComponentSearch.ResultType.NotSet;
391 + var result = Serialize.ComponentSearch.ResultType.NotSet;
392
393 - foreach (XAttribute attrib in element.Attributes())
393 + foreach (var attrib in element.Attributes())
394 {
395 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
396 {
@@ -409,7 +409,7 @@ namespace WixToolset.Util
409 productCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib);
410 break;
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))
414 {
415 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
@@ -446,7 +446,7 @@ namespace WixToolset.Util
446
447 if (!this.Messaging.EncounteredError)
448 {
449 - WixComponentSearchAttributes attributes = WixComponentSearchAttributes.KeyPath;
449 + var attributes = WixComponentSearchAttributes.KeyPath;
450 switch (result)
451 {
452 case Serialize.ComponentSearch.ResultType.directory:
@@ -460,7 +460,7 @@ namespace WixToolset.Util
460 break;
461 }
462
463 - section.Tuples.Add(new WixComponentSearchTuple(sourceLineNumbers, id)
463 + section.AddTuple(new WixComponentSearchTuple(sourceLineNumbers, id)
464 {
465 Guid = guid,
466 ProductCode = productCode,
@@ -475,10 +475,10 @@ namespace WixToolset.Util
475 /// <param name="element">Element to parse.</param>
476 private void ParseComponentSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement element)
477 {
478 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
478 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
479 string refId = null;
480
481 - foreach (XAttribute attrib in element.Attributes())
481 + foreach (var attrib in element.Attributes())
482 {
483 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
484 {
@@ -486,7 +486,7 @@ namespace WixToolset.Util
486 {
487 case "Id":
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;
491 default:
492 this.ParseHelper.UnexpectedAttribute(element, attrib);
@@ -548,7 +548,7 @@ namespace WixToolset.Util
548
549 if (!this.Messaging.EncounteredError)
550 {
551 - section.Tuples.Add(new WixDetectSHA2SupportTuple(sourceLineNumbers, id));
551 + section.AddTuple(new WixDetectSHA2SupportTuple(sourceLineNumbers, id));
552 }
553 }
554
@@ -559,7 +559,6 @@ namespace WixToolset.Util
559 private void ParseDetectSHA2SupportRefElement(Intermediate intermediate, IntermediateSection section, XElement element)
560 {
561 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
562 - string refId = null;
562
563 foreach (var attrib in element.Attributes())
564 {
@@ -568,8 +567,8 @@ namespace WixToolset.Util
567 switch (attrib.Name.LocalName)
568 {
569 case "Id":
571 - refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
572 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixDetectSHA2Support", refId);
570 + var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
571 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilTupleDefinitions.WixDetectSHA2Support, refId);
572 break;
573 default:
574 this.ParseHelper.UnexpectedAttribute(element, attrib);
@@ -592,17 +591,17 @@ namespace WixToolset.Util
591 /// <param name="componentId">Identifier of parent component.</param>
592 private IComponentKeyPath ParseEventSourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
593 {
595 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
594 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
595 string sourceName = null;
596 string logName = null;
597 string categoryMessageFile = null;
599 - int categoryCount = CompilerConstants.IntegerNotSet;
598 + var categoryCount = CompilerConstants.IntegerNotSet;
599 string eventMessageFile = null;
600 string parameterMessageFile = null;
601 int typesSupported = 0;
603 - bool isKeyPath = false;
602 + var isKeyPath = false;
603
605 - foreach (XAttribute attrib in element.Attributes())
604 + foreach (var attrib in element.Attributes())
605 {
606 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
607 {
@@ -702,7 +701,7 @@ namespace WixToolset.Util
701 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
702
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);
705
706 if (null != categoryMessageFile)
707 {
@@ -737,18 +736,18 @@ namespace WixToolset.Util
736 /// <param name="element">Element to parse.</param>
737 private void ParseCloseApplicationElement(Intermediate intermediate, IntermediateSection section, XElement element)
738 {
740 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
739 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
740 string condition = null;
741 string description = null;
742 string target = null;
743 string property = null;
744 Identifier id = null;
745 int attributes = 2; // default to CLOSEAPP_ATTRIBUTE_REBOOTPROMPT enabled
747 - int sequence = CompilerConstants.IntegerNotSet;
748 - int terminateExitCode = CompilerConstants.IntegerNotSet;
749 - int timeout = CompilerConstants.IntegerNotSet;
746 + var sequence = CompilerConstants.IntegerNotSet;
747 + var terminateExitCode = CompilerConstants.IntegerNotSet;
748 + var timeout = CompilerConstants.IntegerNotSet;
749
751 - foreach (XAttribute attrib in element.Attributes())
750 + foreach (var attrib in element.Attributes())
751 {
752 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
753 {
@@ -875,14 +874,14 @@ namespace WixToolset.Util
874
875 if (!this.Messaging.EncounteredError)
876 {
878 - var tuple = new WixCloseApplicationTuple(sourceLineNumbers, id)
877 + var tuple = section.AddTuple(new WixCloseApplicationTuple(sourceLineNumbers, id)
878 {
879 Target = target,
880 Description = description,
881 Condition = condition,
882 Attributes = attributes,
883 Property = property,
885 - };
884 + });
885 if (CompilerConstants.IntegerNotSet != sequence)
886 {
887 tuple.Sequence = sequence;
@@ -895,8 +894,6 @@ namespace WixToolset.Util
894 {
895 tuple.Timeout = timeout * 1000; // make the timeout milliseconds in the table.
896 }
898 -
899 - section.Tuples.Add(tuple);
897 }
898 }
899
@@ -906,15 +903,15 @@ namespace WixToolset.Util
903 /// <param name="element">Element to parse.</param>
904 private void ParseDirectorySearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
905 {
909 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
906 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
907 Identifier id = null;
908 string variable = null;
909 string condition = null;
910 string after = null;
911 string path = null;
915 - Serialize.DirectorySearch.ResultType result = Serialize.DirectorySearch.ResultType.NotSet;
912 + var result = Serialize.DirectorySearch.ResultType.NotSet;
913
917 - foreach (XAttribute attrib in element.Attributes())
914 + foreach (var attrib in element.Attributes())
915 {
916 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
917 {
@@ -964,7 +961,7 @@ namespace WixToolset.Util
961
962 if (!this.Messaging.EncounteredError)
963 {
967 - WixFileSearchAttributes attributes = WixFileSearchAttributes.IsDirectory;
964 + var attributes = WixFileSearchAttributes.IsDirectory;
965 switch (result)
966 {
967 case Serialize.DirectorySearch.ResultType.exists:
@@ -982,8 +979,7 @@ namespace WixToolset.Util
979 /// <param name="node">Element to parse.</param>
980 private void ParseWixSearchRefElement(Intermediate intermediate, IntermediateSection section, XElement node)
981 {
985 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
986 - string refId = null;
982 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
983
984 foreach (XAttribute attrib in node.Attributes())
985 {
@@ -992,8 +988,8 @@ namespace WixToolset.Util
988 switch (attrib.Name.LocalName)
989 {
990 case "Id":
995 - refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
996 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixSearch", refId);
991 + var refId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
992 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.WixSearch, refId);
993 break;
994 default:
995 this.ParseHelper.UnexpectedAttribute(node, attrib);
@@ -1015,15 +1011,15 @@ namespace WixToolset.Util
1011 /// <param name="node">Element to parse.</param>
1012 private void ParseFileSearchElement(Intermediate intermediate, IntermediateSection section, XElement node)
1013 {
1018 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
1014 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
1015 Identifier id = null;
1016 string variable = null;
1017 string condition = null;
1018 string after = null;
1019 string path = null;
1024 - Serialize.FileSearch.ResultType result = Serialize.FileSearch.ResultType.NotSet;
1020 + var result = Serialize.FileSearch.ResultType.NotSet;
1021
1026 - foreach (XAttribute attrib in node.Attributes())
1022 + foreach (var attrib in node.Attributes())
1023 {
1024 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1025 {
@@ -1075,7 +1071,7 @@ namespace WixToolset.Util
1071
1072 if (!this.Messaging.EncounteredError)
1073 {
1078 - WixFileSearchAttributes attributes = WixFileSearchAttributes.Default;
1074 + var attributes = WixFileSearchAttributes.Default;
1075 switch (result)
1076 {
1077 case Serialize.FileSearch.ResultType.exists:
@@ -1099,7 +1095,7 @@ namespace WixToolset.Util
1095 /// <param name="attributes"></param>
1096 private void CreateWixFileSearchRow(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier id, string path, WixFileSearchAttributes attributes)
1097 {
1102 - section.Tuples.Add(new WixFileSearchTuple(sourceLineNumbers, id)
1098 + section.AddTuple(new WixFileSearchTuple(sourceLineNumbers, id)
1099 {
1100 Path = path,
1101 Attributes = attributes,
@@ -1114,12 +1110,12 @@ namespace WixToolset.Util
1110 /// <param name="directoryId">Identifier of referred to directory.</param>
1111 private void ParseFileShareElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string directoryId)
1112 {
1117 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1113 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1114 string description = null;
1115 string name = null;
1116 Identifier id = null;
1117
1122 - foreach (XAttribute attrib in element.Attributes())
1118 + foreach (var attrib in element.Attributes())
1119 {
1120 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1121 {
@@ -1147,7 +1143,7 @@ namespace WixToolset.Util
1143
1144 if (null == id)
1145 {
1150 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1146 + id = this.ParseHelper.CreateIdentifier("ufs", componentId, name);
1147 }
1148
1149 if (null == name)
@@ -1160,7 +1156,7 @@ namespace WixToolset.Util
1156 this.Messaging.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, element.Name.LocalName, "FileSharePermission"));
1157 }
1158
1163 - foreach (XElement child in element.Elements())
1159 + foreach (var child in element.Elements())
1160 {
1161 if (this.Namespace == child.Name.Namespace)
1162 {
@@ -1185,15 +1181,13 @@ namespace WixToolset.Util
1181
1182 if (!this.Messaging.EncounteredError)
1183 {
1188 - var tuple = new FileShareTuple(sourceLineNumbers, id)
1184 + section.AddTuple(new FileShareTuple(sourceLineNumbers, id)
1185 {
1186 ShareName = name,
1187 ComponentRef = componentId,
1188 Description = description,
1189 DirectoryRef = directoryId,
1194 - };
1195 -
1196 - section.Tuples.Add(tuple);
1190 + });
1191 }
1192 }
1193
@@ -1204,12 +1198,11 @@ namespace WixToolset.Util
1198 /// <param name="fileShareId">The identifier of the parent FileShare element.</param>
1199 private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, Identifier fileShareId)
1200 {
1207 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1208 - BitArray bits = new BitArray(32);
1209 - int permission = 0;
1201 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1202 + var bits = new BitArray(32);
1203 string user = null;
1204
1212 - foreach (XAttribute attrib in element.Attributes())
1205 + foreach (var attrib in element.Attributes())
1206 {
1207 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1208 {
@@ -1217,10 +1210,10 @@ namespace WixToolset.Util
1210 {
1211 case "User":
1212 user = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1220 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "User", user);
1213 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilTupleDefinitions.User, user);
1214 break;
1215 default:
1223 - YesNoType attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1216 + var attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1217 if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16))
1218 {
1219 if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28))
@@ -1241,7 +1234,7 @@ namespace WixToolset.Util
1234 }
1235 }
1236
1244 - permission = this.CreateIntegerFromBitArray(bits);
1237 + var permission = this.CreateIntegerFromBitArray(bits);
1238
1239 if (null == user)
1240 {
@@ -1257,14 +1250,12 @@ namespace WixToolset.Util
1250
1251 if (!this.Messaging.EncounteredError)
1252 {
1260 - var tuple = new FileSharePermissionsTuple(sourceLineNumbers)
1253 + section.AddTuple(new FileSharePermissionsTuple(sourceLineNumbers)
1254 {
1255 FileShareRef = fileShareId.Id,
1256 UserRef = user,
1257 Permissions = permission,
1265 - };
1266 -
1267 - section.Tuples.Add(tuple);
1258 + });
1259 }
1260 }
1261
@@ -1275,12 +1266,12 @@ namespace WixToolset.Util
1266 /// <param name="componentId">Component Id of the parent component of this element.</param>
1267 private void ParseGroupElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
1268 {
1278 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1269 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1270 Identifier id = null;
1271 string domain = null;
1272 string name = null;
1273
1283 - foreach (XAttribute attrib in element.Attributes())
1274 + foreach (var attrib in element.Attributes())
1275 {
1276 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1277 {
@@ -1308,21 +1299,19 @@ namespace WixToolset.Util
1299
1300 if (null == id)
1301 {
1311 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1302 + id = this.ParseHelper.CreateIdentifier("ugr", componentId, domain, name);
1303 }
1304
1305 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1306
1307 if (!this.Messaging.EncounteredError)
1308 {
1318 - var tuple = new GroupTuple(sourceLineNumbers, id)
1309 + section.AddTuple(new GroupTuple(sourceLineNumbers, id)
1310 {
1311 ComponentRef = componentId,
1312 Name = name,
1313 Domain = domain,
1323 - };
1324 -
1325 - section.Tuples.Add(tuple);
1314 + });
1315 }
1316 }
1317
@@ -1333,10 +1322,10 @@ namespace WixToolset.Util
1322 /// <param name="userId">Required user id to be joined to the group.</param>
1323 private void ParseGroupRefElement(Intermediate intermediate, IntermediateSection section, XElement element, string userId)
1324 {
1336 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1325 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1326 string groupId = null;
1327
1339 - foreach (XAttribute attrib in element.Attributes())
1328 + foreach (var attrib in element.Attributes())
1329 {
1330 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1331 {
@@ -1344,7 +1333,7 @@ namespace WixToolset.Util
1333 {
1334 case "Id":
1335 groupId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1347 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Group", groupId);
1336 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilTupleDefinitions.Group, groupId);
1337 break;
1338 default:
1339 this.ParseHelper.UnexpectedAttribute(element, attrib);
@@ -1361,13 +1350,11 @@ namespace WixToolset.Util
1350
1351 if (!this.Messaging.EncounteredError)
1352 {
1364 - var tuple = new UserGroupTuple(sourceLineNumbers)
1353 + section.AddTuple(new UserGroupTuple(sourceLineNumbers)
1354 {
1355 UserRef = userId,
1356 GroupRef = groupId,
1368 - };
1369 -
1370 - section.Tuples.Add(tuple);
1357 + });
1358 }
1359 }
1360
@@ -1379,7 +1366,7 @@ namespace WixToolset.Util
1366 /// <param name="defaultTarget">Default directory if none is specified on the InternetShortcut element.</param>
1367 private void ParseInternetShortcutElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string defaultTarget)
1368 {
1382 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1369 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1370 Identifier id = null;
1371 string name = null;
1372 string target = null;
@@ -1388,7 +1375,7 @@ namespace WixToolset.Util
1375 string iconFile = null;
1376 int iconIndex = 0;
1377
1391 - foreach (XAttribute attrib in element.Attributes())
1378 + foreach (var attrib in element.Attributes())
1379 {
1380 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1381 {
@@ -1435,7 +1422,7 @@ namespace WixToolset.Util
1422
1423 if (null == id)
1424 {
1438 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1425 + id = this.ParseHelper.CreateIdentifier("uis", componentId, directoryId, name, target);
1426 }
1427
1428 // In theory this can never be the case, since InternetShortcut can only be under
@@ -1459,8 +1446,8 @@ namespace WixToolset.Util
1446
1447 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1448
1462 - InternetShortcutType shortcutType = InternetShortcutType.Link;
1463 - if (0 == String.Compare(type, "url", StringComparison.OrdinalIgnoreCase))
1449 + var shortcutType = InternetShortcutType.Link;
1450 + if (String.Equals(type, "url", StringComparison.OrdinalIgnoreCase))
1451 {
1452 shortcutType = InternetShortcutType.Url;
1453 }
@@ -1486,7 +1473,7 @@ namespace WixToolset.Util
1473 // add the appropriate extension based on type of shortcut
1474 name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk");
1475
1489 - var tuple = new WixInternetShortcutTuple(sourceLineNumbers, shortcutId)
1476 + section.AddTuple(new WixInternetShortcutTuple(sourceLineNumbers, shortcutId)
1477 {
1478 ComponentRef = componentId,
1479 DirectoryRef = directoryId,
@@ -1495,9 +1482,7 @@ namespace WixToolset.Util
1482 Attributes = (int)type,
1483 IconFile = iconFile,
1484 IconIndex = iconIndex,
1498 - };
1499 -
1500 - section.Tuples.Add(tuple);
1485 + });
1486
1487 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedInternetShortcuts", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86);
1488
@@ -1505,16 +1490,14 @@ namespace WixToolset.Util
1490 this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder");
1491
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)
1494 {
1495 ComponentRef = componentId,
1496 DirProperty = directoryId,
1497 OnUninstall = true,
1498 // TODO: A better way?
1499 FileName = this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name),
1515 - };
1516 -
1517 - section.Tuples.Add(removeFileTuple);
1500 + });
1501 }
1502
1503 /// <summary>
@@ -1524,22 +1507,22 @@ namespace WixToolset.Util
1507 /// <param name="componentId">Identifier of parent component.</param>
1508 private void ParsePerformanceCategoryElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
1509 {
1527 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1510 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1511 Identifier id = null;
1512 string name = null;
1513 string help = null;
1531 - YesNoType multiInstance = YesNoType.No;
1514 + var multiInstance = YesNoType.No;
1515 int defaultLanguage = 0x09; // default to "english"
1516
1534 - ArrayList parsedPerformanceCounters = new ArrayList();
1517 + var parsedPerformanceCounters = new List<ParsedPerformanceCounter>();
1518
1519 // default to managed performance counter
1537 - string library = "netfxperf.dll";
1538 - string openEntryPoint = "OpenPerformanceData";
1539 - string collectEntryPoint = "CollectPerformanceData";
1540 - string closeEntryPoint = "ClosePerformanceData";
1520 + var library = "netfxperf.dll";
1521 + var openEntryPoint = "OpenPerformanceData";
1522 + var collectEntryPoint = "CollectPerformanceData";
1523 + var closeEntryPoint = "ClosePerformanceData";
1524
1542 - foreach (XAttribute attrib in element.Attributes())
1525 + foreach (var attrib in element.Attributes())
1526 {
1527 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1528 {
@@ -1583,25 +1566,28 @@ namespace WixToolset.Util
1566 }
1567 }
1568
1586 - if (null == id)
1569 + if (null == id && null == name)
1570 {
1588 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1571 + this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "Id", "Name"));
1572 }
1590 -
1591 - if (null == name)
1573 + else if (null == id)
1574 {
1593 - name = id?.Id;
1575 + id = this.ParseHelper.CreateIdentifier("upc", componentId, name);
1576 + }
1577 + else if (null == name)
1578 + {
1579 + name = id.Id;
1580 }
1581
1582 // Process the child counter elements.
1597 - foreach (XElement child in element.Elements())
1583 + foreach (var child in element.Elements())
1584 {
1585 if (this.Namespace == child.Name.Namespace)
1586 {
1587 switch (child.Name.LocalName)
1588 {
1589 case "PerformanceCounter":
1604 - ParsedPerformanceCounter counter = this.ParsePerformanceCounterElement(intermediate, section, child, defaultLanguage);
1590 + var counter = this.ParsePerformanceCounterElement(intermediate, section, child, defaultLanguage);
1591 if (null != counter)
1592 {
1593 parsedPerformanceCounters.Add(counter);
@@ -1622,10 +1608,10 @@ namespace WixToolset.Util
1608 if (!this.Messaging.EncounteredError)
1609 {
1610 // Calculate the ini and h file content.
1625 - string objectName = "OBJECT_1";
1626 - string objectLanguage = defaultLanguage.ToString("D3", CultureInfo.InvariantCulture);
1611 + var objectName = "OBJECT_1";
1612 + var objectLanguage = defaultLanguage.ToString("D3", CultureInfo.InvariantCulture);
1613
1628 - StringBuilder sbIniData = new StringBuilder();
1614 + var sbIniData = new StringBuilder();
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);
1616 sbIniData.AppendFormat("[text]\r\n{0}_{1}_NAME={2}\r\n", objectName, objectLanguage, name);
1617 if (null != help)
@@ -1634,15 +1620,15 @@ namespace WixToolset.Util
1620 }
1621
1622 int symbolConstantsCounter = 0;
1637 - StringBuilder sbSymbolicConstants = new StringBuilder();
1623 + var sbSymbolicConstants = new StringBuilder();
1624 sbSymbolicConstants.AppendFormat("#define {0} {1}\r\n", objectName, symbolConstantsCounter);
1625
1640 - StringBuilder sbCounterNames = new StringBuilder("[~]");
1641 - StringBuilder sbCounterTypes = new StringBuilder("[~]");
1626 + var sbCounterNames = new StringBuilder("[~]");
1627 + var sbCounterTypes = new StringBuilder("[~]");
1628 for (int i = 0; i < parsedPerformanceCounters.Count; ++i)
1629 {
1644 - ParsedPerformanceCounter counter = (ParsedPerformanceCounter)parsedPerformanceCounters[i];
1645 - string counterName = String.Concat("DEVICE_COUNTER_", i + 1);
1630 + var counter = parsedPerformanceCounters[i];
1631 + var counterName = String.Concat("DEVICE_COUNTER_", i + 1);
1632
1633 sbIniData.AppendFormat("{0}_{1}_NAME={2}\r\n", counterName, counter.Language, counter.Name);
1634 if (null != counter.Help)
@@ -1662,20 +1648,18 @@ namespace WixToolset.Util
1648 sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter);
1649
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)
1652 {
1653 ComponentRef = componentId,
1654 Name = name,
1655 IniData = sbIniData.ToString(),
1656 ConstantData = sbSymbolicConstants.ToString(),
1671 - };
1672 -
1673 - section.Tuples.Add(tuple);
1657 + });
1658
1659 // Set up the application's performance key.
1676 - string escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties);
1677 - string linkageKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Linkage", escapedName);
1678 - string performanceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Performance", escapedName);
1660 + var escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties);
1661 + var linkageKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Linkage", escapedName);
1662 + var performanceKey = String.Format(@"SYSTEM\CurrentControlSet\Services\{0}\Performance", escapedName);
1663
1664 this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, linkageKey, "Export", escapedName, componentId, false);
1665 this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "-", null, componentId, false);
@@ -1951,14 +1935,14 @@ namespace WixToolset.Util
1935 /// <param name="defaultLanguage">Default language for the performance counter.</param>
1936 private ParsedPerformanceCounter ParsePerformanceCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, int defaultLanguage)
1937 {
1954 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1938 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1939 ParsedPerformanceCounter parsedPerformanceCounter = null;
1940 string name = null;
1941 string help = null;
1958 - System.Diagnostics.PerformanceCounterType type = System.Diagnostics.PerformanceCounterType.NumberOfItems32;
1942 + var type = System.Diagnostics.PerformanceCounterType.NumberOfItems32;
1943 int language = defaultLanguage;
1944
1961 - foreach (XAttribute attrib in element.Attributes())
1945 + foreach (var attrib in element.Attributes())
1946 {
1947 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1948 {
@@ -2015,7 +1999,7 @@ namespace WixToolset.Util
1999 /// <returns>Numeric representation of the language as per WinNT.h.</returns>
2000 private System.Diagnostics.PerformanceCounterType GetPerformanceCounterType(SourceLineNumber sourceLineNumbers, XAttribute attribute)
2001 {
2018 - System.Diagnostics.PerformanceCounterType type = System.Diagnostics.PerformanceCounterType.NumberOfItems32;
2002 + var type = System.Diagnostics.PerformanceCounterType.NumberOfItems32;
2003 if (String.Empty == attribute.Value)
2004 {
2005 this.Messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName));
@@ -2125,12 +2109,12 @@ namespace WixToolset.Util
2109 /// <param name="fileId">Identifier of referenced file.</param>
2110 private void ParsePerfCounterElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId)
2111 {
2128 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2112 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2113 string name = null;
2114
2115 this.Messaging.Write(UtilWarnings.DeprecatedPerfCounterElement(sourceLineNumbers));
2116
2133 - foreach (XAttribute attrib in element.Attributes())
2117 + foreach (var attrib in element.Attributes())
2118 {
2119 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2120 {
@@ -2159,14 +2143,12 @@ namespace WixToolset.Util
2143
2144 if (!this.Messaging.EncounteredError)
2145 {
2162 - var tuple = new PerfmonTuple(sourceLineNumbers)
2146 + section.AddTuple(new PerfmonTuple(sourceLineNumbers)
2147 {
2148 ComponentRef = componentId,
2149 File = $"[#{fileId}]",
2150 Name = name,
2167 - };
2168 -
2169 - section.Tuples.Add(tuple);
2151 + });
2152 }
2153
2154 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86);
@@ -2182,10 +2164,10 @@ namespace WixToolset.Util
2164 /// <param name="fileId">Identifier of referenced file.</param>
2165 private void ParsePerfCounterManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId)
2166 {
2185 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2167 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2168 string resourceFileDirectory = null;
2169
2188 - foreach (XAttribute attrib in element.Attributes())
2170 + foreach (var attrib in element.Attributes())
2171 {
2172 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2173 {
@@ -2209,14 +2191,12 @@ namespace WixToolset.Util
2191
2192 if (!this.Messaging.EncounteredError)
2193 {
2212 - var tuple = new PerfmonManifestTuple(sourceLineNumbers)
2194 + section.AddTuple(new PerfmonManifestTuple(sourceLineNumbers)
2195 {
2196 ComponentRef = componentId,
2197 File = $"[#{fileId}]",
2198 ResourceFileDirectory = resourceFileDirectory,
2217 - };
2218 -
2219 - section.Tuples.Add(tuple);
2199 + });
2200 }
2201
2202 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonManifestRegister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86);
@@ -2231,10 +2211,10 @@ namespace WixToolset.Util
2211 /// <param name="win64">Flag to determine whether the component is 64-bit.</param>
2212 private void ParseFormatFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileId, bool win64)
2213 {
2234 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2214 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2215 string binaryId = null;
2216
2237 - foreach (XAttribute attrib in element.Attributes())
2217 + foreach (var attrib in element.Attributes())
2218 {
2219 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2220 {
@@ -2265,15 +2245,13 @@ namespace WixToolset.Util
2245 {
2246 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedFormatFiles", this.Context.Platform, CustomActionPlatforms.X64 | CustomActionPlatforms.X86);
2247
2268 - var tuple = new WixFormatFilesTuple(sourceLineNumbers)
2248 + section.AddTuple(new WixFormatFilesTuple(sourceLineNumbers)
2249 {
2250 BinaryRef = binaryId,
2251 FileRef = fileId,
2272 - };
2273 -
2274 - section.Tuples.Add(tuple);
2252 + });
2253
2276 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Binary", binaryId);
2254 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.Binary, binaryId);
2255 }
2256 }
2257
@@ -2285,12 +2263,12 @@ namespace WixToolset.Util
2263 /// <param name="fileId">Identifier of referenced file.</param>
2264 private void ParseEventManifestElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId)
2265 {
2288 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2266 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2267 string messageFile = null;
2268 string resourceFile = null;
2269 string parameterFile = null;
2270
2293 - foreach (XAttribute attrib in element.Attributes())
2271 + foreach (var attrib in element.Attributes())
2272 {
2273 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2274 {
@@ -2320,17 +2298,15 @@ namespace WixToolset.Util
2298
2299 if (!this.Messaging.EncounteredError)
2300 {
2323 - var tuple = new EventManifestTuple(sourceLineNumbers)
2301 + section.AddTuple(new EventManifestTuple(sourceLineNumbers)
2302 {
2303 ComponentRef = componentId,
2304 File = $"[#{fileId}]",
2327 - };
2328 -
2329 - section.Tuples.Add(tuple);
2305 + });
2306
2307 if (null != messageFile)
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"))
2310 {
2311 File = $"[#{fileId}]",
2312 ElementPath = "/*/*/*/*[\\[]@messageFileName[\\]]",
@@ -2338,12 +2314,11 @@ namespace WixToolset.Util
2314 Value = messageFile,
2315 Flags = 4 | 0x00001000, //bulk write | preserve modified date
2316 ComponentRef = componentId,
2341 - };
2342 - section.Tuples.Add(xmlTuple);
2317 + });
2318 }
2319 if (null != parameterFile)
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"))
2322 {
2323 File = $"[#{fileId}]",
2324 ElementPath = "/*/*/*/*[\\[]@parameterFileName[\\]]",
@@ -2351,12 +2326,11 @@ namespace WixToolset.Util
2326 Value = parameterFile,
2327 Flags = 4 | 0x00001000, //bulk write | preserve modified date
2328 ComponentRef = componentId,
2354 - };
2355 - section.Tuples.Add(xmlTuple);
2329 + });
2330 }
2331 if (null != resourceFile)
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"))
2334 {
2335 File = $"[#{fileId}]",
2336 ElementPath = "/*/*/*/*[\\[]@resourceFileName[\\]]",
@@ -2364,8 +2338,7 @@ namespace WixToolset.Util
2338 Value = resourceFile,
2339 Flags = 4 | 0x00001000, //bulk write | preserve modified date
2340 ComponentRef = componentId,
2367 - };
2368 - section.Tuples.Add(xmlTuple);
2341 + });
2342 }
2343
2344 }
@@ -2375,7 +2348,7 @@ namespace WixToolset.Util
2348
2349 if (null != messageFile || null != parameterFile || null != resourceFile)
2350 {
2378 - this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86);
2351 + this.AddReferenceToSchedXmlFile(sourceLineNumbers, section);
2352 }
2353 }
2354
@@ -2389,14 +2362,13 @@ namespace WixToolset.Util
2362 /// <param name="tableName">Name of table that contains objectId.</param>
2363 private void ParsePermissionExElement(Intermediate intermediate, IntermediateSection section, XElement element, string objectId, string componentId, bool win64, string tableName)
2364 {
2392 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2393 - BitArray bits = new BitArray(32);
2365 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2366 + var bits = new BitArray(32);
2367 string domain = null;
2395 - int permission = 0;
2368 string[] specialPermissions = null;
2369 string user = null;
2370
2399 - PermissionType permissionType = PermissionType.SecureObjects;
2371 + var permissionType = PermissionType.SecureObjects;
2372
2373 switch (tableName)
2374 {
@@ -2422,7 +2394,7 @@ namespace WixToolset.Util
2394 break;
2395 }
2396
2425 - foreach (XAttribute attrib in element.Attributes())
2397 + foreach (var attrib in element.Attributes())
2398 {
2399 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2400 {
@@ -2439,7 +2411,7 @@ namespace WixToolset.Util
2411 user = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2412 break;
2413 default:
2442 - YesNoType attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2414 + var attribValue = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
2415 if (!this.TrySetBitFromName(UtilConstants.StandardPermissions, attrib.Name.LocalName, attribValue, bits, 16))
2416 {
2417 if (!this.TrySetBitFromName(UtilConstants.GenericPermissions, attrib.Name.LocalName, attribValue, bits, 28))
@@ -2460,7 +2432,7 @@ namespace WixToolset.Util
2432 }
2433 }
2434
2463 - permission = this.CreateIntegerFromBitArray(bits);
2435 + var permission = this.CreateIntegerFromBitArray(bits);
2436
2437 if (null == user)
2438 {
@@ -2479,7 +2451,7 @@ namespace WixToolset.Util
2451 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedSecureObjects", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X64 | CustomActionPlatforms.X86);
2452
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)
2455 {
2456 SecureObject = objectId,
2457 Table = tableName,
@@ -2487,9 +2459,7 @@ namespace WixToolset.Util
2459 User = user,
2460 Permission = permission,
2461 ComponentRef = componentId,
2490 - };
2491 -
2492 - section.Tuples.Add(tuple);
2462 + });
2463 }
2464 }
2465
@@ -2499,7 +2469,7 @@ namespace WixToolset.Util
2469 /// <param name="element">Element to parse.</param>
2470 private void ParseProductSearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
2471 {
2502 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2472 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2473 Identifier id = null;
2474 string variable = null;
2475 string condition = null;
@@ -2507,9 +2477,9 @@ namespace WixToolset.Util
2477 string productCode = null;
2478 string upgradeCode = null;
2479
2510 - Serialize.ProductSearch.ResultType result = Serialize.ProductSearch.ResultType.NotSet;
2480 + var result = Serialize.ProductSearch.ResultType.NotSet;
2481
2512 - foreach (XAttribute attrib in element.Attributes())
2482 + foreach (var attrib in element.Attributes())
2483 {
2484 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2485 {
@@ -2528,7 +2498,7 @@ namespace WixToolset.Util
2498 upgradeCode = this.ParseHelper.GetAttributeGuidValue(sourceLineNumbers, attrib, false);
2499 break;
2500 case "Result":
2531 - string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2501 + var resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2502 if (!Serialize.ProductSearch.TryParseResultType(resultValue, out result))
2503 {
2504 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
@@ -2571,7 +2541,7 @@ namespace WixToolset.Util
2541
2542 if (!this.Messaging.EncounteredError)
2543 {
2574 - WixProductSearchAttributes attributes = WixProductSearchAttributes.Version;
2544 + var attributes = WixProductSearchAttributes.Version;
2545 switch (result)
2546 {
2547 case Serialize.ProductSearch.ResultType.version:
@@ -2594,7 +2564,7 @@ namespace WixToolset.Util
2564 attributes |= WixProductSearchAttributes.UpgradeCode;
2565 }
2566
2597 - section.Tuples.Add(new WixProductSearchTuple(sourceLineNumbers, id)
2567 + section.AddTuple(new WixProductSearchTuple(sourceLineNumbers, id)
2568 {
2569 Guid = productCode ?? upgradeCode,
2570 Attributes = attributes,
@@ -2608,7 +2578,7 @@ namespace WixToolset.Util
2578 /// <param name="element">Element to parse.</param>
2579 private void ParseRegistrySearchElement(Intermediate intermediate, IntermediateSection section, XElement element)
2580 {
2611 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2581 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2582 Identifier id = null;
2583 string variable = null;
2584 string condition = null;
@@ -2616,12 +2586,12 @@ namespace WixToolset.Util
2586 RegistryRootType? root = null;
2587 string key = null;
2588 string value = null;
2619 - YesNoType expand = YesNoType.NotSet;
2620 - YesNoType win64 = YesNoType.NotSet;
2621 - Serialize.RegistrySearch.ResultType result = Serialize.RegistrySearch.ResultType.NotSet;
2622 - Serialize.RegistrySearch.FormatType format = Serialize.RegistrySearch.FormatType.raw;
2589 + var expand = YesNoType.NotSet;
2590 + var win64 = YesNoType.NotSet;
2591 + var result = Serialize.RegistrySearch.ResultType.NotSet;
2592 + var format = Serialize.RegistrySearch.FormatType.raw;
2593
2624 - foreach (XAttribute attrib in element.Attributes())
2594 + foreach (var attrib in element.Attributes())
2595 {
2596 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2597 {
@@ -2657,7 +2627,7 @@ namespace WixToolset.Util
2627 }
2628 break;
2629 case "Result":
2660 - string resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2630 + var resultValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2631 if (!Serialize.RegistrySearch.TryParseResultType(resultValue, out result))
2632 {
2633 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attrib.Parent.Name.LocalName, attrib.Name.LocalName,
@@ -2698,7 +2668,7 @@ namespace WixToolset.Util
2668 id = this.ParseHelper.CreateIdentifier("wrs", variable, condition, after, root.ToString(), key, value, result.ToString());
2669 }
2670
2701 - WixRegistrySearchAttributes attributes = WixRegistrySearchAttributes.Raw;
2671 + var attributes = WixRegistrySearchAttributes.Raw;
2672 switch (format)
2673 {
2674 case Serialize.RegistrySearch.FormatType.raw:
@@ -2741,9 +2711,9 @@ namespace WixToolset.Util
2711
2712 if (!this.Messaging.EncounteredError)
2713 {
2744 - section.Tuples.Add(new WixRegistrySearchTuple(sourceLineNumbers, id)
2714 + section.AddTuple(new WixRegistrySearchTuple(sourceLineNumbers, id)
2715 {
2746 - Root = (RegistryRootType)root,
2716 + Root = root.Value,
2717 Key = key,
2718 Value = value,
2719 Attributes = attributes,
@@ -2758,12 +2728,12 @@ namespace WixToolset.Util
2728 /// <param name="componentId">Identifier of parent component.</param>
2729 private void ParseRemoveFolderExElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
2730 {
2761 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2731 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2732 Identifier id = null;
2763 - int on = (int)WixRemoveFolderExOn.Uninstall;
2733 + var on = (int)WixRemoveFolderExOn.Uninstall;
2734 string property = null;
2735
2766 - foreach (XAttribute attrib in element.Attributes())
2736 + foreach (var attrib in element.Attributes())
2737 {
2738 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2739 {
@@ -2773,7 +2743,7 @@ namespace WixToolset.Util
2743 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
2744 break;
2745 case "On":
2776 - string onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2746 + var onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2747 if (onValue.Length == 0)
2748 {
2749 on = CompilerConstants.IllegalInteger;
@@ -2828,14 +2798,12 @@ namespace WixToolset.Util
2798 {
2799 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RemoveFoldersEx", this.Context.Platform, CustomActionPlatforms.X86);
2800
2831 - var tuple = new WixRemoveFolderExTuple(sourceLineNumbers)
2801 + section.AddTuple(new WixRemoveFolderExTuple(sourceLineNumbers, id)
2802 {
2803 ComponentRef = componentId,
2804 Property = property,
2835 - InstallMode = (int)on,
2836 - };
2837 -
2838 - section.Tuples.Add(tuple);
2805 + InstallMode = on,
2806 + });
2807
2808 this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile");
2809 }
@@ -2848,12 +2816,12 @@ namespace WixToolset.Util
2816 /// <param name="componentId">The identity of the parent component.</param>
2817 private void ParseRestartResourceElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
2818 {
2851 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2819 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2820 Identifier id = null;
2821 string resource = null;
2854 - int attributes = CompilerConstants.IntegerNotSet;
2822 + var attributes = CompilerConstants.IntegerNotSet;
2823
2856 - foreach (XAttribute attrib in element.Attributes())
2824 + foreach (var attrib in element.Attributes())
2825 {
2826 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2827 {
@@ -2906,14 +2874,12 @@ namespace WixToolset.Util
2874 {
2875 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RegisterRestartResources", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86);
2876
2909 - var tuple = new WixRestartResourceTuple(sourceLineNumbers)
2877 + section.AddTuple(new WixRestartResourceTuple(sourceLineNumbers, id)
2878 {
2879 ComponentRef = componentId,
2880 Resource = resource,
2881 Attributes = attributes,
2914 - };
2915 -
2916 - section.Tuples.Add(tuple);
2882 + });
2883 }
2884 }
2885
@@ -2926,18 +2892,18 @@ namespace WixToolset.Util
2892 /// <param name="parentTableServiceName">Optional name of service </param>
2893 private void ParseServiceConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string parentTableName, string parentTableServiceName)
2894 {
2929 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2895 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2896 string firstFailureActionType = null;
2931 - bool newService = false;
2897 + var newService = false;
2898 string programCommandLine = null;
2899 string rebootMessage = null;
2934 - int resetPeriod = CompilerConstants.IntegerNotSet;
2935 - int restartServiceDelay = CompilerConstants.IntegerNotSet;
2900 + var resetPeriod = CompilerConstants.IntegerNotSet;
2901 + var restartServiceDelay = CompilerConstants.IntegerNotSet;
2902 string secondFailureActionType = null;
2903 string serviceName = null;
2904 string thirdFailureActionType = null;
2905
2940 - foreach (XAttribute attrib in element.Attributes())
2906 + foreach (var attrib in element.Attributes())
2907 {
2908 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2909 {
@@ -3000,7 +2966,7 @@ namespace WixToolset.Util
2966 {
2967 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedServiceConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86);
2968
3003 - var tuple = new ServiceConfigTuple(sourceLineNumbers)
2969 + section.AddTuple(new ServiceConfigTuple(sourceLineNumbers)
2970 {
2971 ServiceName = serviceName,
2972 ComponentRef = componentId,
@@ -3012,9 +2978,7 @@ namespace WixToolset.Util
2978 RestartServiceDelayInSeconds = restartServiceDelay,
2979 ProgramCommandLine = programCommandLine,
2980 RebootMessage = rebootMessage,
3015 - };
3016 -
3017 - section.Tuples.Add(tuple);
2981 + });
2982 }
2983 }
2984
@@ -3026,16 +2990,16 @@ namespace WixToolset.Util
2990 /// <param name="win64">Indicates whether the path is a 64-bit path.</param>
2991 private void ParseTouchFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool win64)
2992 {
3029 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2993 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2994 Identifier id = null;
2995 string path = null;
3032 - YesNoType onInstall = YesNoType.NotSet;
3033 - YesNoType onReinstall = YesNoType.NotSet;
3034 - YesNoType onUninstall = YesNoType.NotSet;
3035 - YesNoType nonvital = YesNoType.NotSet;
2996 + var onInstall = YesNoType.NotSet;
2997 + var onReinstall = YesNoType.NotSet;
2998 + var onUninstall = YesNoType.NotSet;
2999 + var nonvital = YesNoType.NotSet;
3000 int attributes = 0;
3001
3038 - foreach (XAttribute attrib in element.Attributes())
3002 + foreach (var attrib in element.Attributes())
3003 {
3004 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3005 {
@@ -3097,14 +3061,12 @@ namespace WixToolset.Util
3061
3062 if (!this.Messaging.EncounteredError)
3063 {
3100 - var tuple = new WixTouchFileTuple(sourceLineNumbers)
3064 + section.AddTuple(new WixTouchFileTuple(sourceLineNumbers, id)
3065 {
3066 ComponentRef = componentId,
3067 Path = path,
3068 Attributes = attributes,
3105 - };
3106 -
3107 - section.Tuples.Add(tuple);
3069 + });
3070
3071 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "TouchFileDuringInstall", this.Context.Platform, CustomActionPlatforms.X86);
3072 }
@@ -3117,14 +3079,14 @@ namespace WixToolset.Util
3079 /// <param name="componentId">Optional identifier of parent component.</param>
3080 private void ParseUserElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
3081 {
3120 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3082 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3083 Identifier id = null;
3084 int attributes = 0;
3085 string domain = null;
3086 string name = null;
3087 string password = null;
3088
3127 - foreach (XAttribute attrib in element.Attributes())
3089 + foreach (var attrib in element.Attributes())
3090 {
3091 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3092 {
@@ -3274,7 +3236,7 @@ namespace WixToolset.Util
3236
3237 if (null == id)
3238 {
3277 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
3239 + id = this.ParseHelper.CreateIdentifier("usr", componentId, name);
3240 }
3241
3242 if (null == name)
@@ -3282,7 +3244,7 @@ namespace WixToolset.Util
3244 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
3245 }
3246
3285 - foreach (XElement child in element.Elements())
3247 + foreach (var child in element.Elements())
3248 {
3249 if (this.Namespace == child.Name.Namespace)
3250 {
@@ -3291,7 +3253,7 @@ namespace WixToolset.Util
3253 case "GroupRef":
3254 if (null == componentId)
3255 {
3294 - SourceLineNumber childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child);
3256 + var childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child);
3257 this.Messaging.Write(UtilErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
3258 }
3259
@@ -3315,16 +3277,14 @@ namespace WixToolset.Util
3277
3278 if (!this.Messaging.EncounteredError)
3279 {
3318 - var tuple = new UserTuple(sourceLineNumbers, id)
3280 + section.AddTuple(new UserTuple(sourceLineNumbers, id)
3281 {
3282 ComponentRef = componentId,
3283 Name = name,
3284 Domain = domain,
3285 Password = password,
3286 Attributes = attributes,
3325 - };
3326 -
3327 - section.Tuples.Add(tuple);
3287 + });
3288 }
3289 }
3290
@@ -3335,7 +3295,7 @@ namespace WixToolset.Util
3295 /// <param name="componentId">Identifier of parent component.</param>
3296 private void ParseXmlFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
3297 {
3338 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3298 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3299 Identifier id = null;
3300 string file = null;
3301 string elementPath = null;
@@ -3344,14 +3304,14 @@ namespace WixToolset.Util
3304 int sequence = -1;
3305 int flags = 0;
3306
3347 - foreach (XAttribute attrib in element.Attributes())
3307 + foreach (var attrib in element.Attributes())
3308 {
3309 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3310 {
3311 switch (attrib.Name.LocalName)
3312 {
3313 case "Action":
3354 - string actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3314 + var actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3315 switch (actionValue)
3316 {
3317 case "createElement":
@@ -3429,7 +3389,7 @@ namespace WixToolset.Util
3389
3390 if (null == id)
3391 {
3432 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
3392 + id = this.ParseHelper.CreateIdentifier("uxf", componentId, file, elementPath, name);
3393 }
3394
3395 if (null == file)
@@ -3451,7 +3411,7 @@ namespace WixToolset.Util
3411
3412 if (!this.Messaging.EncounteredError)
3413 {
3454 - var tuple = new XmlFileTuple(sourceLineNumbers, id)
3414 + var tuple = section.AddTuple(new XmlFileTuple(sourceLineNumbers, id)
3415 {
3416 File = file,
3417 ElementPath = elementPath,
@@ -3459,15 +3419,14 @@ namespace WixToolset.Util
3419 Value = value,
3420 Flags = flags,
3421 ComponentRef = componentId,
3462 - };
3422 + });
3423 if (-1 != sequence)
3424 {
3425 tuple.Sequence = sequence;
3426 }
3467 - section.Tuples.Add(tuple);
3427 }
3428
3470 - this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86);
3429 + this.AddReferenceToSchedXmlFile(sourceLineNumbers, section);
3430 }
3431
3432 /// <summary>
@@ -3478,18 +3437,18 @@ namespace WixToolset.Util
3437 /// <param name="nested">Whether or not the element is nested.</param>
3438 private void ParseXmlConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool nested)
3439 {
3481 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3440 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
3441 Identifier id = null;
3442 string elementId = null;
3443 string elementPath = null;
3444 int flags = 0;
3445 string file = null;
3446 string name = null;
3488 - int sequence = CompilerConstants.IntegerNotSet;
3447 + var sequence = CompilerConstants.IntegerNotSet;
3448 string value = null;
3449 string verifyPath = null;
3450
3492 - foreach (XAttribute attrib in element.Attributes())
3451 + foreach (var attrib in element.Attributes())
3452 {
3453 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
3454 {
@@ -3539,7 +3498,7 @@ namespace WixToolset.Util
3498 }
3499 else
3500 {
3542 - string nodeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3501 + var nodeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3502 switch (nodeValue)
3503 {
3504 case "element":
@@ -3564,7 +3523,7 @@ namespace WixToolset.Util
3523 }
3524 else
3525 {
3567 - string onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3526 + var onValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3527 switch (onValue)
3528 {
3529 case "install":
@@ -3607,7 +3566,7 @@ namespace WixToolset.Util
3566
3567 if (null == id)
3568 {
3610 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
3569 + id = this.ParseHelper.CreateIdentifier("uxc", componentId, file, elementId, elementPath);
3570 }
3571
3572 if (null == file)
@@ -3631,10 +3590,10 @@ namespace WixToolset.Util
3590 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, element.Name.LocalName, "ElementId", "Action", "Node", "On"));
3591 }
3592
3634 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "XmlConfig", elementId);
3593 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, UtilTupleDefinitions.XmlConfig, elementId);
3594 }
3595
3637 - string innerText = this.ParseHelper.GetTrimmedInnerText(element);
3596 + var innerText = this.ParseHelper.GetTrimmedInnerText(element);
3597 if (null != value)
3598 {
3599 // cannot specify both the value attribute and inner text
@@ -3652,7 +3611,7 @@ namespace WixToolset.Util
3611 }
3612
3613 // find unexpected child elements
3655 - foreach (XElement child in element.Elements())
3614 + foreach (var child in element.Elements())
3615 {
3616 if (this.Namespace == child.Name.Namespace)
3617 {
@@ -3681,21 +3640,20 @@ namespace WixToolset.Util
3640
3641 if (!this.Messaging.EncounteredError)
3642 {
3684 - var tuple = new XmlConfigTuple(sourceLineNumbers, id)
3643 + var tuple = section.AddTuple(new XmlConfigTuple(sourceLineNumbers, id)
3644 {
3686 - File=file,
3687 - ElementPath=elementId ??elementPath,
3688 - VerifyPath=verifyPath,
3689 - Name=name,
3690 - Value=value,
3691 - Flags=flags,
3692 - ComponentRef=componentId,
3693 - };
3645 + File = file,
3646 + ElementPath = elementId ?? elementPath,
3647 + VerifyPath = verifyPath,
3648 + Name = name,
3649 + Value = value,
3650 + Flags = flags,
3651 + ComponentRef = componentId,
3652 + });
3653 if (CompilerConstants.IntegerNotSet != sequence)
3654 {
3655 tuple.Sequence = sequence;
3656 }
3698 - section.Tuples.Add(tuple);
3657 }
3658
3659 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86);
@@ -3727,7 +3685,7 @@ namespace WixToolset.Util
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");
3686 }
3687
3730 - int[] intArray = new int[1];
3688 + var intArray = new int[1];
3689 bits.CopyTo(intArray, 0);
3690
3691 return intArray[0];
@@ -3735,7 +3693,7 @@ namespace WixToolset.Util
3693
3694 private bool TrySetBitFromName(string[] attributeNames, string attributeName, YesNoType attributeValue, BitArray bits, int offset)
3695 {
3738 - for (int i = 0; i < attributeNames.Length; i++)
3696 + for (var i = 0; i < attributeNames.Length; i++)
3697 {
3698 if (attributeName.Equals(attributeNames[i], StringComparison.Ordinal))
3699 {
@@ -3747,6 +3705,11 @@ namespace WixToolset.Util
3705 return false;
3706 }
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 +
3713 /// <summary>
3714 /// Private class that stores the data from a parsed PerformanceCounter element.
3715 /// </summary>
src/wixext/UtilTableDefinitions.cs new
+300
@@ -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 +}
src/wixext/UtilWindowsInstallerBackendExtension.cs
+1 -15
@@ -3,25 +3,11 @@
3 namespace WixToolset.Util
4 {
5 using System.Collections.Generic;
6 - using System.Linq;
7 - using System.Xml;
6 using WixToolset.Data.WindowsInstaller;
7 using WixToolset.Extensibility;
8
9 public class UtilWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension
10 {
13 - private static readonly TableDefinition[] Tables = LoadTables();
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 - }
11 + public override IEnumerable<TableDefinition> TableDefinitions => UtilTableDefinitions.All;
12 }
13 }
src/wixext/WixToolset.Util.wixext.csproj
-1
@@ -14,7 +14,6 @@
14 <ItemGroup>
15 <Content Include="$(MSBuildThisFileName).targets" />
16 <Content Include="util.xsd" PackagePath="tools" />
17 - <EmbeddedResource Include="tables.xml" />
17 <EmbeddedResource Include="$(OutputPath)..\util.wixlib" />
18 </ItemGroup>
19
src/wixext/tables.xml deleted
-238
@@ -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>