diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-03-26 15:21:06 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-03-30 21:30:04 +1000 |
| commit | afbc6889c73d58136cb8851858ca3c17f41dc2c5 (patch) | |
| tree | 1d7c66218176c7e8a28d49a4e22c60fe1e4e4c0d /src/WixToolset.Core | |
| parent | 192c5aa59b5d8e5e9df9095982317c224f3d4f04 (diff) | |
| download | wix-afbc6889c73d58136cb8851858ca3c17f41dc2c5.tar.gz wix-afbc6889c73d58136cb8851858ca3c17f41dc2c5.tar.bz2 wix-afbc6889c73d58136cb8851858ca3c17f41dc2c5.zip | |
Add BundleExtension element.
Add GetTestXml.
Fix issue with building with current version of burn.
Diffstat (limited to 'src/WixToolset.Core')
| -rw-r--r-- | src/WixToolset.Core/Compiler.cs | 6 | ||||
| -rw-r--r-- | src/WixToolset.Core/Compiler_Bundle.cs | 73 |
2 files changed, 79 insertions, 0 deletions
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 8c0c4a39..6f122f7b 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
| @@ -6121,6 +6121,12 @@ namespace WixToolset.Core | |||
| 6121 | case "BootstrapperApplicationRef": | 6121 | case "BootstrapperApplicationRef": |
| 6122 | this.ParseBootstrapperApplicationRefElement(child); | 6122 | this.ParseBootstrapperApplicationRefElement(child); |
| 6123 | break; | 6123 | break; |
| 6124 | case "BundleExtension": | ||
| 6125 | this.ParseBundleExtensionElement(child); | ||
| 6126 | break; | ||
| 6127 | case "BundleExtensionRef": | ||
| 6128 | this.ParseSimpleRefElement(child, "WixBundleExtension"); | ||
| 6129 | break; | ||
| 6124 | case "ComplianceCheck": | 6130 | case "ComplianceCheck": |
| 6125 | this.ParseComplianceCheckElement(child); | 6131 | this.ParseComplianceCheckElement(child); |
| 6126 | break; | 6132 | break; |
diff --git a/src/WixToolset.Core/Compiler_Bundle.cs b/src/WixToolset.Core/Compiler_Bundle.cs index 3be7d0c5..a840e448 100644 --- a/src/WixToolset.Core/Compiler_Bundle.cs +++ b/src/WixToolset.Core/Compiler_Bundle.cs | |||
| @@ -278,6 +278,12 @@ namespace WixToolset.Core | |||
| 278 | case "BootstrapperApplicationRef": | 278 | case "BootstrapperApplicationRef": |
| 279 | this.ParseBootstrapperApplicationRefElement(child); | 279 | this.ParseBootstrapperApplicationRefElement(child); |
| 280 | break; | 280 | break; |
| 281 | case "BundleExtension": | ||
| 282 | this.ParseBundleExtensionElement(child); | ||
| 283 | break; | ||
| 284 | case "BundleExtensionRef": | ||
| 285 | this.ParseSimpleRefElement(child, "WixBundleExtension"); | ||
| 286 | break; | ||
| 281 | case "OptionalUpdateRegistration": | 287 | case "OptionalUpdateRegistration": |
| 282 | this.ParseOptionalUpdateRegistrationElement(child, manufacturer, parentName, name); | 288 | this.ParseOptionalUpdateRegistrationElement(child, manufacturer, parentName, name); |
| 283 | break; | 289 | break; |
| @@ -760,6 +766,73 @@ namespace WixToolset.Core | |||
| 760 | } | 766 | } |
| 761 | 767 | ||
| 762 | /// <summary> | 768 | /// <summary> |
| 769 | /// Parse the BundleExtension element. | ||
| 770 | /// </summary> | ||
| 771 | /// <param name="node">Element to parse</param> | ||
| 772 | private void ParseBundleExtensionElement(XElement node) | ||
| 773 | { | ||
| 774 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
| 775 | Identifier previousId = null; | ||
| 776 | var previousType = ComplexReferenceChildType.Unknown; | ||
| 777 | |||
| 778 | // The BundleExtension element acts like a Payload element so delegate to the "Payload" attribute parsing code to parse and create a Payload entry. | ||
| 779 | var id = this.ParsePayloadElementContent(node, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId, previousType, previousId, false); | ||
| 780 | if (null != id) | ||
| 781 | { | ||
| 782 | previousId = id; | ||
| 783 | previousType = ComplexReferenceChildType.Payload; | ||
| 784 | } | ||
| 785 | |||
| 786 | foreach (var child in node.Elements()) | ||
| 787 | { | ||
| 788 | if (CompilerCore.WixNamespace == child.Name.Namespace) | ||
| 789 | { | ||
| 790 | switch (child.Name.LocalName) | ||
| 791 | { | ||
| 792 | case "Payload": | ||
| 793 | previousId = this.ParsePayloadElement(child, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId, previousType, previousId); | ||
| 794 | previousType = ComplexReferenceChildType.Payload; | ||
| 795 | break; | ||
| 796 | case "PayloadGroupRef": | ||
| 797 | previousId = this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId, previousType, previousId); | ||
| 798 | previousType = ComplexReferenceChildType.PayloadGroup; | ||
| 799 | break; | ||
| 800 | default: | ||
| 801 | this.Core.UnexpectedElement(node, child); | ||
| 802 | break; | ||
| 803 | } | ||
| 804 | } | ||
| 805 | else | ||
| 806 | { | ||
| 807 | this.Core.ParseExtensionElement(node, child); | ||
| 808 | } | ||
| 809 | } | ||
| 810 | |||
| 811 | if (null == previousId) | ||
| 812 | { | ||
| 813 | // We need *either* <Payload> or <PayloadGroupRef> or even just @SourceFile on the BundleExtension... | ||
| 814 | // but we just say there's a missing <Payload>. | ||
| 815 | // TODO: Is there a better message for this? | ||
| 816 | this.Core.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "Payload")); | ||
| 817 | } | ||
| 818 | |||
| 819 | if (null == id) | ||
| 820 | { | ||
| 821 | this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | ||
| 822 | } | ||
| 823 | |||
| 824 | // Add the BundleExtension. | ||
| 825 | if (!this.Core.EncounteredError) | ||
| 826 | { | ||
| 827 | var tuple = new WixBundleExtensionTuple(sourceLineNumbers, id) | ||
| 828 | { | ||
| 829 | PayloadRef = id.Id, | ||
| 830 | }; | ||
| 831 | this.Core.AddTuple(tuple); | ||
| 832 | } | ||
| 833 | } | ||
| 834 | |||
| 835 | /// <summary> | ||
| 763 | /// Parse the OptionalUpdateRegistration element. | 836 | /// Parse the OptionalUpdateRegistration element. |
| 764 | /// </summary> | 837 | /// </summary> |
| 765 | /// <param name="node">The element to parse.</param> | 838 | /// <param name="node">The element to parse.</param> |
