@joebigelow / wix-1 / commits / d686f0d9

Add ManagedBootstrapperApplicationPrereqInformation element to move prereq info back to NetFx.

Sean Hall committed Apr 23, 2020 at 12:01 UTC d686f0d92fc14940441dbf53c28547a975572f92
10 files changed +94 -282
src/wixext/BalCompiler.cs
+65
@@ -46,6 +46,9 @@ namespace WixToolset.Bal
46 case "Condition":
47 this.ParseConditionElement(intermediate, section, element);
48 break;
49 + case "ManagedBootstrapperApplicationPrereqInformation":
50 + this.ParseMbaPrereqInfoElement(intermediate, section, element);
51 + break;
52 default:
53 this.ParseHelper.UnexpectedElement(parentElement, element);
54 break;
@@ -292,6 +295,68 @@ namespace WixToolset.Bal
295 }
296 }
297
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>
361 /// Parses a WixStandardBootstrapperApplication element for Bundles.
362 /// </summary>
src/wixext/bal.xsd
+29
@@ -186,6 +186,35 @@
186 </xs:complexType>
187 </xs:element>
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 +
218 <xs:attribute name="BAFunctions" type="YesNoType">
219 <xs:annotation>
220 <xs:documentation>
src/wixlib/NetFx451AsPrereq.wxs deleted
-34
@@ -1,34 +0,0 @@
1 -<?xml version='1.0' encoding='utf-8'?>
2 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 -
4 -
5 -<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
6 - <?define NetFx451EulaLink = http://wixtoolset.org/licenses/netfx451 ?>
7 - <?define NetFx451WebId = NetFx451Web ?>
8 - <Fragment>
9 - <PackageGroup Id="$(var.NetFx451WebId)AsPrereq">
10 - <PackageGroupRef Id="$(var.NetFx451WebId)" />
11 - </PackageGroup>
12 -
13 - <CustomTable Id='WixMbaPrereqInformation'>
14 - <Row>
15 - <Data Column='PackageId'>$(var.NetFx451WebId)</Data>
16 - <Data Column='LicenseUrl'>$(var.NetFx451EulaLink)</Data>
17 - </Row>
18 - </CustomTable>
19 - </Fragment>
20 -
21 - <?define NetFx451RedistId = NetFx451Redist ?>
22 - <Fragment>
23 - <PackageGroup Id="$(var.NetFx451RedistId)AsPrereq">
24 - <PackageGroupRef Id="$(var.NetFx451RedistId)" />
25 - </PackageGroup>
26 -
27 - <CustomTable Id='WixMbaPrereqInformation'>
28 - <Row>
29 - <Data Column='PackageId'>$(var.NetFx451RedistId)</Data>
30 - <Data Column='LicenseUrl'>$(var.NetFx451EulaLink)</Data>
31 - </Row>
32 - </CustomTable>
33 - </Fragment>
34 -</Wix>
src/wixlib/NetFx452AsPrereq.wxs deleted
-34
@@ -1,34 +0,0 @@
1 -<?xml version='1.0' encoding='utf-8'?>
2 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 -
4 -
5 -<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
6 - <?define NetFx452EulaLink = http://wixtoolset.org/licenses/netfx452 ?>
7 - <?define NetFx452WebId = NetFx452Web ?>
8 - <Fragment>
9 - <PackageGroup Id="$(var.NetFx452WebId)AsPrereq">
10 - <PackageGroupRef Id="$(var.NetFx452WebId)" />
11 - </PackageGroup>
12 -
13 - <CustomTable Id='WixMbaPrereqInformation'>
14 - <Row>
15 - <Data Column='PackageId'>$(var.NetFx452WebId)</Data>
16 - <Data Column='LicenseUrl'>$(var.NetFx452EulaLink)</Data>
17 - </Row>
18 - </CustomTable>
19 - </Fragment>
20 -
21 - <?define NetFx452RedistId = NetFx452Redist ?>
22 - <Fragment>
23 - <PackageGroup Id="$(var.NetFx452RedistId)AsPrereq">
24 - <PackageGroupRef Id="$(var.NetFx452RedistId)" />
25 - </PackageGroup>
26 -
27 - <CustomTable Id='WixMbaPrereqInformation'>
28 - <Row>
29 - <Data Column='PackageId'>$(var.NetFx452RedistId)</Data>
30 - <Data Column='LicenseUrl'>$(var.NetFx452EulaLink)</Data>
31 - </Row>
32 - </CustomTable>
33 - </Fragment>
34 -</Wix>
src/wixlib/NetFx45AsPrereq.wxs deleted
-34
@@ -1,34 +0,0 @@
1 -<?xml version='1.0' encoding='utf-8'?>
2 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 -
4 -
5 -<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
6 - <?define NetFx45EulaLink = http://go.microsoft.com/fwlink/?LinkID=260867 ?>
7 - <?define NetFx45WebId = NetFx45Web ?>
8 - <Fragment>
9 - <PackageGroup Id="$(var.NetFx45WebId)AsPrereq">
10 - <PackageGroupRef Id="$(var.NetFx45WebId)" />
11 - </PackageGroup>
12 -
13 - <CustomTable Id='WixMbaPrereqInformation'>
14 - <Row>
15 - <Data Column='PackageId'>$(var.NetFx45WebId)</Data>
16 - <Data Column='LicenseUrl'>$(var.NetFx45EulaLink)</Data>
17 - </Row>
18 - </CustomTable>
19 - </Fragment>
20 -
21 - <?define NetFx45RedistId = NetFx45Redist ?>
22 - <Fragment>
23 - <PackageGroup Id="$(var.NetFx45RedistId)AsPrereq">
24 - <PackageGroupRef Id="$(var.NetFx45RedistId)" />
25 - </PackageGroup>
26 -
27 - <CustomTable Id='WixMbaPrereqInformation'>
28 - <Row>
29 - <Data Column='PackageId'>$(var.NetFx45RedistId)</Data>
30 - <Data Column='LicenseUrl'>$(var.NetFx45EulaLink)</Data>
31 - </Row>
32 - </CustomTable>
33 - </Fragment>
34 -</Wix>
src/wixlib/NetFx461AsPrereq.wxs deleted
-34
@@ -1,34 +0,0 @@
1 -<?xml version='1.0' encoding='utf-8'?>
2 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 -
4 -
5 -<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
6 - <?define NetFx461EulaLink = http://referencesource.microsoft.com/license.html ?>
7 - <?define NetFx461WebId = NetFx461Web ?>
8 - <Fragment>
9 - <PackageGroup Id="$(var.NetFx461WebId)AsPrereq">
10 - <PackageGroupRef Id="$(var.NetFx461WebId)" />
11 - </PackageGroup>
12 -
13 - <CustomTable Id='WixMbaPrereqInformation'>
14 - <Row>
15 - <Data Column='PackageId'>$(var.NetFx461WebId)</Data>
16 - <Data Column='LicenseUrl'>$(var.NetFx461EulaLink)</Data>
17 - </Row>
18 - </CustomTable>
19 - </Fragment>
20 -
21 - <?define NetFx461RedistId = NetFx461Redist ?>
22 - <Fragment>
23 - <PackageGroup Id="$(var.NetFx461RedistId)AsPrereq">
24 - <PackageGroupRef Id="$(var.NetFx461RedistId)" />
25 - </PackageGroup>
26 -
27 - <CustomTable Id='WixMbaPrereqInformation'>
28 - <Row>
29 - <Data Column='PackageId'>$(var.NetFx461RedistId)</Data>
30 - <Data Column='LicenseUrl'>$(var.NetFx461EulaLink)</Data>
31 - </Row>
32 - </CustomTable>
33 - </Fragment>
34 -</Wix>
src/wixlib/NetFx462AsPrereq.wxs deleted
-34
@@ -1,34 +0,0 @@
1 -<?xml version='1.0' encoding='utf-8'?>
2 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 -
4 -
5 -<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
6 - <?define NetFx462EulaLink = http://referencesource.microsoft.com/license.html ?>
7 - <?define NetFx462WebId = NetFx462Web ?>
8 - <Fragment>
9 - <PackageGroup Id="$(var.NetFx462WebId)AsPrereq">
10 - <PackageGroupRef Id="$(var.NetFx462WebId)" />
11 - </PackageGroup>
12 -
13 - <CustomTable Id='WixMbaPrereqInformation'>
14 - <Row>
15 - <Data Column='PackageId'>$(var.NetFx462WebId)</Data>
16 - <Data Column='LicenseUrl'>$(var.NetFx462EulaLink)</Data>
17 - </Row>
18 - </CustomTable>
19 - </Fragment>
20 -
21 - <?define NetFx462RedistId = NetFx462Redist ?>
22 - <Fragment>
23 - <PackageGroup Id="$(var.NetFx462RedistId)AsPrereq">
24 - <PackageGroupRef Id="$(var.NetFx462RedistId)" />
25 - </PackageGroup>
26 -
27 - <CustomTable Id='WixMbaPrereqInformation'>
28 - <Row>
29 - <Data Column='PackageId'>$(var.NetFx462RedistId)</Data>
30 - <Data Column='LicenseUrl'>$(var.NetFx462EulaLink)</Data>
31 - </Row>
32 - </CustomTable>
33 - </Fragment>
34 -</Wix>
src/wixlib/NetFx46AsPrereq.wxs deleted
-34
@@ -1,34 +0,0 @@
1 -<?xml version='1.0' encoding='utf-8'?>
2 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 -
4 -
5 -<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
6 - <?define NetFx46EulaLink = http://go.microsoft.com/fwlink/?LinkID=558772 ?>
7 - <?define NetFx46WebId = NetFx46Web ?>
8 - <Fragment>
9 - <PackageGroup Id="$(var.NetFx46WebId)AsPrereq">
10 - <PackageGroupRef Id="$(var.NetFx46WebId)" />
11 - </PackageGroup>
12 -
13 - <CustomTable Id='WixMbaPrereqInformation'>
14 - <Row>
15 - <Data Column='PackageId'>$(var.NetFx46WebId)</Data>
16 - <Data Column='LicenseUrl'>$(var.NetFx46EulaLink)</Data>
17 - </Row>
18 - </CustomTable>
19 - </Fragment>
20 -
21 - <?define NetFx46RedistId = NetFx46Redist ?>
22 - <Fragment>
23 - <PackageGroup Id="$(var.NetFx46RedistId)AsPrereq">
24 - <PackageGroupRef Id="$(var.NetFx46RedistId)" />
25 - </PackageGroup>
26 -
27 - <CustomTable Id='WixMbaPrereqInformation'>
28 - <Row>
29 - <Data Column='PackageId'>$(var.NetFx46RedistId)</Data>
30 - <Data Column='LicenseUrl'>$(var.NetFx46EulaLink)</Data>
31 - </Row>
32 - </CustomTable>
33 - </Fragment>
34 -</Wix>
src/wixlib/NetFx4AsPrereq.wxs deleted
-71
@@ -1,71 +0,0 @@
1 -<?xml version='1.0' encoding='utf-8'?>
2 -<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3 -
4 -
5 -<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
6 - <?define NetFx40EulaLink = http://go.microsoft.com/fwlink/?LinkID=188993 ?>
7 - <?define NetFx40WebId = NetFx40Web ?>
8 - <Fragment>
9 - <PackageGroup Id="$(var.NetFx40WebId)AsPrereq">
10 - <PackageGroupRef Id="$(var.NetFx40WebId)" />
11 - </PackageGroup>
12 -
13 - <CustomTable Id='WixMbaPrereqInformation'>
14 - <Row>
15 - <Data Column='PackageId'>$(var.NetFx40WebId)</Data>
16 - <Data Column='LicenseUrl'>$(var.NetFx40EulaLink)</Data>
17 - </Row>
18 - </CustomTable>
19 - </Fragment>
20 -
21 - <?define NetFx40RedistId = NetFx40Redist ?>
22 - <Fragment>
23 - <PackageGroup Id="$(var.NetFx40RedistId)AsPrereq">
24 - <PackageGroupRef Id="$(var.NetFx40RedistId)" />
25 - </PackageGroup>
26 -
27 - <CustomTable Id='WixMbaPrereqInformation'>
28 - <Row>
29 - <Data Column='PackageId'>$(var.NetFx40RedistId)</Data>
30 - <Data Column='LicenseUrl'>$(var.NetFx40EulaLink)</Data>
31 - </Row>
32 - </CustomTable>
33 - </Fragment>
34 -
35 - <?define NetFx40ClientWebId = NetFx40ClientWeb ?>
36 - <Fragment>
37 - <PackageGroup Id="$(var.NetFx40ClientWebId)AsPrereq">
38 - <PackageGroupRef Id="$(var.NetFx40ClientWebId)" />
39 - </PackageGroup>
40 -
41 - <CustomTable Id='WixMbaPrereqInformation'>
42 - <Row>
43 - <Data Column='PackageId'>$(var.NetFx40ClientWebId)</Data>
44 - <Data Column='LicenseUrl'>$(var.NetFx40EulaLink)</Data>
45 - </Row>
46 - </CustomTable>
47 - </Fragment>
48 -
49 - <?define NetFx40ClientRedistId = NetFx40ClientRedist ?>
50 - <Fragment>
51 - <PackageGroup Id="$(var.NetFx40ClientRedistId)AsPrereq">
52 - <PackageGroupRef Id="$(var.NetFx40ClientRedistId)" />
53 - </PackageGroup>
54 -
55 - <CustomTable Id='WixMbaPrereqInformation'>
56 - <Row>
57 - <Data Column='PackageId'>$(var.NetFx40ClientRedistId)</Data>
58 - <Data Column='LicenseUrl'>$(var.NetFx40EulaLink)</Data>
59 - </Row>
60 - </CustomTable>
61 - </Fragment>
62 -
63 - <!-- Not sure why we have to redefine the table here. -->
64 - <Fragment>
65 - <CustomTable Id='WixMbaPrereqInformation' Unreal='yes'>
66 - <Column Id='PackageId' Category='Identifier' Type='string' Width='72' PrimaryKey ='yes'/>
67 - <Column Id='LicenseUrl' Category='Formatted' Type='string' Width='0' Nullable='yes'/>
68 - <Column Id='LicenseFile' Category='Formatted' Type='string' Width='0' Nullable='yes'/>
69 - </CustomTable>
70 - </Fragment>
71 -</Wix>
src/wixlib/bal.wixproj
-7
@@ -15,13 +15,6 @@
15 <ItemGroup>
16 <Compile Include="BalExtension.wxs" />
17 <Compile Include="Mba.wxs" />
18 - <Compile Include="NetFx4AsPrereq.wxs" />
19 - <Compile Include="NetFx45AsPrereq.wxs" />
20 - <Compile Include="NetFx451AsPrereq.wxs" />
21 - <Compile Include="NetFx452AsPrereq.wxs" />
22 - <Compile Include="NetFx46AsPrereq.wxs" />
23 - <Compile Include="NetFx461AsPrereq.wxs" />
24 - <Compile Include="NetFx462AsPrereq.wxs" />
18 <Compile Include="wixstdba.wxs" />
19 <Compile Include="wixstdba_x86.wxs" />
20 </ItemGroup>