diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-23 12:01:31 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-23 12:43:38 +1000 |
| commit | d686f0d92fc14940441dbf53c28547a975572f92 (patch) | |
| tree | 4003440a0990ae09d77547c41b83da22806f4b02 /src/wixext | |
| parent | 6585189c97d73dee54a490e1c98f1872f422f7c0 (diff) | |
| download | wix-d686f0d92fc14940441dbf53c28547a975572f92.tar.gz wix-d686f0d92fc14940441dbf53c28547a975572f92.tar.bz2 wix-d686f0d92fc14940441dbf53c28547a975572f92.zip | |
Add ManagedBootstrapperApplicationPrereqInformation element to move prereq info back to NetFx.
Diffstat (limited to 'src/wixext')
| -rw-r--r-- | src/wixext/BalCompiler.cs | 65 | ||||
| -rw-r--r-- | src/wixext/bal.xsd | 29 |
2 files changed, 94 insertions, 0 deletions
diff --git a/src/wixext/BalCompiler.cs b/src/wixext/BalCompiler.cs index c291d41f..da32234c 100644 --- a/src/wixext/BalCompiler.cs +++ b/src/wixext/BalCompiler.cs | |||
| @@ -46,6 +46,9 @@ namespace WixToolset.Bal | |||
| 46 | case "Condition": | 46 | case "Condition": |
| 47 | this.ParseConditionElement(intermediate, section, element); | 47 | this.ParseConditionElement(intermediate, section, element); |
| 48 | break; | 48 | break; |
| 49 | case "ManagedBootstrapperApplicationPrereqInformation": | ||
| 50 | this.ParseMbaPrereqInfoElement(intermediate, section, element); | ||
| 51 | break; | ||
| 49 | default: | 52 | default: |
| 50 | this.ParseHelper.UnexpectedElement(parentElement, element); | 53 | this.ParseHelper.UnexpectedElement(parentElement, element); |
| 51 | break; | 54 | break; |
| @@ -293,6 +296,68 @@ namespace WixToolset.Bal | |||
| 293 | } | 296 | } |
| 294 | 297 | ||
| 295 | /// <summary> | 298 | /// <summary> |
| 299 | /// Parses a Condition element for Bundles. | ||
| 300 | /// </summary> | ||
| 301 | /// <param name="node">The element to parse.</param> | ||
| 302 | private void ParseMbaPrereqInfoElement(Intermediate intermediate, IntermediateSection section, XElement node) | ||
| 303 | { | ||
| 304 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); | ||
| 305 | string packageId = null; | ||
| 306 | string licenseFile = null; | ||
| 307 | string licenseUrl = null; | ||
| 308 | |||
| 309 | foreach (var attrib in node.Attributes()) | ||
| 310 | { | ||
| 311 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
| 312 | { | ||
| 313 | switch (attrib.Name.LocalName) | ||
| 314 | { | ||
| 315 | case "LicenseFile": | ||
| 316 | licenseFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 317 | break; | ||
| 318 | case "LicenseUrl": | ||
| 319 | licenseUrl = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 320 | break; | ||
| 321 | case "PackageId": | ||
| 322 | packageId = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
| 323 | break; | ||
| 324 | default: | ||
| 325 | this.ParseHelper.UnexpectedAttribute(node, attrib); | ||
| 326 | break; | ||
| 327 | } | ||
| 328 | } | ||
| 329 | else | ||
| 330 | { | ||
| 331 | this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); | ||
| 332 | } | ||
| 333 | } | ||
| 334 | |||
| 335 | this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); | ||
| 336 | |||
| 337 | if (null == packageId) | ||
| 338 | { | ||
| 339 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "PackageId")); | ||
| 340 | } | ||
| 341 | |||
| 342 | if (null == licenseFile && null == licenseUrl || | ||
| 343 | null != licenseFile && null != licenseUrl) | ||
| 344 | { | ||
| 345 | this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "LicenseFile", "LicenseUrl", true)); | ||
| 346 | } | ||
| 347 | |||
| 348 | if (!this.Messaging.EncounteredError) | ||
| 349 | { | ||
| 350 | section.AddTuple(new WixMbaPrereqInformationTuple(sourceLineNumbers) | ||
| 351 | { | ||
| 352 | PackageId = packageId, | ||
| 353 | LicenseFile = licenseFile, | ||
| 354 | LicenseUrl = licenseUrl, | ||
| 355 | }); | ||
| 356 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.WixBundlePackage, packageId); | ||
| 357 | } | ||
| 358 | } | ||
| 359 | |||
| 360 | /// <summary> | ||
| 296 | /// Parses a WixStandardBootstrapperApplication element for Bundles. | 361 | /// Parses a WixStandardBootstrapperApplication element for Bundles. |
| 297 | /// </summary> | 362 | /// </summary> |
| 298 | /// <param name="node">The element to parse.</param> | 363 | /// <param name="node">The element to parse.</param> |
diff --git a/src/wixext/bal.xsd b/src/wixext/bal.xsd index 73f10540..3081a279 100644 --- a/src/wixext/bal.xsd +++ b/src/wixext/bal.xsd | |||
| @@ -186,6 +186,35 @@ | |||
| 186 | </xs:complexType> | 186 | </xs:complexType> |
| 187 | </xs:element> | 187 | </xs:element> |
| 188 | 188 | ||
| 189 | <xs:element name="ManagedBootstrapperApplicationPrereqInformation"> | ||
| 190 | <xs:annotation> | ||
| 191 | <xs:documentation> | ||
| 192 | Adds license information for a prereq package, should only be used when unable to add the license attributes to the package directly. | ||
| 193 | </xs:documentation> | ||
| 194 | <xs:appinfo> | ||
| 195 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" /> | ||
| 196 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" /> | ||
| 197 | </xs:appinfo> | ||
| 198 | </xs:annotation> | ||
| 199 | <xs:complexType> | ||
| 200 | <xs:attribute name="PackageId" type="xs:string" use="required"> | ||
| 201 | <xs:annotation> | ||
| 202 | <xs:documentation>Id of the target package.</xs:documentation> | ||
| 203 | </xs:annotation> | ||
| 204 | </xs:attribute> | ||
| 205 | <xs:attribute name="LicenseFile" type="xs:string"> | ||
| 206 | <xs:annotation> | ||
| 207 | <xs:documentation>Source file of the license. May not be used with LicenseUrl.</xs:documentation> | ||
| 208 | </xs:annotation> | ||
| 209 | </xs:attribute> | ||
| 210 | <xs:attribute name="LicenseUrl" type="xs:string"> | ||
| 211 | <xs:annotation> | ||
| 212 | <xs:documentation>Source url of the license. May not be used with LicenseFile.</xs:documentation> | ||
| 213 | </xs:annotation> | ||
| 214 | </xs:attribute> | ||
| 215 | </xs:complexType> | ||
| 216 | </xs:element> | ||
| 217 | |||
| 189 | <xs:attribute name="BAFunctions" type="YesNoType"> | 218 | <xs:attribute name="BAFunctions" type="YesNoType"> |
| 190 | <xs:annotation> | 219 | <xs:annotation> |
| 191 | <xs:documentation> | 220 | <xs:documentation> |
