diff options
Diffstat (limited to 'src/WixToolset.Core/Compiler_Bundle.cs')
| -rw-r--r-- | src/WixToolset.Core/Compiler_Bundle.cs | 73 |
1 files changed, 73 insertions, 0 deletions
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> |
