diff options
Diffstat (limited to 'src/wixext/UtilCompiler.cs')
-rw-r--r-- | src/wixext/UtilCompiler.cs | 599 |
1 files changed, 253 insertions, 346 deletions
diff --git a/src/wixext/UtilCompiler.cs b/src/wixext/UtilCompiler.cs index 19f4af06..a8d59ca3 100644 --- a/src/wixext/UtilCompiler.cs +++ b/src/wixext/UtilCompiler.cs | |||
@@ -14,6 +14,7 @@ namespace WixToolset.Util | |||
14 | using WixToolset.Data.Tuples; | 14 | using WixToolset.Data.Tuples; |
15 | using WixToolset.Extensibility; | 15 | using WixToolset.Extensibility; |
16 | using WixToolset.Extensibility.Data; | 16 | using WixToolset.Extensibility.Data; |
17 | using WixToolset.Util.Tuples; | ||
17 | 18 | ||
18 | /// <summary> | 19 | /// <summary> |
19 | /// The compiler for the WiX Toolset Utility Extension. | 20 | /// The compiler for the WiX Toolset Utility Extension. |
@@ -790,38 +791,32 @@ namespace WixToolset.Util | |||
790 | 791 | ||
791 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | 792 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); |
792 | 793 | ||
793 | // Reference CustomAction since nothing will happen without it | 794 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "CloseApplications", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
794 | if (this.Context.Platform == Platform.ARM) | ||
795 | { | ||
796 | // Ensure ARM version of the CA is referenced | ||
797 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixCloseApplications_ARM"); | ||
798 | } | ||
799 | else | ||
800 | { | ||
801 | // All other supported platforms use x86 | ||
802 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixCloseApplications"); | ||
803 | } | ||
804 | 795 | ||
805 | if (!this.Messaging.EncounteredError) | 796 | if (!this.Messaging.EncounteredError) |
806 | { | 797 | { |
807 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixCloseApplication", id); | 798 | var tuple = new WixCloseApplicationTuple(sourceLineNumbers, id) |
808 | row.Set(1, target); | 799 | { |
809 | row.Set(2, description); | 800 | Target = target, |
810 | row.Set(3, condition); | 801 | Description = description, |
811 | row.Set(4, attributes); | 802 | Condition = condition, |
803 | Attributes = attributes, | ||
804 | Property = property, | ||
805 | }; | ||
812 | if (CompilerConstants.IntegerNotSet != sequence) | 806 | if (CompilerConstants.IntegerNotSet != sequence) |
813 | { | 807 | { |
814 | row.Set(5, sequence); | 808 | tuple.Sequence = sequence; |
815 | } | 809 | } |
816 | row.Set(6, property); | ||
817 | if (CompilerConstants.IntegerNotSet != terminateExitCode) | 810 | if (CompilerConstants.IntegerNotSet != terminateExitCode) |
818 | { | 811 | { |
819 | row.Set(7, terminateExitCode); | 812 | tuple.TerminateExitCode = terminateExitCode; |
820 | } | 813 | } |
821 | if (CompilerConstants.IntegerNotSet != timeout) | 814 | if (CompilerConstants.IntegerNotSet != timeout) |
822 | { | 815 | { |
823 | row.Set(8, timeout * 1000); // make the timeout milliseconds in the table. | 816 | tuple.Timeout = timeout * 1000; // make the timeout milliseconds in the table. |
824 | } | 817 | } |
818 | |||
819 | section.Tuples.Add(tuple); | ||
825 | } | 820 | } |
826 | } | 821 | } |
827 | 822 | ||
@@ -1096,7 +1091,7 @@ namespace WixToolset.Util | |||
1096 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1091 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1097 | string description = null; | 1092 | string description = null; |
1098 | string name = null; | 1093 | string name = null; |
1099 | string id = null; | 1094 | Identifier id = null; |
1100 | 1095 | ||
1101 | foreach (XAttribute attrib in element.Attributes()) | 1096 | foreach (XAttribute attrib in element.Attributes()) |
1102 | { | 1097 | { |
@@ -1105,7 +1100,7 @@ namespace WixToolset.Util | |||
1105 | switch (attrib.Name.LocalName) | 1100 | switch (attrib.Name.LocalName) |
1106 | { | 1101 | { |
1107 | case "Id": | 1102 | case "Id": |
1108 | id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1103 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); |
1109 | break; | 1104 | break; |
1110 | case "Name": | 1105 | case "Name": |
1111 | name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 1106 | name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
@@ -1159,28 +1154,20 @@ namespace WixToolset.Util | |||
1159 | } | 1154 | } |
1160 | } | 1155 | } |
1161 | 1156 | ||
1162 | // Reference ConfigureSmbInstall and ConfigureSmbUninstall since nothing will happen without it | 1157 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureSmbInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
1163 | if (this.Context.Platform == Platform.ARM) | 1158 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureSmbUninstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
1164 | { | ||
1165 | // Ensure ARM version of the CA is referenced | ||
1166 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbInstall_ARM"); | ||
1167 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbUninstall_ARM"); | ||
1168 | } | ||
1169 | else | ||
1170 | { | ||
1171 | // All other supported platforms use x86 | ||
1172 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbInstall"); | ||
1173 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureSmbUninstall"); | ||
1174 | } | ||
1175 | 1159 | ||
1176 | if (!this.Messaging.EncounteredError) | 1160 | if (!this.Messaging.EncounteredError) |
1177 | { | 1161 | { |
1178 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "FileShare"); | 1162 | var tuple = new FileShareTuple(sourceLineNumbers, id) |
1179 | row.Set(0, id); | 1163 | { |
1180 | row.Set(1, name); | 1164 | ShareName = name, |
1181 | row.Set(2, componentId); | 1165 | ComponentRef = componentId, |
1182 | row.Set(3, description); | 1166 | Description = description, |
1183 | row.Set(4, directoryId); | 1167 | DirectoryRef = directoryId, |
1168 | }; | ||
1169 | |||
1170 | section.Tuples.Add(tuple); | ||
1184 | } | 1171 | } |
1185 | } | 1172 | } |
1186 | 1173 | ||
@@ -1189,7 +1176,7 @@ namespace WixToolset.Util | |||
1189 | /// </summary> | 1176 | /// </summary> |
1190 | /// <param name="element">Element to parse.</param> | 1177 | /// <param name="element">Element to parse.</param> |
1191 | /// <param name="fileShareId">The identifier of the parent FileShare element.</param> | 1178 | /// <param name="fileShareId">The identifier of the parent FileShare element.</param> |
1192 | private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileShareId) | 1179 | private void ParseFileSharePermissionElement(Intermediate intermediate, IntermediateSection section, XElement element, Identifier fileShareId) |
1193 | { | 1180 | { |
1194 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1181 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1195 | BitArray bits = new BitArray(32); | 1182 | BitArray bits = new BitArray(32); |
@@ -1244,10 +1231,14 @@ namespace WixToolset.Util | |||
1244 | 1231 | ||
1245 | if (!this.Messaging.EncounteredError) | 1232 | if (!this.Messaging.EncounteredError) |
1246 | { | 1233 | { |
1247 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "FileSharePermissions"); | 1234 | var tuple = new FileSharePermissionsTuple(sourceLineNumbers) |
1248 | row.Set(0, fileShareId); | 1235 | { |
1249 | row.Set(1, user); | 1236 | FileShareRef = fileShareId.Id, |
1250 | row.Set(2, permission); | 1237 | UserRef = user, |
1238 | Permissions = permission, | ||
1239 | }; | ||
1240 | |||
1241 | section.Tuples.Add(tuple); | ||
1251 | } | 1242 | } |
1252 | } | 1243 | } |
1253 | 1244 | ||
@@ -1259,7 +1250,7 @@ namespace WixToolset.Util | |||
1259 | private void ParseGroupElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 1250 | private void ParseGroupElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
1260 | { | 1251 | { |
1261 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1252 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1262 | string id = null; | 1253 | Identifier id = null; |
1263 | string domain = null; | 1254 | string domain = null; |
1264 | string name = null; | 1255 | string name = null; |
1265 | 1256 | ||
@@ -1270,7 +1261,7 @@ namespace WixToolset.Util | |||
1270 | switch (attrib.Name.LocalName) | 1261 | switch (attrib.Name.LocalName) |
1271 | { | 1262 | { |
1272 | case "Id": | 1263 | case "Id": |
1273 | id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1264 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); |
1274 | break; | 1265 | break; |
1275 | case "Name": | 1266 | case "Name": |
1276 | name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 1267 | name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
@@ -1298,11 +1289,14 @@ namespace WixToolset.Util | |||
1298 | 1289 | ||
1299 | if (!this.Messaging.EncounteredError) | 1290 | if (!this.Messaging.EncounteredError) |
1300 | { | 1291 | { |
1301 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Group"); | 1292 | var tuple = new GroupTuple(sourceLineNumbers, id) |
1302 | row.Set(0, id); | 1293 | { |
1303 | row.Set(1, componentId); | 1294 | ComponentRef = componentId, |
1304 | row.Set(2, name); | 1295 | Name = name, |
1305 | row.Set(3, domain); | 1296 | Domain = domain, |
1297 | }; | ||
1298 | |||
1299 | section.Tuples.Add(tuple); | ||
1306 | } | 1300 | } |
1307 | } | 1301 | } |
1308 | 1302 | ||
@@ -1341,9 +1335,13 @@ namespace WixToolset.Util | |||
1341 | 1335 | ||
1342 | if (!this.Messaging.EncounteredError) | 1336 | if (!this.Messaging.EncounteredError) |
1343 | { | 1337 | { |
1344 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "UserGroup"); | 1338 | var tuple = new UserGroupTuple(sourceLineNumbers) |
1345 | row.Set(0, userId); | 1339 | { |
1346 | row.Set(1, groupId); | 1340 | UserRef = userId, |
1341 | GroupRef = groupId, | ||
1342 | }; | ||
1343 | |||
1344 | section.Tuples.Add(tuple); | ||
1347 | } | 1345 | } |
1348 | } | 1346 | } |
1349 | 1347 | ||
@@ -1356,7 +1354,7 @@ namespace WixToolset.Util | |||
1356 | private void ParseInternetShortcutElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string defaultTarget) | 1354 | private void ParseInternetShortcutElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string defaultTarget) |
1357 | { | 1355 | { |
1358 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1356 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1359 | string id = null; | 1357 | Identifier id = null; |
1360 | string name = null; | 1358 | string name = null; |
1361 | string target = null; | 1359 | string target = null; |
1362 | string directoryId = null; | 1360 | string directoryId = null; |
@@ -1374,7 +1372,7 @@ namespace WixToolset.Util | |||
1374 | directoryId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1372 | directoryId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
1375 | break; | 1373 | break; |
1376 | case "Id": | 1374 | case "Id": |
1377 | id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1375 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); |
1378 | break; | 1376 | break; |
1379 | case "Name": | 1377 | case "Name": |
1380 | name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 1378 | name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
@@ -1457,43 +1455,40 @@ namespace WixToolset.Util | |||
1457 | /// <param name="id">Identifier of shortcut.</param> | 1455 | /// <param name="id">Identifier of shortcut.</param> |
1458 | /// <param name="name">Name of shortcut without extension.</param> | 1456 | /// <param name="name">Name of shortcut without extension.</param> |
1459 | /// <param name="target">Target URL of shortcut.</param> | 1457 | /// <param name="target">Target URL of shortcut.</param> |
1460 | private void CreateWixInternetShortcut(IntermediateSection section, SourceLineNumber sourceLineNumbers, string componentId, string directoryId, string shortcutId, string name, string target, InternetShortcutType type, string iconFile, int iconIndex) | 1458 | private void CreateWixInternetShortcut(IntermediateSection section, SourceLineNumber sourceLineNumbers, string componentId, string directoryId, Identifier shortcutId, string name, string target, InternetShortcutType type, string iconFile, int iconIndex) |
1461 | { | 1459 | { |
1462 | // add the appropriate extension based on type of shortcut | 1460 | // add the appropriate extension based on type of shortcut |
1463 | name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk"); | 1461 | name = String.Concat(name, InternetShortcutType.Url == type ? ".url" : ".lnk"); |
1464 | 1462 | ||
1465 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixInternetShortcut"); | 1463 | var tuple = new WixInternetShortcutTuple(sourceLineNumbers, shortcutId) |
1466 | row.Set(0, shortcutId); | ||
1467 | row.Set(1, componentId); | ||
1468 | row.Set(2, directoryId); | ||
1469 | row.Set(3, name); | ||
1470 | row.Set(4, target); | ||
1471 | row.Set(5, (int)type); | ||
1472 | row.Set(6, iconFile); | ||
1473 | row.Set(7, iconIndex); | ||
1474 | |||
1475 | // Reference custom action because nothing will happen without it | ||
1476 | if (this.Context.Platform == Platform.ARM) | ||
1477 | { | ||
1478 | // Ensure ARM version of the CA is referenced | ||
1479 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedInternetShortcuts_ARM"); | ||
1480 | } | ||
1481 | else | ||
1482 | { | 1464 | { |
1483 | // All other supported platforms use x86 | 1465 | ComponentRef = componentId, |
1484 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedInternetShortcuts"); | 1466 | DirectoryRef = directoryId, |
1485 | } | 1467 | Name = name, |
1468 | Target = target, | ||
1469 | Attributes = (int)type, | ||
1470 | IconFile = iconFile, | ||
1471 | IconIndex = iconIndex, | ||
1472 | }; | ||
1473 | |||
1474 | section.Tuples.Add(tuple); | ||
1475 | |||
1476 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedInternetShortcuts", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | ||
1486 | 1477 | ||
1487 | // make sure we have a CreateFolder table so that the immediate CA can add temporary rows to handle installation and uninstallation | 1478 | // make sure we have a CreateFolder table so that the immediate CA can add temporary rows to handle installation and uninstallation |
1488 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder"); | 1479 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "CreateFolder"); |
1489 | 1480 | ||
1490 | // use built-in MSI functionality to remove the shortcuts rather than doing so via CA | 1481 | // use built-in MSI functionality to remove the shortcuts rather than doing so via CA |
1491 | row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "RemoveFile"); | 1482 | var removeFileTuple = new RemoveFileTuple(sourceLineNumbers, shortcutId) |
1492 | row.Set(0, shortcutId); | 1483 | { |
1493 | row.Set(1, componentId); | 1484 | ComponentRef = componentId, |
1494 | row.Set(2, this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name)); | 1485 | DirProperty = directoryId, |
1495 | row.Set(3, directoryId); | 1486 | OnUninstall = true, |
1496 | row.Set(4, 2); // msidbRemoveFileInstallModeOnRemove | 1487 | // TODO: A better way? |
1488 | FileName = this.ParseHelper.IsValidShortFilename(name, false) ? name : String.Concat(this.ParseHelper.CreateShortName(name, true, false, directoryId, name), "|", name), | ||
1489 | }; | ||
1490 | |||
1491 | section.Tuples.Add(removeFileTuple); | ||
1497 | } | 1492 | } |
1498 | 1493 | ||
1499 | /// <summary> | 1494 | /// <summary> |
@@ -1504,7 +1499,7 @@ namespace WixToolset.Util | |||
1504 | private void ParsePerformanceCategoryElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 1499 | private void ParsePerformanceCategoryElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
1505 | { | 1500 | { |
1506 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 1501 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
1507 | string id = null; | 1502 | Identifier id = null; |
1508 | string name = null; | 1503 | string name = null; |
1509 | string help = null; | 1504 | string help = null; |
1510 | YesNoType multiInstance = YesNoType.No; | 1505 | YesNoType multiInstance = YesNoType.No; |
@@ -1537,7 +1532,7 @@ namespace WixToolset.Util | |||
1537 | help = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 1532 | help = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
1538 | break; | 1533 | break; |
1539 | case "Id": | 1534 | case "Id": |
1540 | id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1535 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); |
1541 | break; | 1536 | break; |
1542 | case "Library": | 1537 | case "Library": |
1543 | library = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 1538 | library = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
@@ -1569,7 +1564,7 @@ namespace WixToolset.Util | |||
1569 | 1564 | ||
1570 | if (null == name) | 1565 | if (null == name) |
1571 | { | 1566 | { |
1572 | name = id; | 1567 | name = id?.Id; |
1573 | } | 1568 | } |
1574 | 1569 | ||
1575 | // Process the child counter elements. | 1570 | // Process the child counter elements. |
@@ -1641,12 +1636,15 @@ namespace WixToolset.Util | |||
1641 | sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter); | 1636 | sbSymbolicConstants.AppendFormat("#define LAST_{0}_COUNTER_OFFSET {1}\r\n", objectName, symbolConstantsCounter); |
1642 | 1637 | ||
1643 | // Add the calculated INI and H strings to the PerformanceCategory table. | 1638 | // Add the calculated INI and H strings to the PerformanceCategory table. |
1644 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "PerformanceCategory"); | 1639 | var tuple = new PerformanceCategoryTuple(sourceLineNumbers, id) |
1645 | row.Set(0, id); | 1640 | { |
1646 | row.Set(1, componentId); | 1641 | ComponentRef = componentId, |
1647 | row.Set(2, name); | 1642 | Name = name, |
1648 | row.Set(3, sbIniData.ToString()); | 1643 | IniData = sbIniData.ToString(), |
1649 | row.Set(4, sbSymbolicConstants.ToString()); | 1644 | ConstantData = sbSymbolicConstants.ToString(), |
1645 | }; | ||
1646 | |||
1647 | section.Tuples.Add(tuple); | ||
1650 | 1648 | ||
1651 | // Set up the application's performance key. | 1649 | // Set up the application's performance key. |
1652 | string escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties); | 1650 | string escapedName = UtilCompiler.FindPropertyBrackets.Replace(name, this.EscapeProperties); |
@@ -1664,19 +1662,8 @@ namespace WixToolset.Util | |||
1664 | this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Counter Types", sbCounterTypes.ToString(), componentId, false); | 1662 | this.ParseHelper.CreateRegistryTuple(section, sourceLineNumbers, RegistryRootType.LocalMachine, performanceKey, "Counter Types", sbCounterTypes.ToString(), componentId, false); |
1665 | } | 1663 | } |
1666 | 1664 | ||
1667 | // Reference InstallPerfCounterData and UninstallPerfCounterData since nothing will happen without them | 1665 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "InstallPerfCounterData", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
1668 | if (this.Context.Platform == Platform.ARM) | 1666 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "UninstallPerfCounterData", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
1669 | { | ||
1670 | // Ensure ARM version of the CAs are referenced | ||
1671 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "InstallPerfCounterData_ARM"); | ||
1672 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "UninstallPerfCounterData_ARM"); | ||
1673 | } | ||
1674 | else | ||
1675 | { | ||
1676 | // All other supported platforms use x86 | ||
1677 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "InstallPerfCounterData"); | ||
1678 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "UninstallPerfCounterData"); | ||
1679 | } | ||
1680 | } | 1667 | } |
1681 | 1668 | ||
1682 | /// <summary> | 1669 | /// <summary> |
@@ -2146,25 +2133,18 @@ namespace WixToolset.Util | |||
2146 | 2133 | ||
2147 | if (!this.Messaging.EncounteredError) | 2134 | if (!this.Messaging.EncounteredError) |
2148 | { | 2135 | { |
2149 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "Perfmon"); | 2136 | var tuple = new PerfmonTuple(sourceLineNumbers) |
2150 | row.Set(0, componentId); | 2137 | { |
2151 | row.Set(1, $"[#{fileId}]"); | 2138 | ComponentRef = componentId, |
2152 | row.Set(2, name); | 2139 | File = $"[#{fileId}]", |
2153 | } | 2140 | Name = name, |
2141 | }; | ||
2154 | 2142 | ||
2155 | // Reference ConfigurePerfmonInstall and ConfigurePerfmonUninstall since nothing will happen without them | 2143 | section.Tuples.Add(tuple); |
2156 | if (this.Context.Platform == Platform.ARM) | ||
2157 | { | ||
2158 | // Ensure ARM version of the CAs are referenced | ||
2159 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonInstall_ARM"); | ||
2160 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonUninstall_ARM"); | ||
2161 | } | ||
2162 | else | ||
2163 | { | ||
2164 | // All other supported platforms use x86 | ||
2165 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonInstall"); | ||
2166 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonUninstall"); | ||
2167 | } | 2144 | } |
2145 | |||
2146 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonInstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | ||
2147 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonUninstall", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | ||
2168 | } | 2148 | } |
2169 | 2149 | ||
2170 | 2150 | ||
@@ -2203,24 +2183,18 @@ namespace WixToolset.Util | |||
2203 | 2183 | ||
2204 | if (!this.Messaging.EncounteredError) | 2184 | if (!this.Messaging.EncounteredError) |
2205 | { | 2185 | { |
2206 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "PerfmonManifest"); | 2186 | var tuple = new PerfmonManifestTuple(sourceLineNumbers) |
2207 | row.Set(0, componentId); | 2187 | { |
2208 | row.Set(1, $"[#{fileId}]"); | 2188 | ComponentRef = componentId, |
2209 | row.Set(2, resourceFileDirectory); | 2189 | File = $"[#{fileId}]", |
2210 | } | 2190 | ResourceFileDirectory = resourceFileDirectory, |
2191 | }; | ||
2211 | 2192 | ||
2212 | if (this.Context.Platform == Platform.ARM) | 2193 | section.Tuples.Add(tuple); |
2213 | { | ||
2214 | // Ensure ARM version of the CAs are referenced | ||
2215 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestRegister_ARM"); | ||
2216 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestUnregister_ARM"); | ||
2217 | } | ||
2218 | else | ||
2219 | { | ||
2220 | // All other supported platforms use x86 | ||
2221 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestRegister"); | ||
2222 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigurePerfmonManifestUnregister"); | ||
2223 | } | 2194 | } |
2195 | |||
2196 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonManifestRegister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | ||
2197 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigurePerfmonManifestUnregister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); | ||
2224 | } | 2198 | } |
2225 | 2199 | ||
2226 | /// <summary> | 2200 | /// <summary> |
@@ -2263,23 +2237,15 @@ namespace WixToolset.Util | |||
2263 | 2237 | ||
2264 | if (!this.Messaging.EncounteredError) | 2238 | if (!this.Messaging.EncounteredError) |
2265 | { | 2239 | { |
2266 | switch (this.Context.Platform) | 2240 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedFormatFiles", this.Context.Platform, CustomActionPlatforms.X64 | CustomActionPlatforms.X86); |
2241 | |||
2242 | var tuple = new WixFormatFilesTuple(sourceLineNumbers) | ||
2267 | { | 2243 | { |
2268 | case Platform.X86: | 2244 | BinaryRef = binaryId, |
2269 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedFormatFiles"); | 2245 | FileRef = fileId, |
2270 | break; | 2246 | }; |
2271 | case Platform.X64: | ||
2272 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixSchedFormatFiles_x64"); | ||
2273 | break; | ||
2274 | case Platform.IA64: | ||
2275 | case Platform.ARM: | ||
2276 | this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), element.Name.LocalName)); | ||
2277 | break; | ||
2278 | } | ||
2279 | 2247 | ||
2280 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixFormatFiles"); | 2248 | section.Tuples.Add(tuple); |
2281 | row.Set(0, binaryId); | ||
2282 | row.Set(1, fileId); | ||
2283 | 2249 | ||
2284 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Binary", binaryId); | 2250 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Binary", binaryId); |
2285 | } | 2251 | } |
@@ -2328,71 +2294,62 @@ namespace WixToolset.Util | |||
2328 | 2294 | ||
2329 | if (!this.Messaging.EncounteredError) | 2295 | if (!this.Messaging.EncounteredError) |
2330 | { | 2296 | { |
2331 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "EventManifest"); | 2297 | var tuple = new EventManifestTuple(sourceLineNumbers) |
2332 | row.Set(0, componentId); | 2298 | { |
2333 | row.Set(1, $"[#{fileId}]"); | 2299 | ComponentRef = componentId, |
2300 | File = $"[#{fileId}]", | ||
2301 | }; | ||
2302 | |||
2303 | section.Tuples.Add(tuple); | ||
2334 | 2304 | ||
2335 | if (null != messageFile) | 2305 | if (null != messageFile) |
2336 | { | 2306 | { |
2337 | var messageRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); | 2307 | var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}MessageFile")) |
2338 | messageRow.Set(0, String.Concat("Config_", fileId, "MessageFile")); | 2308 | { |
2339 | messageRow.Set(1, $"[#{fileId}]"); | 2309 | File = $"[#{fileId}]", |
2340 | messageRow.Set(2, "/*/*/*/*[\\[]@messageFileName[\\]]"); | 2310 | ElementPath = "/*/*/*/*[\\[]@messageFileName[\\]]", |
2341 | messageRow.Set(3, "messageFileName"); | 2311 | Name = "messageFileName", |
2342 | messageRow.Set(4, messageFile); | 2312 | Value = messageFile, |
2343 | messageRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date | 2313 | Flags = 4 | 0x00001000, //bulk write | preserve modified date |
2344 | messageRow.Set(6, componentId); | 2314 | ComponentRef = componentId, |
2315 | }; | ||
2316 | section.Tuples.Add(xmlTuple); | ||
2345 | } | 2317 | } |
2346 | if (null != parameterFile) | 2318 | if (null != parameterFile) |
2347 | { | 2319 | { |
2348 | var resourceRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); | 2320 | var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}ParameterFile")) |
2349 | resourceRow.Set(0, String.Concat("Config_", fileId, "ParameterFile")); | 2321 | { |
2350 | resourceRow.Set(1, $"[#{fileId}]"); | 2322 | File = $"[#{fileId}]", |
2351 | resourceRow.Set(2, "/*/*/*/*[\\[]@parameterFileName[\\]]"); | 2323 | ElementPath = "/*/*/*/*[\\[]@parameterFileName[\\]]", |
2352 | resourceRow.Set(3, "parameterFileName"); | 2324 | Name = "parameterFileName", |
2353 | resourceRow.Set(4, parameterFile); | 2325 | Value = parameterFile, |
2354 | resourceRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date | 2326 | Flags = 4 | 0x00001000, //bulk write | preserve modified date |
2355 | resourceRow.Set(6, componentId); | 2327 | ComponentRef = componentId, |
2328 | }; | ||
2329 | section.Tuples.Add(xmlTuple); | ||
2356 | } | 2330 | } |
2357 | if (null != resourceFile) | 2331 | if (null != resourceFile) |
2358 | { | 2332 | { |
2359 | var resourceRow = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); | 2333 | var xmlTuple = new XmlFileTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, $"Config_{fileId}ResourceFile")) |
2360 | resourceRow.Set(0, String.Concat("Config_", fileId, "ResourceFile")); | 2334 | { |
2361 | resourceRow.Set(1, $"[#{fileId}]"); | 2335 | File = $"[#{fileId}]", |
2362 | resourceRow.Set(2, "/*/*/*/*[\\[]@resourceFileName[\\]]"); | 2336 | ElementPath = "/*/*/*/*[\\[]@resourceFileName[\\]]", |
2363 | resourceRow.Set(3, "resourceFileName"); | 2337 | Name = "resourceFileName", |
2364 | resourceRow.Set(4, resourceFile); | 2338 | Value = resourceFile, |
2365 | resourceRow.Set(5, 4 | 0x00001000); //bulk write | preserve modified date | 2339 | Flags = 4 | 0x00001000, //bulk write | preserve modified date |
2366 | resourceRow.Set(6, componentId); | 2340 | ComponentRef = componentId, |
2341 | }; | ||
2342 | section.Tuples.Add(xmlTuple); | ||
2367 | } | 2343 | } |
2368 | 2344 | ||
2369 | } | 2345 | } |
2370 | 2346 | ||
2371 | if (this.Context.Platform == Platform.ARM) | 2347 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureEventManifestRegister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
2372 | { | 2348 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureEventManifestUnregister", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
2373 | // Ensure ARM version of the CA is referenced | ||
2374 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestRegister_ARM"); | ||
2375 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestUnregister_ARM"); | ||
2376 | } | ||
2377 | else | ||
2378 | { | ||
2379 | // All other supported platforms use x86 | ||
2380 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestRegister"); | ||
2381 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureEventManifestUnregister"); | ||
2382 | } | ||
2383 | 2349 | ||
2384 | if (null != messageFile || null != parameterFile || null != resourceFile) | 2350 | if (null != messageFile || null != parameterFile || null != resourceFile) |
2385 | { | 2351 | { |
2386 | if (this.Context.Platform == Platform.ARM) | 2352 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
2387 | { | ||
2388 | // Ensure ARM version of the CA is referenced | ||
2389 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile_ARM"); | ||
2390 | } | ||
2391 | else | ||
2392 | { | ||
2393 | // All other supported platforms use x86 | ||
2394 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile"); | ||
2395 | } | ||
2396 | } | 2353 | } |
2397 | } | 2354 | } |
2398 | 2355 | ||
@@ -2493,36 +2450,18 @@ namespace WixToolset.Util | |||
2493 | 2450 | ||
2494 | if (!this.Messaging.EncounteredError) | 2451 | if (!this.Messaging.EncounteredError) |
2495 | { | 2452 | { |
2496 | if (win64) | 2453 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedSecureObjects", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X64 | CustomActionPlatforms.X86); |
2497 | { | 2454 | |
2498 | if (this.Context.Platform == Platform.IA64) | 2455 | var tuple = new SecureObjectsTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, objectId)) |
2499 | { | ||
2500 | this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, "ia64", element.Name.LocalName)); | ||
2501 | } | ||
2502 | else | ||
2503 | { | ||
2504 | // Ensure SchedSecureObjects (x64) is referenced | ||
2505 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects_x64"); | ||
2506 | } | ||
2507 | } | ||
2508 | else if (this.Context.Platform == Platform.ARM) | ||
2509 | { | ||
2510 | // Ensure SchedSecureObjects (arm) is referenced | ||
2511 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects_ARM"); | ||
2512 | } | ||
2513 | else | ||
2514 | { | 2456 | { |
2515 | // Ensure SchedSecureObjects (x86) is referenced, to handle this x86 component member | 2457 | Table = tableName, |
2516 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedSecureObjects"); | 2458 | Domain = domain, |
2517 | } | 2459 | User = user, |
2460 | Permission = permission, | ||
2461 | ComponentRef = componentId, | ||
2462 | }; | ||
2518 | 2463 | ||
2519 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "SecureObjects"); | 2464 | section.Tuples.Add(tuple); |
2520 | row.Set(0, objectId); | ||
2521 | row.Set(1, tableName); | ||
2522 | row.Set(2, domain); | ||
2523 | row.Set(3, user); | ||
2524 | row.Set(4, permission); | ||
2525 | row.Set(5, componentId); | ||
2526 | } | 2465 | } |
2527 | } | 2466 | } |
2528 | 2467 | ||
@@ -2881,13 +2820,18 @@ namespace WixToolset.Util | |||
2881 | 2820 | ||
2882 | if (!this.Messaging.EncounteredError) | 2821 | if (!this.Messaging.EncounteredError) |
2883 | { | 2822 | { |
2884 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixRemoveFolderEx", id); | 2823 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RemoveFoldersEx", this.Context.Platform, CustomActionPlatforms.X86); |
2885 | row.Set(1, componentId); | 2824 | |
2886 | row.Set(2, property); | 2825 | var tuple = new WixRemoveFolderExTuple(sourceLineNumbers) |
2887 | row.Set(3, on); | 2826 | { |
2827 | ComponentRef = componentId, | ||
2828 | Property = property, | ||
2829 | InstallMode = (int)on, | ||
2830 | }; | ||
2831 | |||
2832 | section.Tuples.Add(tuple); | ||
2888 | 2833 | ||
2889 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile"); | 2834 | this.ParseHelper.EnsureTable(section, sourceLineNumbers, "RemoveFile"); |
2890 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRemoveFoldersEx"); | ||
2891 | } | 2835 | } |
2892 | } | 2836 | } |
2893 | 2837 | ||
@@ -2954,22 +2898,16 @@ namespace WixToolset.Util | |||
2954 | 2898 | ||
2955 | if (!this.Messaging.EncounteredError) | 2899 | if (!this.Messaging.EncounteredError) |
2956 | { | 2900 | { |
2957 | // Add a reference to the WixRegisterRestartResources custom action since nothing will happen without it. | 2901 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "RegisterRestartResources", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
2958 | if (this.Context.Platform == Platform.ARM) | 2902 | |
2959 | { | 2903 | var tuple = new WixRestartResourceTuple(sourceLineNumbers) |
2960 | // Ensure ARM version of the CA is referenced | ||
2961 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources_ARM"); | ||
2962 | } | ||
2963 | else | ||
2964 | { | 2904 | { |
2965 | // All other supported platforms use x86 | 2905 | ComponentRef = componentId, |
2966 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixRegisterRestartResources"); | 2906 | Resource = resource, |
2967 | } | 2907 | Attributes = attributes, |
2908 | }; | ||
2968 | 2909 | ||
2969 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixRestartResource", id); | 2910 | section.Tuples.Add(tuple); |
2970 | row.Set(1, componentId); | ||
2971 | row.Set(2, resource); | ||
2972 | row.Set(3, attributes); | ||
2973 | } | 2911 | } |
2974 | } | 2912 | } |
2975 | 2913 | ||
@@ -3052,38 +2990,25 @@ namespace WixToolset.Util | |||
3052 | 2990 | ||
3053 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); | 2991 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element); |
3054 | 2992 | ||
3055 | // Reference SchedServiceConfig since nothing will happen without it | ||
3056 | if (this.Context.Platform == Platform.ARM) | ||
3057 | { | ||
3058 | // Ensure ARM version of the CA is referenced | ||
3059 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedServiceConfig_ARM"); | ||
3060 | } | ||
3061 | else | ||
3062 | { | ||
3063 | // All other supported platforms use x86 | ||
3064 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedServiceConfig"); | ||
3065 | } | ||
3066 | |||
3067 | if (!this.Messaging.EncounteredError) | 2993 | if (!this.Messaging.EncounteredError) |
3068 | { | 2994 | { |
3069 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "ServiceConfig"); | 2995 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedServiceConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
3070 | row.Set(0, serviceName); | ||
3071 | row.Set(1, componentId); | ||
3072 | row.Set(2, (newService ? 1 : 0)); | ||
3073 | row.Set(3, firstFailureActionType); | ||
3074 | row.Set(4, secondFailureActionType); | ||
3075 | row.Set(5, thirdFailureActionType); | ||
3076 | if (CompilerConstants.IntegerNotSet != resetPeriod) | ||
3077 | { | ||
3078 | row.Set(6, resetPeriod); | ||
3079 | } | ||
3080 | 2996 | ||
3081 | if (CompilerConstants.IntegerNotSet != restartServiceDelay) | 2997 | var tuple = new ServiceConfigTuple(sourceLineNumbers) |
3082 | { | 2998 | { |
3083 | row.Set(7, restartServiceDelay); | 2999 | ServiceName = serviceName, |
3084 | } | 3000 | ComponentRef = componentId, |
3085 | row.Set(8, programCommandLine); | 3001 | NewService = newService ? 1 : 0, |
3086 | row.Set(9, rebootMessage); | 3002 | FirstFailureActionType = firstFailureActionType, |
3003 | SecondFailureActionType = secondFailureActionType, | ||
3004 | ThirdFailureActionType = thirdFailureActionType, | ||
3005 | ResetPeriodInDays = resetPeriod, | ||
3006 | RestartServiceDelayInSeconds = restartServiceDelay, | ||
3007 | ProgramCommandLine = programCommandLine, | ||
3008 | RebootMessage = rebootMessage, | ||
3009 | }; | ||
3010 | |||
3011 | section.Tuples.Add(tuple); | ||
3087 | } | 3012 | } |
3088 | } | 3013 | } |
3089 | 3014 | ||
@@ -3166,12 +3091,16 @@ namespace WixToolset.Util | |||
3166 | 3091 | ||
3167 | if (!this.Messaging.EncounteredError) | 3092 | if (!this.Messaging.EncounteredError) |
3168 | { | 3093 | { |
3169 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "WixTouchFile", id); | 3094 | var tuple = new WixTouchFileTuple(sourceLineNumbers) |
3170 | row.Set(1, componentId); | 3095 | { |
3171 | row.Set(2, path); | 3096 | ComponentRef = componentId, |
3172 | row.Set(3, attributes); | 3097 | Path = path, |
3098 | Attributes = attributes, | ||
3099 | }; | ||
3100 | |||
3101 | section.Tuples.Add(tuple); | ||
3173 | 3102 | ||
3174 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "WixTouchFileDuringInstall"); | 3103 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "TouchFileDuringInstall", this.Context.Platform, CustomActionPlatforms.X86); |
3175 | } | 3104 | } |
3176 | } | 3105 | } |
3177 | 3106 | ||
@@ -3375,27 +3304,21 @@ namespace WixToolset.Util | |||
3375 | 3304 | ||
3376 | if (null != componentId) | 3305 | if (null != componentId) |
3377 | { | 3306 | { |
3378 | // Reference ConfigureIIs since nothing will happen without it | 3307 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "ConfigureUsers", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
3379 | if (this.Context.Platform == Platform.ARM) | ||
3380 | { | ||
3381 | // Ensure ARM version of the CA is referenced | ||
3382 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureUsers_ARM"); | ||
3383 | } | ||
3384 | else | ||
3385 | { | ||
3386 | // All other supported platforms use x86 | ||
3387 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "ConfigureUsers"); | ||
3388 | } | ||
3389 | } | 3308 | } |
3390 | 3309 | ||
3391 | if (!this.Messaging.EncounteredError) | 3310 | if (!this.Messaging.EncounteredError) |
3392 | { | 3311 | { |
3393 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "User", id); | 3312 | var tuple = new UserTuple(sourceLineNumbers, id) |
3394 | row.Set(1, componentId); | 3313 | { |
3395 | row.Set(2, name); | 3314 | ComponentRef = componentId, |
3396 | row.Set(3, domain); | 3315 | Name = name, |
3397 | row.Set(4, password); | 3316 | Domain = domain, |
3398 | row.Set(5, attributes); | 3317 | Password = password, |
3318 | Attributes = attributes, | ||
3319 | }; | ||
3320 | |||
3321 | section.Tuples.Add(tuple); | ||
3399 | } | 3322 | } |
3400 | } | 3323 | } |
3401 | 3324 | ||
@@ -3407,7 +3330,7 @@ namespace WixToolset.Util | |||
3407 | private void ParseXmlFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) | 3330 | private void ParseXmlFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId) |
3408 | { | 3331 | { |
3409 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 3332 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
3410 | string id = null; | 3333 | Identifier id = null; |
3411 | string file = null; | 3334 | string file = null; |
3412 | string elementPath = null; | 3335 | string elementPath = null; |
3413 | string name = null; | 3336 | string name = null; |
@@ -3458,7 +3381,7 @@ namespace WixToolset.Util | |||
3458 | } | 3381 | } |
3459 | break; | 3382 | break; |
3460 | case "Id": | 3383 | case "Id": |
3461 | id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3384 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); |
3462 | break; | 3385 | break; |
3463 | case "File": | 3386 | case "File": |
3464 | file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 3387 | file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
@@ -3522,31 +3445,23 @@ namespace WixToolset.Util | |||
3522 | 3445 | ||
3523 | if (!this.Messaging.EncounteredError) | 3446 | if (!this.Messaging.EncounteredError) |
3524 | { | 3447 | { |
3525 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlFile"); | 3448 | var tuple = new XmlFileTuple(sourceLineNumbers, id) |
3526 | row.Set(0, id); | 3449 | { |
3527 | row.Set(1, file); | 3450 | File = file, |
3528 | row.Set(2, elementPath); | 3451 | ElementPath = elementPath, |
3529 | row.Set(3, name); | 3452 | Name = name, |
3530 | row.Set(4, value); | 3453 | Value = value, |
3531 | row.Set(5, flags); | 3454 | Flags = flags, |
3532 | row.Set(6, componentId); | 3455 | ComponentRef = componentId, |
3456 | }; | ||
3533 | if (-1 != sequence) | 3457 | if (-1 != sequence) |
3534 | { | 3458 | { |
3535 | row.Set(7, sequence); | 3459 | tuple.Sequence = sequence; |
3536 | } | 3460 | } |
3461 | section.Tuples.Add(tuple); | ||
3537 | } | 3462 | } |
3538 | 3463 | ||
3539 | // Reference SchedXmlFile since nothing will happen without it | 3464 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlFile", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
3540 | if (this.Context.Platform == Platform.ARM) | ||
3541 | { | ||
3542 | // Ensure ARM version of the CA is referenced | ||
3543 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile_ARM"); | ||
3544 | } | ||
3545 | else | ||
3546 | { | ||
3547 | // All other supported platforms use x86 | ||
3548 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlFile"); | ||
3549 | } | ||
3550 | } | 3465 | } |
3551 | 3466 | ||
3552 | /// <summary> | 3467 | /// <summary> |
@@ -3558,7 +3473,7 @@ namespace WixToolset.Util | |||
3558 | private void ParseXmlConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool nested) | 3473 | private void ParseXmlConfigElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, bool nested) |
3559 | { | 3474 | { |
3560 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); | 3475 | SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element); |
3561 | string id = null; | 3476 | Identifier id = null; |
3562 | string elementId = null; | 3477 | string elementId = null; |
3563 | string elementPath = null; | 3478 | string elementPath = null; |
3564 | int flags = 0; | 3479 | int flags = 0; |
@@ -3575,7 +3490,7 @@ namespace WixToolset.Util | |||
3575 | switch (attrib.Name.LocalName) | 3490 | switch (attrib.Name.LocalName) |
3576 | { | 3491 | { |
3577 | case "Id": | 3492 | case "Id": |
3578 | id = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3493 | id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); |
3579 | break; | 3494 | break; |
3580 | case "Action": | 3495 | case "Action": |
3581 | if (nested) | 3496 | if (nested) |
@@ -3760,32 +3675,24 @@ namespace WixToolset.Util | |||
3760 | 3675 | ||
3761 | if (!this.Messaging.EncounteredError) | 3676 | if (!this.Messaging.EncounteredError) |
3762 | { | 3677 | { |
3763 | var row = this.ParseHelper.CreateTuple(section, sourceLineNumbers, "XmlConfig"); | 3678 | var tuple = new XmlConfigTuple(sourceLineNumbers, id) |
3764 | row.Set(0, id); | 3679 | { |
3765 | row.Set(1, file); | 3680 | File=file, |
3766 | row.Set(2, elementId ?? elementPath); | 3681 | ElementPath=elementId ??elementPath, |
3767 | row.Set(3, verifyPath); | 3682 | VerifyPath=verifyPath, |
3768 | row.Set(4, name); | 3683 | Name=name, |
3769 | row.Set(5, value); | 3684 | Value=value, |
3770 | row.Set(6, flags); | 3685 | Flags=flags, |
3771 | row.Set(7, componentId); | 3686 | ComponentRef=componentId, |
3687 | }; | ||
3772 | if (CompilerConstants.IntegerNotSet != sequence) | 3688 | if (CompilerConstants.IntegerNotSet != sequence) |
3773 | { | 3689 | { |
3774 | row.Set(8, sequence); | 3690 | tuple.Sequence = sequence; |
3775 | } | 3691 | } |
3692 | section.Tuples.Add(tuple); | ||
3776 | } | 3693 | } |
3777 | 3694 | ||
3778 | // Reference SchedXmlConfig since nothing will happen without it | 3695 | this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "SchedXmlConfig", this.Context.Platform, CustomActionPlatforms.ARM | CustomActionPlatforms.X86); |
3779 | if (this.Context.Platform == Platform.ARM) | ||
3780 | { | ||
3781 | // Ensure ARM version of the CA is referenced | ||
3782 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlConfig_ARM"); | ||
3783 | } | ||
3784 | else | ||
3785 | { | ||
3786 | // All other supported platforms use x86 | ||
3787 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "SchedXmlConfig"); | ||
3788 | } | ||
3789 | } | 3696 | } |
3790 | 3697 | ||
3791 | /// <summary> | 3698 | /// <summary> |