diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-11 21:49:09 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-12 12:46:21 +1000 |
| commit | 6d8b6f79b44b6a41a630aa3aad5a3c7f16701798 (patch) | |
| tree | b82ede9934cb7777a19e74a912c68481e76c21cd /src/WixToolset.Core/Compiler.cs | |
| parent | df69d4172d3117d8b66ba51fa5ae7f4be538700d (diff) | |
| download | wix-6d8b6f79b44b6a41a630aa3aad5a3c7f16701798.tar.gz wix-6d8b6f79b44b6a41a630aa3aad5a3c7f16701798.tar.bz2 wix-6d8b6f79b44b6a41a630aa3aad5a3c7f16701798.zip | |
General cleanup.
Try not to send strings to specify the tuple or table.
Try to avoid using the Set method on tuples.
Always create new tuples and add them to the section in the same line.
Diffstat (limited to 'src/WixToolset.Core/Compiler.cs')
| -rw-r--r-- | src/WixToolset.Core/Compiler.cs | 415 |
1 files changed, 168 insertions, 247 deletions
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 9db938e1..d4ad3279 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
| @@ -12,6 +12,7 @@ namespace WixToolset.Core | |||
| 12 | using System.Xml.Linq; | 12 | using System.Xml.Linq; |
| 13 | using WixToolset.Data; | 13 | using WixToolset.Data; |
| 14 | using WixToolset.Data.Tuples; | 14 | using WixToolset.Data.Tuples; |
| 15 | using WixToolset.Data.WindowsInstaller; | ||
| 15 | using WixToolset.Extensibility; | 16 | using WixToolset.Extensibility; |
| 16 | using WixToolset.Extensibility.Data; | 17 | using WixToolset.Extensibility.Data; |
| 17 | using WixToolset.Extensibility.Services; | 18 | using WixToolset.Extensibility.Services; |
| @@ -163,7 +164,7 @@ namespace WixToolset.Core | |||
| 163 | this.Core = null; | 164 | this.Core = null; |
| 164 | } | 165 | } |
| 165 | 166 | ||
| 166 | target.UpdateLevel(IntermediateLevels.Compiled); | 167 | target.UpdateLevel(Data.IntermediateLevels.Compiled); |
| 167 | 168 | ||
| 168 | return this.Messaging.EncounteredError ? null : target; | 169 | return this.Messaging.EncounteredError ? null : target; |
| 169 | } | 170 | } |
| @@ -324,13 +325,11 @@ namespace WixToolset.Core | |||
| 324 | this.Core.Write(ErrorMessages.SearchPropertyNotUppercase(sourceLineNumbers, "Property", "Id", propertyId.Id)); | 325 | this.Core.Write(ErrorMessages.SearchPropertyNotUppercase(sourceLineNumbers, "Property", "Id", propertyId.Id)); |
| 325 | } | 326 | } |
| 326 | 327 | ||
| 327 | var tuple = new AppSearchTuple(sourceLineNumbers, new Identifier(propertyId.Access, propertyId.Id, signature)) | 328 | this.Core.AddTuple(new AppSearchTuple(sourceLineNumbers, new Identifier(propertyId.Access, propertyId.Id, signature)) |
| 328 | { | 329 | { |
| 329 | PropertyRef = propertyId.Id, | 330 | PropertyRef = propertyId.Id, |
| 330 | SignatureRef = signature | 331 | SignatureRef = signature |
| 331 | }; | 332 | }); |
| 332 | |||
| 333 | this.Core.AddTuple(tuple); | ||
| 334 | } | 333 | } |
| 335 | } | 334 | } |
| 336 | 335 | ||
| @@ -371,7 +370,7 @@ namespace WixToolset.Core | |||
| 371 | { | 370 | { |
| 372 | var section = this.Core.ActiveSection; | 371 | var section = this.Core.ActiveSection; |
| 373 | 372 | ||
| 374 | // Add the row to a separate section if requested. | 373 | // Add the tuple to a separate section if requested. |
| 375 | if (fragment) | 374 | if (fragment) |
| 376 | { | 375 | { |
| 377 | var id = String.Concat(this.Core.ActiveSection.Id, ".", propertyId.Id); | 376 | var id = String.Concat(this.Core.ActiveSection.Id, ".", propertyId.Id); |
| @@ -379,26 +378,24 @@ namespace WixToolset.Core | |||
| 379 | section = this.Core.CreateSection(id, SectionType.Fragment, this.Core.ActiveSection.Codepage, this.Context.CompilationId); | 378 | section = this.Core.CreateSection(id, SectionType.Fragment, this.Core.ActiveSection.Codepage, this.Context.CompilationId); |
| 380 | 379 | ||
| 381 | // Reference the property in the active section. | 380 | // Reference the property in the active section. |
| 382 | this.Core.CreateSimpleReference(sourceLineNumbers, "Property", propertyId.Id); | 381 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Property, propertyId.Id); |
| 383 | } | 382 | } |
| 384 | 383 | ||
| 385 | // Allow row to exist with no value so that PropertyRefs can be made for *Search elements | 384 | // Allow tuple to exist with no value so that PropertyRefs can be made for *Search elements |
| 386 | // the linker will remove these rows before the final output is created. | 385 | // the linker will remove these tuples before the final output is created. |
| 387 | var tuple = new PropertyTuple(sourceLineNumbers, propertyId) | 386 | section.AddTuple(new PropertyTuple(sourceLineNumbers, propertyId) |
| 388 | { | 387 | { |
| 389 | Value = value, | 388 | Value = value, |
| 390 | }; | 389 | }); |
| 391 | |||
| 392 | section.Tuples.Add(tuple); | ||
| 393 | 390 | ||
| 394 | if (admin || hidden || secure) | 391 | if (admin || hidden || secure) |
| 395 | { | 392 | { |
| 396 | this.AddWixPropertyRow(sourceLineNumbers, propertyId, admin, secure, hidden, section); | 393 | this.AddWixPropertyTuple(sourceLineNumbers, propertyId, admin, secure, hidden, section); |
| 397 | } | 394 | } |
| 398 | } | 395 | } |
| 399 | } | 396 | } |
| 400 | 397 | ||
| 401 | private void AddWixPropertyRow(SourceLineNumber sourceLineNumbers, Identifier property, bool admin, bool secure, bool hidden, IntermediateSection section = null) | 398 | private void AddWixPropertyTuple(SourceLineNumber sourceLineNumbers, Identifier property, bool admin, bool secure, bool hidden, IntermediateSection section = null) |
| 402 | { | 399 | { |
| 403 | if (secure && property.Id != property.Id.ToUpperInvariant()) | 400 | if (secure && property.Id != property.Id.ToUpperInvariant()) |
| 404 | { | 401 | { |
| @@ -409,18 +406,16 @@ namespace WixToolset.Core | |||
| 409 | { | 406 | { |
| 410 | section = this.Core.ActiveSection; | 407 | section = this.Core.ActiveSection; |
| 411 | 408 | ||
| 412 | this.Core.EnsureTable(sourceLineNumbers, "Property"); // Property table is always required when using WixProperty table. | 409 | this.Core.EnsureTable(sourceLineNumbers, WindowsInstallerTableDefinitions.Property); // Property table is always required when using WixProperty table. |
| 413 | } | 410 | } |
| 414 | 411 | ||
| 415 | var tuple = new WixPropertyTuple(sourceLineNumbers) | 412 | section.AddTuple(new WixPropertyTuple(sourceLineNumbers) |
| 416 | { | 413 | { |
| 417 | PropertyRef = property.Id, | 414 | PropertyRef = property.Id, |
| 418 | Admin = admin, | 415 | Admin = admin, |
| 419 | Hidden = hidden, | 416 | Hidden = hidden, |
| 420 | Secure = secure | 417 | Secure = secure |
| 421 | }; | 418 | }); |
| 422 | |||
| 423 | section.Tuples.Add(tuple); | ||
| 424 | } | 419 | } |
| 425 | 420 | ||
| 426 | /// <summary> | 421 | /// <summary> |
| @@ -550,7 +545,7 @@ namespace WixToolset.Core | |||
| 550 | 545 | ||
| 551 | if (!this.Core.EncounteredError) | 546 | if (!this.Core.EncounteredError) |
| 552 | { | 547 | { |
| 553 | var tuple = new AppIdTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, appId)) | 548 | this.Core.AddTuple(new AppIdTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, appId)) |
| 554 | { | 549 | { |
| 555 | AppId = appId, | 550 | AppId = appId, |
| 556 | RemoteServerName = remoteServerName, | 551 | RemoteServerName = remoteServerName, |
| @@ -558,10 +553,8 @@ namespace WixToolset.Core | |||
| 558 | ServiceParameters = serviceParameters, | 553 | ServiceParameters = serviceParameters, |
| 559 | DllSurrogate = dllSurrogate, | 554 | DllSurrogate = dllSurrogate, |
| 560 | ActivateAtStorage = activateAtStorage, | 555 | ActivateAtStorage = activateAtStorage, |
| 561 | RunAsInteractiveUser = runAsInteractiveUser | 556 | RunAsInteractiveUser = runAsInteractiveUser, |
| 562 | }; | 557 | }); |
| 563 | |||
| 564 | this.Core.AddTuple(tuple); | ||
| 565 | } | 558 | } |
| 566 | } | 559 | } |
| 567 | else if (YesNoType.No == advertise) | 560 | else if (YesNoType.No == advertise) |
| @@ -650,14 +643,12 @@ namespace WixToolset.Core | |||
| 650 | 643 | ||
| 651 | if (!this.Core.EncounteredError) | 644 | if (!this.Core.EncounteredError) |
| 652 | { | 645 | { |
| 653 | var tuple = new MsiAssemblyNameTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, componentId, id)) | 646 | this.Core.AddTuple(new MsiAssemblyNameTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, componentId, id)) |
| 654 | { | 647 | { |
| 655 | ComponentRef = componentId, | 648 | ComponentRef = componentId, |
| 656 | Name = id, | 649 | Name = id, |
| 657 | Value = value | 650 | Value = value, |
| 658 | }; | 651 | }); |
| 659 | |||
| 660 | this.Core.AddTuple(tuple); | ||
| 661 | } | 652 | } |
| 662 | } | 653 | } |
| 663 | 654 | ||
| @@ -739,12 +730,10 @@ namespace WixToolset.Core | |||
| 739 | 730 | ||
| 740 | if (!this.Core.EncounteredError) | 731 | if (!this.Core.EncounteredError) |
| 741 | { | 732 | { |
| 742 | var tuple = new BinaryTuple(sourceLineNumbers, id) | 733 | var tuple = this.Core.AddTuple(new BinaryTuple(sourceLineNumbers, id) |
| 743 | { | 734 | { |
| 744 | Data = new IntermediateFieldPathValue { Path = sourceFile } | 735 | Data = new IntermediateFieldPathValue { Path = sourceFile } |
| 745 | }; | 736 | }); |
| 746 | |||
| 747 | this.Core.AddTuple(tuple); | ||
| 748 | 737 | ||
| 749 | if (YesNoType.Yes == suppressModularization) | 738 | if (YesNoType.Yes == suppressModularization) |
| 750 | { | 739 | { |
| @@ -820,7 +809,7 @@ namespace WixToolset.Core | |||
| 820 | { | 809 | { |
| 821 | this.Core.AddTuple(new IconTuple(sourceLineNumbers, id) | 810 | this.Core.AddTuple(new IconTuple(sourceLineNumbers, id) |
| 822 | { | 811 | { |
| 823 | Data = new IntermediateFieldPathValue { Path = sourceFile } | 812 | Data = new IntermediateFieldPathValue { Path = sourceFile }, |
| 824 | }); | 813 | }); |
| 825 | } | 814 | } |
| 826 | 815 | ||
| @@ -844,7 +833,7 @@ namespace WixToolset.Core | |||
| 844 | { | 833 | { |
| 845 | case "Property": | 834 | case "Property": |
| 846 | property = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 835 | property = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 847 | this.Core.CreateSimpleReference(sourceLineNumbers, "Property", property); | 836 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Property, property); |
| 848 | break; | 837 | break; |
| 849 | default: | 838 | default: |
| 850 | this.Core.UnexpectedAttribute(node, attrib); | 839 | this.Core.UnexpectedAttribute(node, attrib); |
| @@ -940,15 +929,13 @@ namespace WixToolset.Core | |||
| 940 | 929 | ||
| 941 | if (!this.Core.EncounteredError) | 930 | if (!this.Core.EncounteredError) |
| 942 | { | 931 | { |
| 943 | var tuple = new WixInstanceTransformsTuple(sourceLineNumbers, id) | 932 | this.Core.AddTuple(new WixInstanceTransformsTuple(sourceLineNumbers, id) |
| 944 | { | 933 | { |
| 945 | PropertyId = propertyId, | 934 | PropertyId = propertyId, |
| 946 | ProductCode = productCode, | 935 | ProductCode = productCode, |
| 947 | ProductName = productName, | 936 | ProductName = productName, |
| 948 | UpgradeCode = upgradeCode | 937 | UpgradeCode = upgradeCode |
| 949 | }; | 938 | }); |
| 950 | |||
| 951 | this.Core.AddTuple(tuple); | ||
| 952 | } | 939 | } |
| 953 | } | 940 | } |
| 954 | 941 | ||
| @@ -979,7 +966,7 @@ namespace WixToolset.Core | |||
| 979 | break; | 966 | break; |
| 980 | case "Feature": | 967 | case "Feature": |
| 981 | feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 968 | feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 982 | this.Core.CreateSimpleReference(sourceLineNumbers, "Feature", feature); | 969 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Feature, feature); |
| 983 | break; | 970 | break; |
| 984 | case "Qualifier": | 971 | case "Qualifier": |
| 985 | qualifier = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 972 | qualifier = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
| @@ -1009,16 +996,14 @@ namespace WixToolset.Core | |||
| 1009 | 996 | ||
| 1010 | if (!this.Core.EncounteredError) | 997 | if (!this.Core.EncounteredError) |
| 1011 | { | 998 | { |
| 1012 | var tuple = new PublishComponentTuple(sourceLineNumbers) | 999 | this.Core.AddTuple(new PublishComponentTuple(sourceLineNumbers) |
| 1013 | { | 1000 | { |
| 1014 | ComponentId = id, | 1001 | ComponentId = id, |
| 1015 | Qualifier = qualifier, | 1002 | Qualifier = qualifier, |
| 1016 | ComponentRef = componentId, | 1003 | ComponentRef = componentId, |
| 1017 | AppData = appData, | 1004 | AppData = appData, |
| 1018 | FeatureRef = feature ?? Guid.Empty.ToString("B"), | 1005 | FeatureRef = feature ?? Guid.Empty.ToString("B"), |
| 1019 | }; | 1006 | }); |
| 1020 | |||
| 1021 | this.Core.AddTuple(tuple); | ||
| 1022 | } | 1007 | } |
| 1023 | } | 1008 | } |
| 1024 | 1009 | ||
| @@ -1195,7 +1180,7 @@ namespace WixToolset.Core | |||
| 1195 | 1180 | ||
| 1196 | if (!String.IsNullOrEmpty(localFileServer)) | 1181 | if (!String.IsNullOrEmpty(localFileServer)) |
| 1197 | { | 1182 | { |
| 1198 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", localFileServer); | 1183 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, localFileServer); |
| 1199 | } | 1184 | } |
| 1200 | 1185 | ||
| 1201 | // Local variables used strictly for child node processing. | 1186 | // Local variables used strictly for child node processing. |
| @@ -1268,7 +1253,7 @@ namespace WixToolset.Core | |||
| 1268 | { | 1253 | { |
| 1269 | foreach (var context in contexts) | 1254 | foreach (var context in contexts) |
| 1270 | { | 1255 | { |
| 1271 | var tuple = new ClassTuple(sourceLineNumbers) | 1256 | var tuple = this.Core.AddTuple(new ClassTuple(sourceLineNumbers) |
| 1272 | { | 1257 | { |
| 1273 | CLSID = classId, | 1258 | CLSID = classId, |
| 1274 | Context = context, | 1259 | Context = context, |
| @@ -1280,26 +1265,24 @@ namespace WixToolset.Core | |||
| 1280 | Argument = argument, | 1265 | Argument = argument, |
| 1281 | FeatureRef = Guid.Empty.ToString("B"), | 1266 | FeatureRef = Guid.Empty.ToString("B"), |
| 1282 | RelativePath = YesNoType.Yes == relativePath, | 1267 | RelativePath = YesNoType.Yes == relativePath, |
| 1283 | }; | 1268 | }); |
| 1284 | 1269 | ||
| 1285 | if (null != appId) | 1270 | if (null != appId) |
| 1286 | { | 1271 | { |
| 1287 | tuple.AppIdRef = appId; | 1272 | tuple.AppIdRef = appId; |
| 1288 | this.Core.CreateSimpleReference(sourceLineNumbers, "AppId", appId); | 1273 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.AppId, appId); |
| 1289 | } | 1274 | } |
| 1290 | 1275 | ||
| 1291 | if (null != icon) | 1276 | if (null != icon) |
| 1292 | { | 1277 | { |
| 1293 | tuple.IconRef = icon; | 1278 | tuple.IconRef = icon; |
| 1294 | this.Core.CreateSimpleReference(sourceLineNumbers, "Icon", icon); | 1279 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Icon, icon); |
| 1295 | } | 1280 | } |
| 1296 | 1281 | ||
| 1297 | if (CompilerConstants.IntegerNotSet != iconIndex) | 1282 | if (CompilerConstants.IntegerNotSet != iconIndex) |
| 1298 | { | 1283 | { |
| 1299 | tuple.IconIndex = iconIndex; | 1284 | tuple.IconIndex = iconIndex; |
| 1300 | } | 1285 | } |
| 1301 | |||
| 1302 | this.Core.AddTuple(tuple); | ||
| 1303 | } | 1286 | } |
| 1304 | } | 1287 | } |
| 1305 | } | 1288 | } |
| @@ -1379,7 +1362,7 @@ namespace WixToolset.Core | |||
| 1379 | 1362 | ||
| 1380 | if (null != icon) // ClassId default icon | 1363 | if (null != icon) // ClassId default icon |
| 1381 | { | 1364 | { |
| 1382 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", icon); | 1365 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, icon); |
| 1383 | 1366 | ||
| 1384 | icon = String.Format(CultureInfo.InvariantCulture, "\"[#{0}]\"", icon); | 1367 | icon = String.Format(CultureInfo.InvariantCulture, "\"[#{0}]\"", icon); |
| 1385 | 1368 | ||
| @@ -1709,7 +1692,7 @@ namespace WixToolset.Core | |||
| 1709 | 1692 | ||
| 1710 | if (!this.Core.EncounteredError) | 1693 | if (!this.Core.EncounteredError) |
| 1711 | { | 1694 | { |
| 1712 | var tuple = new UpgradeTuple(sourceLineNumbers) | 1695 | this.Core.AddTuple(new UpgradeTuple(sourceLineNumbers) |
| 1713 | { | 1696 | { |
| 1714 | UpgradeCode = upgradeCode, | 1697 | UpgradeCode = upgradeCode, |
| 1715 | VersionMin = minimum, | 1698 | VersionMin = minimum, |
| @@ -1720,9 +1703,7 @@ namespace WixToolset.Core | |||
| 1720 | ExcludeLanguages = excludeLanguages, | 1703 | ExcludeLanguages = excludeLanguages, |
| 1721 | VersionMaxInclusive = maxInclusive, | 1704 | VersionMaxInclusive = maxInclusive, |
| 1722 | VersionMinInclusive = minInclusive, | 1705 | VersionMinInclusive = minInclusive, |
| 1723 | }; | 1706 | }); |
| 1724 | |||
| 1725 | this.Core.AddTuple(tuple); | ||
| 1726 | } | 1707 | } |
| 1727 | } | 1708 | } |
| 1728 | 1709 | ||
| @@ -1862,7 +1843,7 @@ namespace WixToolset.Core | |||
| 1862 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); | 1843 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); |
| 1863 | } | 1844 | } |
| 1864 | oneChild = true; | 1845 | oneChild = true; |
| 1865 | var newId = this.ParseSimpleRefElement(child, "Signature"); // FileSearch signatures override parent signatures | 1846 | var newId = this.ParseSimpleRefElement(child, TupleDefinitions.Signature); // FileSearch signatures override parent signatures |
| 1866 | id = new Identifier(AccessModifier.Private, newId); | 1847 | id = new Identifier(AccessModifier.Private, newId); |
| 1867 | signature = null; | 1848 | signature = null; |
| 1868 | break; | 1849 | break; |
| @@ -1879,16 +1860,14 @@ namespace WixToolset.Core | |||
| 1879 | 1860 | ||
| 1880 | if (!this.Core.EncounteredError) | 1861 | if (!this.Core.EncounteredError) |
| 1881 | { | 1862 | { |
| 1882 | var tuple = new RegLocatorTuple(sourceLineNumbers, id) | 1863 | this.Core.AddTuple(new RegLocatorTuple(sourceLineNumbers, id) |
| 1883 | { | 1864 | { |
| 1884 | Root = root.Value, | 1865 | Root = root.Value, |
| 1885 | Key = key, | 1866 | Key = key, |
| 1886 | Name = name, | 1867 | Name = name, |
| 1887 | Type = type.Value, | 1868 | Type = type.Value, |
| 1888 | Win64 = search64bit | 1869 | Win64 = search64bit, |
| 1889 | }; | 1870 | }); |
| 1890 | |||
| 1891 | this.Core.AddTuple(tuple); | ||
| 1892 | } | 1871 | } |
| 1893 | 1872 | ||
| 1894 | return signature; | 1873 | return signature; |
| @@ -1912,7 +1891,7 @@ namespace WixToolset.Core | |||
| 1912 | { | 1891 | { |
| 1913 | case "Id": | 1892 | case "Id": |
| 1914 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1893 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 1915 | this.Core.CreateSimpleReference(sourceLineNumbers, "RegLocator", id); | 1894 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.RegLocator, id); |
| 1916 | break; | 1895 | break; |
| 1917 | default: | 1896 | default: |
| 1918 | this.Core.UnexpectedAttribute(node, attrib); | 1897 | this.Core.UnexpectedAttribute(node, attrib); |
| @@ -2524,7 +2503,7 @@ namespace WixToolset.Core | |||
| 2524 | // finally add the Component table row | 2503 | // finally add the Component table row |
| 2525 | if (!this.Core.EncounteredError) | 2504 | if (!this.Core.EncounteredError) |
| 2526 | { | 2505 | { |
| 2527 | var tuple = new ComponentTuple(sourceLineNumbers, id) | 2506 | this.Core.AddTuple(new ComponentTuple(sourceLineNumbers, id) |
| 2528 | { | 2507 | { |
| 2529 | ComponentId = guid, | 2508 | ComponentId = guid, |
| 2530 | DirectoryRef = directoryId, | 2509 | DirectoryRef = directoryId, |
| @@ -2539,10 +2518,8 @@ namespace WixToolset.Core | |||
| 2539 | Shared = shared, | 2518 | Shared = shared, |
| 2540 | Transitive = transitive, | 2519 | Transitive = transitive, |
| 2541 | UninstallWhenSuperseded = uninstallWhenSuperseded, | 2520 | UninstallWhenSuperseded = uninstallWhenSuperseded, |
| 2542 | Win64 = win64 | 2521 | Win64 = win64, |
| 2543 | }; | 2522 | }); |
| 2544 | |||
| 2545 | this.Core.AddTuple(tuple); | ||
| 2546 | 2523 | ||
| 2547 | if (multiInstance) | 2524 | if (multiInstance) |
| 2548 | { | 2525 | { |
| @@ -2554,26 +2531,22 @@ namespace WixToolset.Core | |||
| 2554 | 2531 | ||
| 2555 | if (0 < symbols.Count) | 2532 | if (0 < symbols.Count) |
| 2556 | { | 2533 | { |
| 2557 | var tupleDelaPatch = new WixDeltaPatchSymbolPathsTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, SymbolPathType.Component, id.Id)) | 2534 | this.Core.AddTuple(new WixDeltaPatchSymbolPathsTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, SymbolPathType.Component, id.Id)) |
| 2558 | { | 2535 | { |
| 2559 | SymbolType = SymbolPathType.Component, | 2536 | SymbolType = SymbolPathType.Component, |
| 2560 | SymbolId = id.Id, | 2537 | SymbolId = id.Id, |
| 2561 | SymbolPaths = String.Join(";", symbols) | 2538 | SymbolPaths = String.Join(";", symbols), |
| 2562 | }; | 2539 | }); |
| 2563 | |||
| 2564 | this.Core.AddTuple(tupleDelaPatch); | ||
| 2565 | } | 2540 | } |
| 2566 | 2541 | ||
| 2567 | // Complus | 2542 | // Complus |
| 2568 | if (CompilerConstants.IntegerNotSet != comPlusBits) | 2543 | if (CompilerConstants.IntegerNotSet != comPlusBits) |
| 2569 | { | 2544 | { |
| 2570 | var complusTuple = new ComplusTuple(sourceLineNumbers) | 2545 | this.Core.AddTuple(new ComplusTuple(sourceLineNumbers) |
| 2571 | { | 2546 | { |
| 2572 | ComponentRef = id.Id, | 2547 | ComponentRef = id.Id, |
| 2573 | ExpType = comPlusBits, | 2548 | ExpType = comPlusBits, |
| 2574 | }; | 2549 | }); |
| 2575 | |||
| 2576 | this.Core.AddTuple(complusTuple); | ||
| 2577 | } | 2550 | } |
| 2578 | 2551 | ||
| 2579 | // if this is a module, automatically add this component to the references to ensure it gets in the ModuleComponents table | 2552 | // if this is a module, automatically add this component to the references to ensure it gets in the ModuleComponents table |
| @@ -2698,7 +2671,7 @@ namespace WixToolset.Core | |||
| 2698 | { | 2671 | { |
| 2699 | case "Id": | 2672 | case "Id": |
| 2700 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 2673 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 2701 | this.Core.CreateSimpleReference(sourceLineNumbers, "WixComponentGroup", id); | 2674 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.WixComponentGroup, id); |
| 2702 | break; | 2675 | break; |
| 2703 | case "Primary": | 2676 | case "Primary": |
| 2704 | primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 2677 | primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| @@ -2747,7 +2720,7 @@ namespace WixToolset.Core | |||
| 2747 | { | 2720 | { |
| 2748 | case "Id": | 2721 | case "Id": |
| 2749 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 2722 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 2750 | this.Core.CreateSimpleReference(sourceLineNumbers, "Component", id); | 2723 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Component, id); |
| 2751 | break; | 2724 | break; |
| 2752 | case "Primary": | 2725 | case "Primary": |
| 2753 | primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 2726 | primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| @@ -2871,7 +2844,7 @@ namespace WixToolset.Core | |||
| 2871 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); | 2844 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); |
| 2872 | } | 2845 | } |
| 2873 | oneChild = true; | 2846 | oneChild = true; |
| 2874 | var newId = this.ParseSimpleRefElement(child, "Signature"); // FileSearch signatures override parent signatures | 2847 | var newId = this.ParseSimpleRefElement(child, TupleDefinitions.Signature); // FileSearch signatures override parent signatures |
| 2875 | id = new Identifier(AccessModifier.Private, newId); | 2848 | id = new Identifier(AccessModifier.Private, newId); |
| 2876 | signature = null; | 2849 | signature = null; |
| 2877 | break; | 2850 | break; |
| @@ -2888,18 +2861,12 @@ namespace WixToolset.Core | |||
| 2888 | 2861 | ||
| 2889 | if (!this.Core.EncounteredError) | 2862 | if (!this.Core.EncounteredError) |
| 2890 | { | 2863 | { |
| 2891 | var tuple = new CompLocatorTuple(sourceLineNumbers, id) | 2864 | this.Core.AddTuple(new CompLocatorTuple(sourceLineNumbers, id) |
| 2892 | { | 2865 | { |
| 2893 | SignatureRef = id.Id, | 2866 | SignatureRef = id.Id, |
| 2894 | ComponentId = componentId, | 2867 | ComponentId = componentId, |
| 2895 | Type = type, | 2868 | Type = type, |
| 2896 | }; | 2869 | }); |
| 2897 | |||
| 2898 | this.Core.AddTuple(tuple); | ||
| 2899 | |||
| 2900 | //var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.CompLocator, id); | ||
| 2901 | //row.Set(1, componentId); | ||
| 2902 | //row.Set(2, type); | ||
| 2903 | } | 2870 | } |
| 2904 | 2871 | ||
| 2905 | return signature; | 2872 | return signature; |
| @@ -2965,13 +2932,11 @@ namespace WixToolset.Core | |||
| 2965 | 2932 | ||
| 2966 | if (!this.Core.EncounteredError) | 2933 | if (!this.Core.EncounteredError) |
| 2967 | { | 2934 | { |
| 2968 | var tuple = new CreateFolderTuple(sourceLineNumbers) | 2935 | this.Core.AddTuple(new CreateFolderTuple(sourceLineNumbers) |
| 2969 | { | 2936 | { |
| 2970 | DirectoryRef = directoryId, | 2937 | DirectoryRef = directoryId, |
| 2971 | ComponentRef = componentId | 2938 | ComponentRef = componentId, |
| 2972 | }; | 2939 | }); |
| 2973 | |||
| 2974 | this.Core.AddTuple(tuple); | ||
| 2975 | } | 2940 | } |
| 2976 | 2941 | ||
| 2977 | return directoryId; | 2942 | return directoryId; |
| @@ -3027,7 +2992,7 @@ namespace WixToolset.Core | |||
| 3027 | this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); | 2992 | this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); |
| 3028 | } | 2993 | } |
| 3029 | fileId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 2994 | fileId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 3030 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", fileId); | 2995 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, fileId); |
| 3031 | break; | 2996 | break; |
| 3032 | case "SourceDirectory": | 2997 | case "SourceDirectory": |
| 3033 | sourceDirectory = this.Core.CreateDirectoryReferenceFromInlineSyntax(sourceLineNumbers, attrib, null); | 2998 | sourceDirectory = this.Core.CreateDirectoryReferenceFromInlineSyntax(sourceLineNumbers, attrib, null); |
| @@ -3092,17 +3057,15 @@ namespace WixToolset.Core | |||
| 3092 | 3057 | ||
| 3093 | if (!this.Core.EncounteredError) | 3058 | if (!this.Core.EncounteredError) |
| 3094 | { | 3059 | { |
| 3095 | var tuple = new MoveFileTuple(sourceLineNumbers, id) | 3060 | this.Core.AddTuple(new MoveFileTuple(sourceLineNumbers, id) |
| 3096 | { | 3061 | { |
| 3097 | ComponentRef = componentId, | 3062 | ComponentRef = componentId, |
| 3098 | SourceName = sourceName, | 3063 | SourceName = sourceName, |
| 3099 | DestName= String.IsNullOrEmpty(destinationShortName) && String.IsNullOrEmpty(destinationName) ? null : this.GetMsiFilenameValue(destinationShortName, destinationName), | 3064 | DestName= String.IsNullOrEmpty(destinationShortName) && String.IsNullOrEmpty(destinationName) ? null : this.GetMsiFilenameValue(destinationShortName, destinationName), |
| 3100 | SourceFolder = sourceDirectory ?? sourceProperty, | 3065 | SourceFolder = sourceDirectory ?? sourceProperty, |
| 3101 | DestFolder = destinationDirectory ?? destinationProperty, | 3066 | DestFolder = destinationDirectory ?? destinationProperty, |
| 3102 | Delete = delete | 3067 | Delete = delete, |
| 3103 | }; | 3068 | }); |
| 3104 | |||
| 3105 | this.Core.AddTuple(tuple); | ||
| 3106 | } | 3069 | } |
| 3107 | } | 3070 | } |
| 3108 | else // copy the file | 3071 | else // copy the file |
| @@ -3139,15 +3102,13 @@ namespace WixToolset.Core | |||
| 3139 | 3102 | ||
| 3140 | if (!this.Core.EncounteredError) | 3103 | if (!this.Core.EncounteredError) |
| 3141 | { | 3104 | { |
| 3142 | var tuple = new DuplicateFileTuple(sourceLineNumbers, id) | 3105 | this.Core.AddTuple(new DuplicateFileTuple(sourceLineNumbers, id) |
| 3143 | { | 3106 | { |
| 3144 | ComponentRef = componentId, | 3107 | ComponentRef = componentId, |
| 3145 | FileRef = fileId, | 3108 | FileRef = fileId, |
| 3146 | DestinationName = String.IsNullOrEmpty(destinationShortName) && String.IsNullOrEmpty(destinationName) ? null : this.GetMsiFilenameValue(destinationShortName, destinationName), | 3109 | DestinationName = String.IsNullOrEmpty(destinationShortName) && String.IsNullOrEmpty(destinationName) ? null : this.GetMsiFilenameValue(destinationShortName, destinationName), |
| 3147 | DestinationFolder = destinationDirectory ?? destinationProperty | 3110 | DestinationFolder = destinationDirectory ?? destinationProperty, |
| 3148 | }; | 3111 | }); |
| 3149 | |||
| 3150 | this.Core.AddTuple(tuple); | ||
| 3151 | } | 3112 | } |
| 3152 | } | 3113 | } |
| 3153 | } | 3114 | } |
| @@ -3194,7 +3155,7 @@ namespace WixToolset.Core | |||
| 3194 | source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3155 | source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 3195 | //sourceBits = MsiInterop.MsidbCustomActionTypeBinaryData; | 3156 | //sourceBits = MsiInterop.MsidbCustomActionTypeBinaryData; |
| 3196 | sourceType = CustomActionSourceType.Binary; | 3157 | sourceType = CustomActionSourceType.Binary; |
| 3197 | this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", source); // add a reference to the appropriate Binary | 3158 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Binary, source); // add a reference to the appropriate Binary |
| 3198 | break; | 3159 | break; |
| 3199 | case "Directory": | 3160 | case "Directory": |
| 3200 | if (null != source) | 3161 | if (null != source) |
| @@ -3229,7 +3190,7 @@ namespace WixToolset.Core | |||
| 3229 | // to add a reference. No need to look at the value. | 3190 | // to add a reference. No need to look at the value. |
| 3230 | if (Int32.TryParse(target, out var ignored)) | 3191 | if (Int32.TryParse(target, out var ignored)) |
| 3231 | { | 3192 | { |
| 3232 | this.Core.CreateSimpleReference(sourceLineNumbers, "Error", target); | 3193 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Error, target); |
| 3233 | } | 3194 | } |
| 3234 | break; | 3195 | break; |
| 3235 | case "ExeCommand": | 3196 | case "ExeCommand": |
| @@ -3285,7 +3246,7 @@ namespace WixToolset.Core | |||
| 3285 | source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3246 | source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 3286 | //sourceBits = MsiInterop.MsidbCustomActionTypeSourceFile; | 3247 | //sourceBits = MsiInterop.MsidbCustomActionTypeSourceFile; |
| 3287 | sourceType = CustomActionSourceType.File; | 3248 | sourceType = CustomActionSourceType.File; |
| 3288 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", source); // add a reference to the appropriate File | 3249 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, source); // add a reference to the appropriate File |
| 3289 | break; | 3250 | break; |
| 3290 | case "HideTarget": | 3251 | case "HideTarget": |
| 3291 | hidden = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 3252 | hidden = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| @@ -3533,7 +3494,7 @@ namespace WixToolset.Core | |||
| 3533 | 3494 | ||
| 3534 | if (!this.Core.EncounteredError) | 3495 | if (!this.Core.EncounteredError) |
| 3535 | { | 3496 | { |
| 3536 | var tuple = new CustomActionTuple(sourceLineNumbers, id) | 3497 | this.Core.AddTuple(new CustomActionTuple(sourceLineNumbers, id) |
| 3537 | { | 3498 | { |
| 3538 | ExecutionType = executionType, | 3499 | ExecutionType = executionType, |
| 3539 | Source = source, | 3500 | Source = source, |
| @@ -3547,9 +3508,7 @@ namespace WixToolset.Core | |||
| 3547 | TSAware = tsAware, | 3508 | TSAware = tsAware, |
| 3548 | Win64 = win64, | 3509 | Win64 = win64, |
| 3549 | Hidden = hidden, | 3510 | Hidden = hidden, |
| 3550 | }; | 3511 | }); |
| 3551 | |||
| 3552 | this.Core.AddTuple(tuple); | ||
| 3553 | 3512 | ||
| 3554 | if (YesNoType.Yes == suppressModularization) | 3513 | if (YesNoType.Yes == suppressModularization) |
| 3555 | { | 3514 | { |
| @@ -3562,9 +3521,9 @@ namespace WixToolset.Core | |||
| 3562 | /// Parses a simple reference element. | 3521 | /// Parses a simple reference element. |
| 3563 | /// </summary> | 3522 | /// </summary> |
| 3564 | /// <param name="node">Element to parse.</param> | 3523 | /// <param name="node">Element to parse.</param> |
| 3565 | /// <param name="table">Table which contains the target of the simple reference.</param> | 3524 | /// <param name="tupleDefinition">Tuple which contains the target of the simple reference.</param> |
| 3566 | /// <returns>Id of the referenced element.</returns> | 3525 | /// <returns>Id of the referenced element.</returns> |
| 3567 | private string ParseSimpleRefElement(XElement node, string table) | 3526 | private string ParseSimpleRefElement(XElement node, IntermediateTupleDefinition tupleDefinition) |
| 3568 | { | 3527 | { |
| 3569 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | 3528 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); |
| 3570 | string id = null; | 3529 | string id = null; |
| @@ -3577,7 +3536,7 @@ namespace WixToolset.Core | |||
| 3577 | { | 3536 | { |
| 3578 | case "Id": | 3537 | case "Id": |
| 3579 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3538 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 3580 | this.Core.CreateSimpleReference(sourceLineNumbers, table, id); | 3539 | this.Core.CreateSimpleReference(sourceLineNumbers, tupleDefinition.Name, id); |
| 3581 | break; | 3540 | break; |
| 3582 | default: | 3541 | default: |
| 3583 | this.Core.UnexpectedAttribute(node, attrib); | 3542 | this.Core.UnexpectedAttribute(node, attrib); |
| @@ -3640,7 +3599,7 @@ namespace WixToolset.Core | |||
| 3640 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | 3599 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); |
| 3641 | } | 3600 | } |
| 3642 | 3601 | ||
| 3643 | this.Core.CreateSimpleReference(sourceLineNumbers, "MsiPatchSequence", primaryKeys); | 3602 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.MsiPatchSequence, primaryKeys); |
| 3644 | 3603 | ||
| 3645 | this.Core.ParseForExtensionElements(node); | 3604 | this.Core.ParseForExtensionElements(node); |
| 3646 | 3605 | ||
| @@ -3932,14 +3891,14 @@ namespace WixToolset.Core | |||
| 3932 | } | 3891 | } |
| 3933 | } | 3892 | } |
| 3934 | 3893 | ||
| 3935 | this.Core.CreateSimpleReference(sourceLineNumbers, "WixCustomTable", tableId); | 3894 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.WixCustomTable, tableId); |
| 3936 | 3895 | ||
| 3937 | if (!this.Core.EncounteredError) | 3896 | if (!this.Core.EncounteredError) |
| 3938 | { | 3897 | { |
| 3939 | this.Core.AddTuple(new WixCustomRowTuple(childSourceLineNumbers) | 3898 | this.Core.AddTuple(new WixCustomRowTuple(childSourceLineNumbers) |
| 3940 | { | 3899 | { |
| 3941 | Table = tableId, | 3900 | Table = tableId, |
| 3942 | FieldData = dataValue | 3901 | FieldData = dataValue, |
| 3943 | }); | 3902 | }); |
| 3944 | } | 3903 | } |
| 3945 | break; | 3904 | break; |
| @@ -3963,7 +3922,7 @@ namespace WixToolset.Core | |||
| 3963 | 3922 | ||
| 3964 | if (!this.Core.EncounteredError) | 3923 | if (!this.Core.EncounteredError) |
| 3965 | { | 3924 | { |
| 3966 | var tuple = new WixCustomTableTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, tableId)) | 3925 | this.Core.AddTuple(new WixCustomTableTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, tableId)) |
| 3967 | { | 3926 | { |
| 3968 | ColumnCount = columnCount, | 3927 | ColumnCount = columnCount, |
| 3969 | ColumnNames = columnNames, | 3928 | ColumnNames = columnNames, |
| @@ -3977,10 +3936,8 @@ namespace WixToolset.Core | |||
| 3977 | Sets = sets, | 3936 | Sets = sets, |
| 3978 | Descriptions = descriptions, | 3937 | Descriptions = descriptions, |
| 3979 | Modularizations = modularizations, | 3938 | Modularizations = modularizations, |
| 3980 | Unreal = bootstrapperApplicationData | 3939 | Unreal = bootstrapperApplicationData, |
| 3981 | }; | 3940 | }); |
| 3982 | |||
| 3983 | this.Core.AddTuple(tuple); | ||
| 3984 | } | 3941 | } |
| 3985 | } | 3942 | } |
| 3986 | } | 3943 | } |
| @@ -4079,7 +4036,7 @@ namespace WixToolset.Core | |||
| 4079 | if (inlineSyntax[0].EndsWith(":")) | 4036 | if (inlineSyntax[0].EndsWith(":")) |
| 4080 | { | 4037 | { |
| 4081 | parentId = inlineSyntax[0].TrimEnd(':'); | 4038 | parentId = inlineSyntax[0].TrimEnd(':'); |
| 4082 | this.Core.CreateSimpleReference(sourceLineNumbers, "Directory", parentId); | 4039 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Directory, parentId); |
| 4083 | 4040 | ||
| 4084 | pathStartsAt = 1; | 4041 | pathStartsAt = 1; |
| 4085 | } | 4042 | } |
| @@ -4224,7 +4181,7 @@ namespace WixToolset.Core | |||
| 4224 | 4181 | ||
| 4225 | if (!this.Core.EncounteredError) | 4182 | if (!this.Core.EncounteredError) |
| 4226 | { | 4183 | { |
| 4227 | var tuple = new DirectoryTuple(sourceLineNumbers, id) | 4184 | this.Core.AddTuple(new DirectoryTuple(sourceLineNumbers, id) |
| 4228 | { | 4185 | { |
| 4229 | ParentDirectoryRef = parentId, | 4186 | ParentDirectoryRef = parentId, |
| 4230 | Name = name, | 4187 | Name = name, |
| @@ -4232,9 +4189,7 @@ namespace WixToolset.Core | |||
| 4232 | SourceName = sourceName, | 4189 | SourceName = sourceName, |
| 4233 | SourceShortName = shortSourceName, | 4190 | SourceShortName = shortSourceName, |
| 4234 | ComponentGuidGenerationSeed = componentGuidGenerationSeed | 4191 | ComponentGuidGenerationSeed = componentGuidGenerationSeed |
| 4235 | }; | 4192 | }); |
| 4236 | |||
| 4237 | this.Core.AddTuple(tuple); | ||
| 4238 | 4193 | ||
| 4239 | if (null != symbols) | 4194 | if (null != symbols) |
| 4240 | { | 4195 | { |
| @@ -4268,7 +4223,7 @@ namespace WixToolset.Core | |||
| 4268 | { | 4223 | { |
| 4269 | case "Id": | 4224 | case "Id": |
| 4270 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 4225 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 4271 | this.Core.CreateSimpleReference(sourceLineNumbers, "Directory", id); | 4226 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Directory, id); |
| 4272 | break; | 4227 | break; |
| 4273 | case "DiskId": | 4228 | case "DiskId": |
| 4274 | diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); | 4229 | diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); |
| @@ -4415,7 +4370,7 @@ namespace WixToolset.Core | |||
| 4415 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); | 4370 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); |
| 4416 | } | 4371 | } |
| 4417 | oneChild = true; | 4372 | oneChild = true; |
| 4418 | signature = this.ParseSimpleRefElement(child, "Signature"); | 4373 | signature = this.ParseSimpleRefElement(child, TupleDefinitions.Signature); |
| 4419 | break; | 4374 | break; |
| 4420 | default: | 4375 | default: |
| 4421 | this.Core.UnexpectedElement(node, child); | 4376 | this.Core.UnexpectedElement(node, child); |
| @@ -4460,19 +4415,17 @@ namespace WixToolset.Core | |||
| 4460 | signature = id.Id; | 4415 | signature = id.Id; |
| 4461 | } | 4416 | } |
| 4462 | 4417 | ||
| 4463 | var tuple = new DrLocatorTuple(sourceLineNumbers, new Identifier(access, rowId, parentSignature, path)) | 4418 | var tuple = this.Core.AddTuple(new DrLocatorTuple(sourceLineNumbers, new Identifier(access, rowId, parentSignature, path)) |
| 4464 | { | 4419 | { |
| 4465 | SignatureRef = rowId, | 4420 | SignatureRef = rowId, |
| 4466 | Parent = parentSignature, | 4421 | Parent = parentSignature, |
| 4467 | Path = path, | 4422 | Path = path, |
| 4468 | }; | 4423 | }); |
| 4469 | 4424 | ||
| 4470 | if (CompilerConstants.IntegerNotSet != depth) | 4425 | if (CompilerConstants.IntegerNotSet != depth) |
| 4471 | { | 4426 | { |
| 4472 | tuple.Depth = depth; | 4427 | tuple.Depth = depth; |
| 4473 | } | 4428 | } |
| 4474 | |||
| 4475 | this.Core.AddTuple(tuple); | ||
| 4476 | } | 4429 | } |
| 4477 | 4430 | ||
| 4478 | return signature; | 4431 | return signature; |
| @@ -4575,7 +4528,7 @@ namespace WixToolset.Core | |||
| 4575 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); | 4528 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); |
| 4576 | } | 4529 | } |
| 4577 | oneChild = true; | 4530 | oneChild = true; |
| 4578 | signature = this.ParseSimpleRefElement(child, "Signature"); | 4531 | signature = this.ParseSimpleRefElement(child, TupleDefinitions.Signature); |
| 4579 | break; | 4532 | break; |
| 4580 | default: | 4533 | default: |
| 4581 | this.Core.UnexpectedElement(node, child); | 4534 | this.Core.UnexpectedElement(node, child); |
| @@ -4589,7 +4542,7 @@ namespace WixToolset.Core | |||
| 4589 | } | 4542 | } |
| 4590 | 4543 | ||
| 4591 | 4544 | ||
| 4592 | this.Core.CreateSimpleReference(sourceLineNumbers, "DrLocator", id.Id, parentSignature, path); | 4545 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.DrLocator, id.Id, parentSignature, path); |
| 4593 | 4546 | ||
| 4594 | return signature; | 4547 | return signature; |
| 4595 | } | 4548 | } |
| @@ -4829,7 +4782,7 @@ namespace WixToolset.Core | |||
| 4829 | 4782 | ||
| 4830 | if (!this.Core.EncounteredError) | 4783 | if (!this.Core.EncounteredError) |
| 4831 | { | 4784 | { |
| 4832 | var tuple = new FeatureTuple(sourceLineNumbers, id) | 4785 | this.Core.AddTuple(new FeatureTuple(sourceLineNumbers, id) |
| 4833 | { | 4786 | { |
| 4834 | ParentFeatureRef = null, // this field is set in the linker | 4787 | ParentFeatureRef = null, // this field is set in the linker |
| 4835 | Title = title, | 4788 | Title = title, |
| @@ -4841,9 +4794,7 @@ namespace WixToolset.Core | |||
| 4841 | DisallowAdvertise = disallowAdvertise, | 4794 | DisallowAdvertise = disallowAdvertise, |
| 4842 | InstallDefault = installDefault, | 4795 | InstallDefault = installDefault, |
| 4843 | TypicalDefault = typicalDefault, | 4796 | TypicalDefault = typicalDefault, |
| 4844 | }; | 4797 | }); |
| 4845 | |||
| 4846 | this.Core.AddTuple(tuple); | ||
| 4847 | 4798 | ||
| 4848 | if (ComplexReferenceParentType.Unknown != parentType) | 4799 | if (ComplexReferenceParentType.Unknown != parentType) |
| 4849 | { | 4800 | { |
| @@ -4873,7 +4824,7 @@ namespace WixToolset.Core | |||
| 4873 | { | 4824 | { |
| 4874 | case "Id": | 4825 | case "Id": |
| 4875 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 4826 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 4876 | this.Core.CreateSimpleReference(sourceLineNumbers, "Feature", id); | 4827 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Feature, id); |
| 4877 | break; | 4828 | break; |
| 4878 | case "IgnoreParent": | 4829 | case "IgnoreParent": |
| 4879 | ignoreParent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 4830 | ignoreParent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| @@ -5053,7 +5004,7 @@ namespace WixToolset.Core | |||
| 5053 | { | 5004 | { |
| 5054 | case "Id": | 5005 | case "Id": |
| 5055 | id = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 5006 | id = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
| 5056 | this.Core.CreateSimpleReference(sourceLineNumbers, "WixFeatureGroup", id); | 5007 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.WixFeatureGroup, id); |
| 5057 | break; | 5008 | break; |
| 5058 | case "IgnoreParent": | 5009 | case "IgnoreParent": |
| 5059 | ignoreParent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 5010 | ignoreParent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| @@ -5222,7 +5173,7 @@ namespace WixToolset.Core | |||
| 5222 | 5173 | ||
| 5223 | if (!this.Core.EncounteredError) | 5174 | if (!this.Core.EncounteredError) |
| 5224 | { | 5175 | { |
| 5225 | var tuple = new EnvironmentTuple(sourceLineNumbers, id) | 5176 | this.Core.AddTuple(new EnvironmentTuple(sourceLineNumbers, id) |
| 5226 | { | 5177 | { |
| 5227 | Name = name, | 5178 | Name = name, |
| 5228 | Value = value, | 5179 | Value = value, |
| @@ -5232,14 +5183,7 @@ namespace WixToolset.Core | |||
| 5232 | Permanent = permanent, | 5183 | Permanent = permanent, |
| 5233 | System = system, | 5184 | System = system, |
| 5234 | ComponentRef = componentId | 5185 | ComponentRef = componentId |
| 5235 | }; | 5186 | }); |
| 5236 | |||
| 5237 | this.Core.AddTuple(tuple); | ||
| 5238 | |||
| 5239 | //var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.Environment, id); | ||
| 5240 | //row.Set(1, String.Concat(action, uninstall, system ? "*" : String.Empty, name)); | ||
| 5241 | //row.Set(2, text); | ||
| 5242 | //row.Set(3, componentId); | ||
| 5243 | } | 5187 | } |
| 5244 | } | 5188 | } |
| 5245 | 5189 | ||
| @@ -5282,12 +5226,10 @@ namespace WixToolset.Core | |||
| 5282 | 5226 | ||
| 5283 | if (!this.Core.EncounteredError) | 5227 | if (!this.Core.EncounteredError) |
| 5284 | { | 5228 | { |
| 5285 | var tuple = new ErrorTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, id)) | 5229 | this.Core.AddTuple(new ErrorTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, id)) |
| 5286 | { | 5230 | { |
| 5287 | Message = Common.GetInnerText(node) | 5231 | Message = Common.GetInnerText(node) |
| 5288 | }; | 5232 | }); |
| 5289 | |||
| 5290 | this.Core.AddTuple(tuple); | ||
| 5291 | } | 5233 | } |
| 5292 | } | 5234 | } |
| 5293 | 5235 | ||
| @@ -5373,18 +5315,16 @@ namespace WixToolset.Core | |||
| 5373 | { | 5315 | { |
| 5374 | if (!this.Core.EncounteredError) | 5316 | if (!this.Core.EncounteredError) |
| 5375 | { | 5317 | { |
| 5376 | var tuple = new ExtensionTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, extension, componentId)) | 5318 | this.Core.AddTuple(new ExtensionTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, extension, componentId)) |
| 5377 | { | 5319 | { |
| 5378 | Extension = extension, | 5320 | Extension = extension, |
| 5379 | ComponentRef = componentId, | 5321 | ComponentRef = componentId, |
| 5380 | ProgIdRef = progId, | 5322 | ProgIdRef = progId, |
| 5381 | MimeRef = mime, | 5323 | MimeRef = mime, |
| 5382 | FeatureRef = Guid.Empty.ToString("B") | 5324 | FeatureRef = Guid.Empty.ToString("B"), |
| 5383 | }; | 5325 | }); |
| 5384 | |||
| 5385 | this.Core.AddTuple(tuple); | ||
| 5386 | 5326 | ||
| 5387 | this.Core.EnsureTable(sourceLineNumbers, "Verb"); | 5327 | this.Core.EnsureTable(sourceLineNumbers, WindowsInstallerTableDefinitions.Verb); |
| 5388 | } | 5328 | } |
| 5389 | } | 5329 | } |
| 5390 | else if (YesNoType.No == advertise) | 5330 | else if (YesNoType.No == advertise) |
| @@ -5481,11 +5421,11 @@ namespace WixToolset.Core | |||
| 5481 | break; | 5421 | break; |
| 5482 | case "AssemblyApplication": | 5422 | case "AssemblyApplication": |
| 5483 | assemblyApplication = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 5423 | assemblyApplication = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 5484 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", assemblyApplication); | 5424 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, assemblyApplication); |
| 5485 | break; | 5425 | break; |
| 5486 | case "AssemblyManifest": | 5426 | case "AssemblyManifest": |
| 5487 | assemblyManifest = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 5427 | assemblyManifest = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 5488 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", assemblyManifest); | 5428 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, assemblyManifest); |
| 5489 | break; | 5429 | break; |
| 5490 | case "BindPath": | 5430 | case "BindPath": |
| 5491 | bindPath = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | 5431 | bindPath = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); |
| @@ -5499,7 +5439,7 @@ namespace WixToolset.Core | |||
| 5499 | break; | 5439 | break; |
| 5500 | case "CompanionFile": | 5440 | case "CompanionFile": |
| 5501 | companionFile = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 5441 | companionFile = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 5502 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", companionFile); | 5442 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.File, companionFile); |
| 5503 | break; | 5443 | break; |
| 5504 | case "Compressed": | 5444 | case "Compressed": |
| 5505 | var compressedValue = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); | 5445 | var compressedValue = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); |
| @@ -5797,7 +5737,7 @@ namespace WixToolset.Core | |||
| 5797 | attributes |= compressed.HasValue && compressed == false ? FileTupleAttributes.Uncompressed : 0; | 5737 | attributes |= compressed.HasValue && compressed == false ? FileTupleAttributes.Uncompressed : 0; |
| 5798 | attributes |= generatedShortFileName ? FileTupleAttributes.GeneratedShortFileName : 0; | 5738 | attributes |= generatedShortFileName ? FileTupleAttributes.GeneratedShortFileName : 0; |
| 5799 | 5739 | ||
| 5800 | var tuple = new FileTuple(sourceLineNumbers, id) | 5740 | this.Core.AddTuple(new FileTuple(sourceLineNumbers, id) |
| 5801 | { | 5741 | { |
| 5802 | ComponentRef = componentId, | 5742 | ComponentRef = componentId, |
| 5803 | Name = name, | 5743 | Name = name, |
| @@ -5831,10 +5771,8 @@ namespace WixToolset.Core | |||
| 5831 | IgnoreOffsets = ignoreOffsets, | 5771 | IgnoreOffsets = ignoreOffsets, |
| 5832 | IgnoreLengths = ignoreLengths, | 5772 | IgnoreLengths = ignoreLengths, |
| 5833 | RetainOffsets = protectOffsets, | 5773 | RetainOffsets = protectOffsets, |
| 5834 | SymbolPaths = symbols | 5774 | SymbolPaths = symbols, |
| 5835 | }; | 5775 | }); |
| 5836 | |||
| 5837 | this.Core.AddTuple(tuple); | ||
| 5838 | 5776 | ||
| 5839 | if (AssemblyType.NotAnAssembly != assemblyType) | 5777 | if (AssemblyType.NotAnAssembly != assemblyType) |
| 5840 | { | 5778 | { |
| @@ -5850,7 +5788,7 @@ namespace WixToolset.Core | |||
| 5850 | } | 5788 | } |
| 5851 | } | 5789 | } |
| 5852 | 5790 | ||
| 5853 | this.Core.CreateSimpleReference(sourceLineNumbers, "Media", diskId.ToString(CultureInfo.InvariantCulture.NumberFormat)); | 5791 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Media, diskId.ToString(CultureInfo.InvariantCulture.NumberFormat)); |
| 5854 | 5792 | ||
| 5855 | // If this component does not have a companion file this file is a possible keypath. | 5793 | // If this component does not have a companion file this file is a possible keypath. |
| 5856 | possibleKeyPath = null; | 5794 | possibleKeyPath = null; |
| @@ -5990,13 +5928,13 @@ namespace WixToolset.Core | |||
| 5990 | 5928 | ||
| 5991 | if (!this.Core.EncounteredError) | 5929 | if (!this.Core.EncounteredError) |
| 5992 | { | 5930 | { |
| 5993 | var tuple = new SignatureTuple(sourceLineNumbers, id) | 5931 | var tuple = this.Core.AddTuple(new SignatureTuple(sourceLineNumbers, id) |
| 5994 | { | 5932 | { |
| 5995 | FileName = name ?? shortName, | 5933 | FileName = name ?? shortName, |
| 5996 | MinVersion = minVersion, | 5934 | MinVersion = minVersion, |
| 5997 | MaxVersion = maxVersion, | 5935 | MaxVersion = maxVersion, |
| 5998 | Languages = languages | 5936 | Languages = languages |
| 5999 | }; | 5937 | }); |
| 6000 | 5938 | ||
| 6001 | if (CompilerConstants.IntegerNotSet != minSize) | 5939 | if (CompilerConstants.IntegerNotSet != minSize) |
| 6002 | { | 5940 | { |
| @@ -6018,8 +5956,6 @@ namespace WixToolset.Core | |||
| 6018 | tuple.MaxDate = maxDate; | 5956 | tuple.MaxDate = maxDate; |
| 6019 | } | 5957 | } |
| 6020 | 5958 | ||
| 6021 | this.Core.AddTuple(tuple); | ||
| 6022 | |||
| 6023 | // Create a DrLocator row to associate the file with a directory | 5959 | // Create a DrLocator row to associate the file with a directory |
| 6024 | // when a different identifier is specified for the FileSearch. | 5960 | // when a different identifier is specified for the FileSearch. |
| 6025 | if (!isSameId) | 5961 | if (!isSameId) |
| @@ -6125,7 +6061,7 @@ namespace WixToolset.Core | |||
| 6125 | this.ParseBundleExtensionElement(child); | 6061 | this.ParseBundleExtensionElement(child); |
| 6126 | break; | 6062 | break; |
| 6127 | case "BundleExtensionRef": | 6063 | case "BundleExtensionRef": |
| 6128 | this.ParseSimpleRefElement(child, "WixBundleExtension"); | 6064 | this.ParseSimpleRefElement(child, TupleDefinitions.WixBundleExtension); |
| 6129 | break; | 6065 | break; |
| 6130 | case "ComplianceCheck": | 6066 | case "ComplianceCheck": |
| 6131 | this.ParseComplianceCheckElement(child); | 6067 | this.ParseComplianceCheckElement(child); |
| @@ -6146,7 +6082,7 @@ namespace WixToolset.Core | |||
| 6146 | this.ParseCustomActionElement(child); | 6082 | this.ParseCustomActionElement(child); |
| 6147 | break; | 6083 | break; |
| 6148 | case "CustomActionRef": | 6084 | case "CustomActionRef": |
| 6149 | this.ParseSimpleRefElement(child, "CustomAction"); | 6085 | this.ParseSimpleRefElement(child, TupleDefinitions.CustomAction); |
| 6150 | break; | 6086 | break; |
| 6151 | case "CustomTable": | 6087 | case "CustomTable": |
| 6152 | this.ParseCustomTableElement(child); | 6088 | this.ParseCustomTableElement(child); |
| @@ -6161,7 +6097,7 @@ namespace WixToolset.Core | |||
| 6161 | this.ParseEmbeddedChainerElement(child); | 6097 | this.ParseEmbeddedChainerElement(child); |
| 6162 | break; | 6098 | break; |
| 6163 | case "EmbeddedChainerRef": | 6099 | case "EmbeddedChainerRef": |
| 6164 | this.ParseSimpleRefElement(child, "MsiEmbeddedChainer"); | 6100 | this.ParseSimpleRefElement(child, TupleDefinitions.MsiEmbeddedChainer); |
| 6165 | break; | 6101 | break; |
| 6166 | case "EnsureTable": | 6102 | case "EnsureTable": |
| 6167 | this.ParseEnsureTableElement(child); | 6103 | this.ParseEnsureTableElement(child); |
| @@ -6210,7 +6146,7 @@ namespace WixToolset.Core | |||
| 6210 | this.ParsePropertyElement(child); | 6146 | this.ParsePropertyElement(child); |
| 6211 | break; | 6147 | break; |
| 6212 | case "PropertyRef": | 6148 | case "PropertyRef": |
| 6213 | this.ParseSimpleRefElement(child, "Property"); | 6149 | this.ParseSimpleRefElement(child, TupleDefinitions.Property); |
| 6214 | break; | 6150 | break; |
| 6215 | case "RelatedBundle": | 6151 | case "RelatedBundle": |
| 6216 | this.ParseRelatedBundleElement(child); | 6152 | this.ParseRelatedBundleElement(child); |
| @@ -6225,7 +6161,7 @@ namespace WixToolset.Core | |||
| 6225 | this.ParseSetVariableElement(child); | 6161 | this.ParseSetVariableElement(child); |
| 6226 | break; | 6162 | break; |
| 6227 | case "SetVariableRef": | 6163 | case "SetVariableRef": |
| 6228 | this.ParseSimpleRefElement(child, "WixSetVariable"); | 6164 | this.ParseSimpleRefElement(child, TupleDefinitions.WixSetVariable); |
| 6229 | break; | 6165 | break; |
| 6230 | case "SFPCatalog": | 6166 | case "SFPCatalog": |
| 6231 | string parentName = null; | 6167 | string parentName = null; |
| @@ -6235,7 +6171,7 @@ namespace WixToolset.Core | |||
| 6235 | this.ParseUIElement(child); | 6171 | this.ParseUIElement(child); |
| 6236 | break; | 6172 | break; |
| 6237 | case "UIRef": | 6173 | case "UIRef": |
| 6238 | this.ParseSimpleRefElement(child, "WixUI"); | 6174 | this.ParseSimpleRefElement(child, TupleDefinitions.WixUI); |
| 6239 | break; | 6175 | break; |
| 6240 | case "Upgrade": | 6176 | case "Upgrade": |
| 6241 | this.ParseUpgradeElement(child); | 6177 | this.ParseUpgradeElement(child); |
| @@ -6555,7 +6491,7 @@ namespace WixToolset.Core | |||
| 6555 | 6491 | ||
| 6556 | if (!this.Core.EncounteredError) | 6492 | if (!this.Core.EncounteredError) |
| 6557 | { | 6493 | { |
| 6558 | var tuple = new IniFileTuple(sourceLineNumbers, id) | 6494 | this.Core.AddTuple(new IniFileTuple(sourceLineNumbers, id) |
| 6559 | { | 6495 | { |
| 6560 | FileName = this.GetMsiFilenameValue(shortName, name), | 6496 | FileName = this.GetMsiFilenameValue(shortName, name), |
| 6561 | DirProperty = directory, | 6497 | DirProperty = directory, |
| @@ -6564,9 +6500,7 @@ namespace WixToolset.Core | |||
| 6564 | Value = value, | 6500 | Value = value, |
| 6565 | Action = action.Value, | 6501 | Action = action.Value, |
| 6566 | ComponentRef = componentId | 6502 | ComponentRef = componentId |
| 6567 | }; | 6503 | }); |
| 6568 | |||
| 6569 | this.Core.AddTuple(tuple); | ||
| 6570 | } | 6504 | } |
| 6571 | } | 6505 | } |
| 6572 | 6506 | ||
| @@ -6724,7 +6658,7 @@ namespace WixToolset.Core | |||
| 6724 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); | 6658 | this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); |
| 6725 | } | 6659 | } |
| 6726 | oneChild = true; | 6660 | oneChild = true; |
| 6727 | var newId = this.ParseSimpleRefElement(child, "Signature"); // FileSearch signatures override parent signatures | 6661 | var newId = this.ParseSimpleRefElement(child, TupleDefinitions.Signature); // FileSearch signatures override parent signatures |
| 6728 | id = new Identifier(AccessModifier.Private, newId); | 6662 | id = new Identifier(AccessModifier.Private, newId); |
| 6729 | signature = null; | 6663 | signature = null; |
| 6730 | break; | 6664 | break; |
| @@ -6741,21 +6675,19 @@ namespace WixToolset.Core | |||
| 6741 | 6675 | ||
| 6742 | if (!this.Core.EncounteredError) | 6676 | if (!this.Core.EncounteredError) |
| 6743 | { | 6677 | { |
| 6744 | var tuple = new IniLocatorTuple(sourceLineNumbers, id) | 6678 | var tuple = this.Core.AddTuple(new IniLocatorTuple(sourceLineNumbers, id) |
| 6745 | { | 6679 | { |
| 6746 | SignatureRef = id.Id, | 6680 | SignatureRef = id.Id, |
| 6747 | FileName = this.GetMsiFilenameValue(shortName, name), | 6681 | FileName = this.GetMsiFilenameValue(shortName, name), |
| 6748 | Section = section, | 6682 | Section = section, |
| 6749 | Key = key, | 6683 | Key = key, |
| 6750 | Type = type | 6684 | Type = type |
| 6751 | }; | 6685 | }); |
| 6752 | 6686 | ||
| 6753 | if (CompilerConstants.IntegerNotSet != field) | 6687 | if (CompilerConstants.IntegerNotSet != field) |
| 6754 | { | 6688 | { |
| 6755 | tuple.Field = field; | 6689 | tuple.Field = field; |
| 6756 | } | 6690 | } |
| 6757 | |||
| 6758 | this.Core.AddTuple(tuple); | ||
| 6759 | } | 6691 | } |
| 6760 | 6692 | ||
| 6761 | return signature; | 6693 | return signature; |
| @@ -6779,7 +6711,7 @@ namespace WixToolset.Core | |||
| 6779 | { | 6711 | { |
| 6780 | case "Shared": | 6712 | case "Shared": |
| 6781 | shared = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 6713 | shared = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 6782 | this.Core.CreateSimpleReference(sourceLineNumbers, "Component", shared); | 6714 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Component, shared); |
| 6783 | break; | 6715 | break; |
| 6784 | default: | 6716 | default: |
| 6785 | this.Core.UnexpectedAttribute(node, attrib); | 6717 | this.Core.UnexpectedAttribute(node, attrib); |
| @@ -6841,9 +6773,22 @@ namespace WixToolset.Core | |||
| 6841 | 6773 | ||
| 6842 | if (!this.Core.EncounteredError) | 6774 | if (!this.Core.EncounteredError) |
| 6843 | { | 6775 | { |
| 6844 | var tuple = this.Core.CreateTuple(sourceLineNumbers, "PatchCertificates" == node.Name.LocalName ? TupleDefinitionType.MsiPatchCertificate : TupleDefinitionType.MsiPackageCertificate); | 6776 | if ("PatchCertificates" == node.Name.LocalName) |
| 6845 | tuple.Set(0, name); | 6777 | { |
| 6846 | tuple.Set(1, name); | 6778 | this.Core.AddTuple(new MsiPatchCertificateTuple(sourceLineNumbers) |
| 6779 | { | ||
| 6780 | PatchCertificate = name, | ||
| 6781 | DigitalCertificateRef = name, | ||
| 6782 | }); | ||
| 6783 | } | ||
| 6784 | else | ||
| 6785 | { | ||
| 6786 | this.Core.AddTuple(new MsiPackageCertificateTuple(sourceLineNumbers) | ||
| 6787 | { | ||
| 6788 | PackageCertificate = name, | ||
| 6789 | DigitalCertificateRef = name, | ||
| 6790 | }); | ||
| 6791 | } | ||
| 6847 | } | 6792 | } |
| 6848 | break; | 6793 | break; |
| 6849 | default: | 6794 | default: |
| @@ -7109,14 +7054,14 @@ namespace WixToolset.Core | |||
| 7109 | if (!this.Core.EncounteredError) | 7054 | if (!this.Core.EncounteredError) |
| 7110 | { | 7055 | { |
| 7111 | // create the row that performs the upgrade (or downgrade) | 7056 | // create the row that performs the upgrade (or downgrade) |
| 7112 | var tuple = new UpgradeTuple(sourceLineNumbers) | 7057 | var tuple = this.Core.AddTuple(new UpgradeTuple(sourceLineNumbers) |
| 7113 | { | 7058 | { |
| 7114 | UpgradeCode = upgradeCode, | 7059 | UpgradeCode = upgradeCode, |
| 7115 | Remove = removeFeatures, | 7060 | Remove = removeFeatures, |
| 7116 | MigrateFeatures = migrateFeatures, | 7061 | MigrateFeatures = migrateFeatures, |
| 7117 | IgnoreRemoveFailures = ignoreRemoveFailure, | 7062 | IgnoreRemoveFailures = ignoreRemoveFailure, |
| 7118 | ActionProperty = Common.UpgradeDetectedProperty | 7063 | ActionProperty = Common.UpgradeDetectedProperty |
| 7119 | }; | 7064 | }); |
| 7120 | 7065 | ||
| 7121 | if (allowDowngrades) | 7066 | if (allowDowngrades) |
| 7122 | { | 7067 | { |
| @@ -7131,24 +7076,20 @@ namespace WixToolset.Core | |||
| 7131 | tuple.VersionMaxInclusive = allowSameVersionUpgrades; | 7076 | tuple.VersionMaxInclusive = allowSameVersionUpgrades; |
| 7132 | } | 7077 | } |
| 7133 | 7078 | ||
| 7134 | this.Core.AddTuple(tuple); | ||
| 7135 | |||
| 7136 | // Add launch condition that blocks upgrades | 7079 | // Add launch condition that blocks upgrades |
| 7137 | if (blockUpgrades) | 7080 | if (blockUpgrades) |
| 7138 | { | 7081 | { |
| 7139 | var conditionTuple = new LaunchConditionTuple(sourceLineNumbers) | 7082 | this.Core.AddTuple(new LaunchConditionTuple(sourceLineNumbers) |
| 7140 | { | 7083 | { |
| 7141 | Condition = Common.UpgradePreventedCondition, | 7084 | Condition = Common.UpgradePreventedCondition, |
| 7142 | Description = downgradeErrorMessage | 7085 | Description = downgradeErrorMessage |
| 7143 | }; | 7086 | }); |
| 7144 | |||
| 7145 | this.Core.AddTuple(conditionTuple); | ||
| 7146 | } | 7087 | } |
| 7147 | 7088 | ||
| 7148 | // now create the Upgrade row and launch conditions to prevent downgrades (unless explicitly permitted) | 7089 | // now create the Upgrade row and launch conditions to prevent downgrades (unless explicitly permitted) |
| 7149 | if (!allowDowngrades) | 7090 | if (!allowDowngrades) |
| 7150 | { | 7091 | { |
| 7151 | var upgradeTuple = new UpgradeTuple(sourceLineNumbers) | 7092 | this.Core.AddTuple(new UpgradeTuple(sourceLineNumbers) |
| 7152 | { | 7093 | { |
| 7153 | UpgradeCode = upgradeCode, | 7094 | UpgradeCode = upgradeCode, |
| 7154 | VersionMin = productVersion, | 7095 | VersionMin = productVersion, |
| @@ -7156,17 +7097,13 @@ namespace WixToolset.Core | |||
| 7156 | OnlyDetect = true, | 7097 | OnlyDetect = true, |
| 7157 | IgnoreRemoveFailures = ignoreRemoveFailure, | 7098 | IgnoreRemoveFailures = ignoreRemoveFailure, |
| 7158 | ActionProperty = Common.DowngradeDetectedProperty | 7099 | ActionProperty = Common.DowngradeDetectedProperty |
| 7159 | }; | 7100 | }); |
| 7160 | |||
| 7161 | this.Core.AddTuple(upgradeTuple); | ||
| 7162 | 7101 | ||
| 7163 | var conditionTuple = new LaunchConditionTuple(sourceLineNumbers) | 7102 | this.Core.AddTuple(new LaunchConditionTuple(sourceLineNumbers) |
| 7164 | { | 7103 | { |
| 7165 | Condition = Common.DowngradePreventedCondition, | 7104 | Condition = Common.DowngradePreventedCondition, |
| 7166 | Description = downgradeErrorMessage | 7105 | Description = downgradeErrorMessage |
| 7167 | }; | 7106 | }); |
| 7168 | |||
| 7169 | this.Core.AddTuple(conditionTuple); | ||
| 7170 | } | 7107 | } |
| 7171 | 7108 | ||
| 7172 | // finally, schedule RemoveExistingProducts | 7109 | // finally, schedule RemoveExistingProducts |
| @@ -7232,7 +7169,7 @@ namespace WixToolset.Core | |||
| 7232 | break; | 7169 | break; |
| 7233 | case "DiskPrompt": | 7170 | case "DiskPrompt": |
| 7234 | diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 7171 | diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
| 7235 | this.Core.CreateSimpleReference(sourceLineNumbers, "Property", "DiskPrompt"); // ensure the output has a DiskPrompt Property defined | 7172 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Property, "DiskPrompt"); // ensure the output has a DiskPrompt Property defined |
| 7236 | break; | 7173 | break; |
| 7237 | case "EmbedCab": | 7174 | case "EmbedCab": |
| 7238 | embedCab = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 7175 | embedCab = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| @@ -7364,7 +7301,7 @@ namespace WixToolset.Core | |||
| 7364 | // add the row to the section | 7301 | // add the row to the section |
| 7365 | if (!this.Core.EncounteredError) | 7302 | if (!this.Core.EncounteredError) |
| 7366 | { | 7303 | { |
| 7367 | var tuple = new MediaTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, id)) | 7304 | this.Core.AddTuple(new MediaTuple(sourceLineNumbers, new Identifier(AccessModifier.Public, id)) |
| 7368 | { | 7305 | { |
| 7369 | DiskId = id, | 7306 | DiskId = id, |
| 7370 | DiskPrompt = diskPrompt, | 7307 | DiskPrompt = diskPrompt, |
| @@ -7373,9 +7310,7 @@ namespace WixToolset.Core | |||
| 7373 | Source = source, // the Source column is only set when creating a patch | 7310 | Source = source, // the Source column is only set when creating a patch |
| 7374 | CompressionLevel = compressionLevel, | 7311 | CompressionLevel = compressionLevel, |
| 7375 | Layout = layout | 7312 | Layout = layout |
| 7376 | }; | 7313 | }); |
| 7377 | |||
| 7378 | this.Core.AddTuple(tuple); | ||
| 7379 | 7314 | ||
| 7380 | if (null != symbols) | 7315 | if (null != symbols) |
| 7381 | { | 7316 | { |
| @@ -7441,7 +7376,7 @@ namespace WixToolset.Core | |||
| 7441 | break; | 7376 | break; |
| 7442 | case "DiskPrompt": | 7377 | case "DiskPrompt": |
| 7443 | diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 7378 | diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
| 7444 | this.Core.CreateSimpleReference(sourceLineNumbers, "Property", "DiskPrompt"); // ensure the output has a DiskPrompt Property defined | 7379 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Property, "DiskPrompt"); // ensure the output has a DiskPrompt Property defined |
| 7445 | this.Core.Write(WarningMessages.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); | 7380 | this.Core.Write(WarningMessages.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); |
| 7446 | break; | 7381 | break; |
| 7447 | case "EmbedCab": | 7382 | case "EmbedCab": |
| @@ -7480,7 +7415,7 @@ namespace WixToolset.Core | |||
| 7480 | DiskId = 1 | 7415 | DiskId = 1 |
| 7481 | }); | 7416 | }); |
| 7482 | 7417 | ||
| 7483 | var tuple = new WixMediaTemplateTuple(sourceLineNumbers) | 7418 | this.Core.AddTuple(new WixMediaTemplateTuple(sourceLineNumbers) |
| 7484 | { | 7419 | { |
| 7485 | CabinetTemplate = cabinetTemplate, | 7420 | CabinetTemplate = cabinetTemplate, |
| 7486 | VolumeLabel = volumeLabel, | 7421 | VolumeLabel = volumeLabel, |
| @@ -7488,7 +7423,7 @@ namespace WixToolset.Core | |||
| 7488 | MaximumUncompressedMediaSize = maximumUncompressedMediaSize, | 7423 | MaximumUncompressedMediaSize = maximumUncompressedMediaSize, |
| 7489 | MaximumCabinetSizeForLargeFileSplitting = maximumCabinetSizeForLargeFileSplitting, | 7424 | MaximumCabinetSizeForLargeFileSplitting = maximumCabinetSizeForLargeFileSplitting, |
| 7490 | CompressionLevel = compressionLevel | 7425 | CompressionLevel = compressionLevel |
| 7491 | }; | 7426 | }); |
| 7492 | 7427 | ||
| 7493 | //else | 7428 | //else |
| 7494 | //{ | 7429 | //{ |
| @@ -7499,8 +7434,6 @@ namespace WixToolset.Core | |||
| 7499 | //{ | 7434 | //{ |
| 7500 | // mediaTemplateRow.MaximumCabinetSizeForLargeFileSplitting = 0; // Default value of 0 corresponds to max size of 2048 MB (i.e. 2 GB) | 7435 | // mediaTemplateRow.MaximumCabinetSizeForLargeFileSplitting = 0; // Default value of 0 corresponds to max size of 2048 MB (i.e. 2 GB) |
| 7501 | //} | 7436 | //} |
| 7502 | |||
| 7503 | this.Core.AddTuple(tuple); | ||
| 7504 | } | 7437 | } |
| 7505 | } | 7438 | } |
| 7506 | 7439 | ||
| @@ -7530,7 +7463,7 @@ namespace WixToolset.Core | |||
| 7530 | break; | 7463 | break; |
| 7531 | case "DiskId": | 7464 | case "DiskId": |
| 7532 | diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); | 7465 | diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); |
| 7533 | this.Core.CreateSimpleReference(sourceLineNumbers, "Media", diskId.ToString(CultureInfo.InvariantCulture.NumberFormat)); | 7466 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Media, diskId.ToString(CultureInfo.InvariantCulture.NumberFormat)); |
| 7534 | break; | 7467 | break; |
| 7535 | case "FileCompression": | 7468 | case "FileCompression": |
| 7536 | var compress = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 7469 | var compress = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| @@ -7604,7 +7537,7 @@ namespace WixToolset.Core | |||
| 7604 | 7537 | ||
| 7605 | if (!this.Core.EncounteredError) | 7538 | if (!this.Core.EncounteredError) |
| 7606 | { | 7539 | { |
| 7607 | var tuple = new WixMergeTuple(sourceLineNumbers, id) | 7540 | var tuple = this.Core.AddTuple(new WixMergeTuple(sourceLineNumbers, id) |
| 7608 | { | 7541 | { |
| 7609 | DirectoryRef = directoryId, | 7542 | DirectoryRef = directoryId, |
| 7610 | SourceFile = sourceFile, | 7543 | SourceFile = sourceFile, |
| @@ -7612,11 +7545,9 @@ namespace WixToolset.Core | |||
| 7612 | ConfigurationData = configData, | 7545 | ConfigurationData = configData, |
| 7613 | FileAttributes = attributes, | 7546 | FileAttributes = attributes, |
| 7614 | FeatureRef = Guid.Empty.ToString("B") | 7547 | FeatureRef = Guid.Empty.ToString("B") |
| 7615 | }; | 7548 | }); |
| 7616 | 7549 | ||
| 7617 | tuple.Set((int)WixMergeTupleFields.Language, language); | 7550 | tuple.Set((int)WixMergeTupleFields.Language, language); |
| 7618 | |||
| 7619 | this.Core.AddTuple(tuple); | ||
| 7620 | } | 7551 | } |
| 7621 | } | 7552 | } |
| 7622 | 7553 | ||
| @@ -7701,7 +7632,7 @@ namespace WixToolset.Core | |||
| 7701 | { | 7632 | { |
| 7702 | case "Id": | 7633 | case "Id": |
| 7703 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 7634 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 7704 | this.Core.CreateSimpleReference(sourceLineNumbers, "WixMerge", id); | 7635 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.WixMerge, id); |
| 7705 | break; | 7636 | break; |
| 7706 | case "Primary": | 7637 | case "Primary": |
| 7707 | primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 7638 | primary = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| @@ -7794,14 +7725,12 @@ namespace WixToolset.Core | |||
| 7794 | 7725 | ||
| 7795 | if (!this.Core.EncounteredError) | 7726 | if (!this.Core.EncounteredError) |
| 7796 | { | 7727 | { |
| 7797 | var tuple = new MIMETuple(sourceLineNumbers, new Identifier(AccessModifier.Private, contentType)) | 7728 | this.Core.AddTuple(new MIMETuple(sourceLineNumbers, new Identifier(AccessModifier.Private, contentType)) |
| 7798 | { | 7729 | { |
| 7799 | ContentType = contentType, | 7730 | ContentType = contentType, |
| 7800 | ExtensionRef = extension, | 7731 | ExtensionRef = extension, |
| 7801 | CLSID = classId | 7732 | CLSID = classId |
| 7802 | }; | 7733 | }); |
| 7803 | |||
| 7804 | this.Core.AddTuple(tuple); | ||
| 7805 | } | 7734 | } |
| 7806 | } | 7735 | } |
| 7807 | else if (YesNoType.No == advertise) | 7736 | else if (YesNoType.No == advertise) |
| @@ -7902,12 +7831,10 @@ namespace WixToolset.Core | |||
| 7902 | { | 7831 | { |
| 7903 | if (!this.Core.EncounteredError) | 7832 | if (!this.Core.EncounteredError) |
| 7904 | { | 7833 | { |
| 7905 | var tuple = new PropertyTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, name)) | 7834 | this.Core.AddTuple(new PropertyTuple(sourceLineNumbers, new Identifier(AccessModifier.Private, name)) |
| 7906 | { | 7835 | { |
| 7907 | Value = value | 7836 | Value = value |
| 7908 | }; | 7837 | }); |
| 7909 | |||
| 7910 | this.Core.AddTuple(tuple); | ||
| 7911 | } | 7838 | } |
| 7912 | } | 7839 | } |
| 7913 | 7840 | ||
| @@ -8063,13 +7990,11 @@ namespace WixToolset.Core | |||
| 8063 | 7990 | ||
| 8064 | if (!this.Core.EncounteredError) | 7991 | if (!this.Core.EncounteredError) |
| 8065 | { | 7992 | { |
| 8066 | var tuple = new WixPatchRefTuple(sourceLineNumbers) | 7993 | this.Core.AddTuple(new WixPatchRefTuple(sourceLineNumbers) |
| 8067 | { | 7994 | { |
| 8068 | Table = "*", | 7995 | Table = "*", |
| 8069 | PrimaryKeys = "*" | 7996 | PrimaryKeys = "*", |
| 8070 | }; | 7997 | }); |
| 8071 | |||
| 8072 | this.Core.AddTuple(tuple); | ||
| 8073 | } | 7998 | } |
| 8074 | } | 7999 | } |
| 8075 | 8000 | ||
| @@ -8112,13 +8037,11 @@ namespace WixToolset.Core | |||
| 8112 | 8037 | ||
| 8113 | if (!this.Core.EncounteredError) | 8038 | if (!this.Core.EncounteredError) |
| 8114 | { | 8039 | { |
| 8115 | var tuple = new WixPatchRefTuple(sourceLineNumbers) | 8040 | this.Core.AddTuple(new WixPatchRefTuple(sourceLineNumbers) |
| 8116 | { | 8041 | { |
| 8117 | Table = tableName, | 8042 | Table = tableName, |
| 8118 | PrimaryKeys = id | 8043 | PrimaryKeys = id |
| 8119 | }; | 8044 | }); |
| 8120 | |||
| 8121 | this.Core.AddTuple(tuple); | ||
| 8122 | } | 8045 | } |
| 8123 | } | 8046 | } |
| 8124 | 8047 | ||
| @@ -8232,16 +8155,14 @@ namespace WixToolset.Core | |||
| 8232 | 8155 | ||
| 8233 | if (!this.Core.EncounteredError) | 8156 | if (!this.Core.EncounteredError) |
| 8234 | { | 8157 | { |
| 8235 | var tuple = new WixPatchBaselineTuple(sourceLineNumbers, id) | 8158 | this.Core.AddTuple(new WixPatchBaselineTuple(sourceLineNumbers, id) |
| 8236 | { | 8159 | { |
| 8237 | DiskId = diskId ?? 1, | 8160 | DiskId = diskId ?? 1, |
| 8238 | ValidationFlags = validationFlags, | 8161 | ValidationFlags = validationFlags, |
| 8239 | BaselineFile = new IntermediateFieldPathValue { Path = baselineFile }, | 8162 | BaselineFile = new IntermediateFieldPathValue { Path = baselineFile }, |
| 8240 | UpdateFile = new IntermediateFieldPathValue { Path = updateFile }, | 8163 | UpdateFile = new IntermediateFieldPathValue { Path = updateFile }, |
| 8241 | TransformFile = new IntermediateFieldPathValue { Path = transformFile } | 8164 | TransformFile = new IntermediateFieldPathValue { Path = transformFile }, |
| 8242 | }; | 8165 | }); |
| 8243 | |||
| 8244 | this.Core.AddTuple(tuple); | ||
| 8245 | } | 8166 | } |
| 8246 | } | 8167 | } |
| 8247 | 8168 | ||
