diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-05-13 15:39:40 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-05-14 11:12:31 -0500 |
commit | d5985a1688bc878e42ffd3ce3939fa52303cab16 (patch) | |
tree | 0c283fe5454659c569317b37840a040474cfa032 /src/ext/Bal/wixext | |
parent | 6a6974a15deb6edf593736cdb8043bfb93064782 (diff) | |
download | wix-d5985a1688bc878e42ffd3ce3939fa52303cab16.tar.gz wix-d5985a1688bc878e42ffd3ce3939fa52303cab16.tar.bz2 wix-d5985a1688bc878e42ffd3ce3939fa52303cab16.zip |
Add option to hosts to always install prereqs.
Add PrereqPackage to BundlePackage
Implements 4718
Diffstat (limited to 'src/ext/Bal/wixext')
-rw-r--r-- | src/ext/Bal/wixext/BalBurnBackendExtension.cs | 1 | ||||
-rw-r--r-- | src/ext/Bal/wixext/BalCompiler.cs | 27 | ||||
-rw-r--r-- | src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs | 5 | ||||
-rw-r--r-- | src/ext/Bal/wixext/Symbols/WixMbaPrereqOptionsSymbol.cs | 47 |
4 files changed, 79 insertions, 1 deletions
diff --git a/src/ext/Bal/wixext/BalBurnBackendExtension.cs b/src/ext/Bal/wixext/BalBurnBackendExtension.cs index 3b19ae78..d34c159a 100644 --- a/src/ext/Bal/wixext/BalBurnBackendExtension.cs +++ b/src/ext/Bal/wixext/BalBurnBackendExtension.cs | |||
@@ -24,6 +24,7 @@ namespace WixToolset.Bal | |||
24 | BalSymbolDefinitions.WixMbaPrereqInformation, | 24 | BalSymbolDefinitions.WixMbaPrereqInformation, |
25 | BalSymbolDefinitions.WixStdbaOptions, | 25 | BalSymbolDefinitions.WixStdbaOptions, |
26 | BalSymbolDefinitions.WixStdbaOverridableVariable, | 26 | BalSymbolDefinitions.WixStdbaOverridableVariable, |
27 | BalSymbolDefinitions.WixMbaPrereqOptions, | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | protected override IReadOnlyCollection<IntermediateSymbolDefinition> SymbolDefinitions => BurnSymbolDefinitions; | 30 | protected override IReadOnlyCollection<IntermediateSymbolDefinition> SymbolDefinitions => BurnSymbolDefinitions; |
diff --git a/src/ext/Bal/wixext/BalCompiler.cs b/src/ext/Bal/wixext/BalCompiler.cs index 267345e7..1721f252 100644 --- a/src/ext/Bal/wixext/BalCompiler.cs +++ b/src/ext/Bal/wixext/BalCompiler.cs | |||
@@ -117,6 +117,7 @@ namespace WixToolset.Bal | |||
117 | 117 | ||
118 | switch (parentElement.Name.LocalName) | 118 | switch (parentElement.Name.LocalName) |
119 | { | 119 | { |
120 | case "BundlePackage": | ||
120 | case "ExePackage": | 121 | case "ExePackage": |
121 | case "MsiPackage": | 122 | case "MsiPackage": |
122 | case "MspPackage": | 123 | case "MspPackage": |
@@ -216,7 +217,7 @@ namespace WixToolset.Bal | |||
216 | case "PrereqPackage": | 217 | case "PrereqPackage": |
217 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute)) | 218 | if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute)) |
218 | { | 219 | { |
219 | if (!this.prereqInfoSymbolsByPackageId.TryGetValue(packageId, out prereqInfo)) | 220 | if (!this.prereqInfoSymbolsByPackageId.TryGetValue(packageId, out _)) |
220 | { | 221 | { |
221 | prereqInfo = section.AddSymbol(new WixMbaPrereqInformationSymbol(sourceLineNumbers) | 222 | prereqInfo = section.AddSymbol(new WixMbaPrereqInformationSymbol(sourceLineNumbers) |
222 | { | 223 | { |
@@ -703,6 +704,7 @@ namespace WixToolset.Bal | |||
703 | private void ParseWixManagedBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node) | 704 | private void ParseWixManagedBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node) |
704 | { | 705 | { |
705 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); | 706 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); |
707 | bool alwaysInstallPrereqs = false; | ||
706 | string logoFile = null; | 708 | string logoFile = null; |
707 | string themeFile = null; | 709 | string themeFile = null; |
708 | string localizationFile = null; | 710 | string localizationFile = null; |
@@ -714,6 +716,9 @@ namespace WixToolset.Bal | |||
714 | { | 716 | { |
715 | switch (attrib.Name.LocalName) | 717 | switch (attrib.Name.LocalName) |
716 | { | 718 | { |
719 | case "AlwaysInstallPrereqs": | ||
720 | alwaysInstallPrereqs = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib) == YesNoType.Yes; | ||
721 | break; | ||
717 | case "LogoFile": | 722 | case "LogoFile": |
718 | logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 723 | logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
719 | break; | 724 | break; |
@@ -792,6 +797,14 @@ namespace WixToolset.Bal | |||
792 | } | 797 | } |
793 | 798 | ||
794 | this.CreateBARef(section, sourceLineNumbers, node, baId); | 799 | this.CreateBARef(section, sourceLineNumbers, node, baId); |
800 | |||
801 | if (alwaysInstallPrereqs) | ||
802 | { | ||
803 | section.AddSymbol(new WixMbaPrereqOptionsSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixMbaPrereqOptions")) | ||
804 | { | ||
805 | AlwaysInstallPrereqs = 1, | ||
806 | }); | ||
807 | } | ||
795 | } | 808 | } |
796 | } | 809 | } |
797 | 810 | ||
@@ -802,6 +815,7 @@ namespace WixToolset.Bal | |||
802 | private void ParseWixDotNetCoreBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node) | 815 | private void ParseWixDotNetCoreBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node) |
803 | { | 816 | { |
804 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); | 817 | var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); |
818 | bool alwaysInstallPrereqs = false; | ||
805 | string logoFile = null; | 819 | string logoFile = null; |
806 | string themeFile = null; | 820 | string themeFile = null; |
807 | string localizationFile = null; | 821 | string localizationFile = null; |
@@ -814,6 +828,9 @@ namespace WixToolset.Bal | |||
814 | { | 828 | { |
815 | switch (attrib.Name.LocalName) | 829 | switch (attrib.Name.LocalName) |
816 | { | 830 | { |
831 | case "AlwaysInstallPrereqs": | ||
832 | alwaysInstallPrereqs = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib) == YesNoType.Yes; | ||
833 | break; | ||
817 | case "LogoFile": | 834 | case "LogoFile": |
818 | logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); | 835 | logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); |
819 | break; | 836 | break; |
@@ -903,6 +920,14 @@ namespace WixToolset.Bal | |||
903 | } | 920 | } |
904 | 921 | ||
905 | this.CreateBARef(section, sourceLineNumbers, node, baId); | 922 | this.CreateBARef(section, sourceLineNumbers, node, baId); |
923 | |||
924 | if (alwaysInstallPrereqs) | ||
925 | { | ||
926 | section.AddSymbol(new WixMbaPrereqOptionsSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixMbaPrereqOptions")) | ||
927 | { | ||
928 | AlwaysInstallPrereqs = 1, | ||
929 | }); | ||
930 | } | ||
906 | } | 931 | } |
907 | } | 932 | } |
908 | 933 | ||
diff --git a/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs b/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs index 90865621..9010ce2d 100644 --- a/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs +++ b/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs | |||
@@ -16,6 +16,7 @@ namespace WixToolset.Bal | |||
16 | WixMbaPrereqInformation, | 16 | WixMbaPrereqInformation, |
17 | WixStdbaOptions, | 17 | WixStdbaOptions, |
18 | WixStdbaOverridableVariable, | 18 | WixStdbaOverridableVariable, |
19 | WixMbaPrereqOptions, | ||
19 | } | 20 | } |
20 | 21 | ||
21 | public static partial class BalSymbolDefinitions | 22 | public static partial class BalSymbolDefinitions |
@@ -60,6 +61,9 @@ namespace WixToolset.Bal | |||
60 | case BalSymbolDefinitionType.WixStdbaOverridableVariable: | 61 | case BalSymbolDefinitionType.WixStdbaOverridableVariable: |
61 | return BalSymbolDefinitions.WixStdbaOverridableVariable; | 62 | return BalSymbolDefinitions.WixStdbaOverridableVariable; |
62 | 63 | ||
64 | case BalSymbolDefinitionType.WixMbaPrereqOptions: | ||
65 | return BalSymbolDefinitions.WixMbaPrereqOptions; | ||
66 | |||
63 | default: | 67 | default: |
64 | throw new ArgumentOutOfRangeException(nameof(type)); | 68 | throw new ArgumentOutOfRangeException(nameof(type)); |
65 | } | 69 | } |
@@ -75,6 +79,7 @@ namespace WixToolset.Bal | |||
75 | WixMbaPrereqInformation.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 79 | WixMbaPrereqInformation.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
76 | WixStdbaOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 80 | WixStdbaOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
77 | WixStdbaOverridableVariable.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 81 | WixStdbaOverridableVariable.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
82 | WixMbaPrereqOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | ||
78 | } | 83 | } |
79 | } | 84 | } |
80 | } | 85 | } |
diff --git a/src/ext/Bal/wixext/Symbols/WixMbaPrereqOptionsSymbol.cs b/src/ext/Bal/wixext/Symbols/WixMbaPrereqOptionsSymbol.cs new file mode 100644 index 00000000..66374579 --- /dev/null +++ b/src/ext/Bal/wixext/Symbols/WixMbaPrereqOptionsSymbol.cs | |||
@@ -0,0 +1,47 @@ | |||
1 | // 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. | ||
2 | |||
3 | namespace WixToolset.Bal | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Bal.Symbols; | ||
7 | |||
8 | public static partial class BalSymbolDefinitions | ||
9 | { | ||
10 | public static readonly IntermediateSymbolDefinition WixMbaPrereqOptions = new IntermediateSymbolDefinition( | ||
11 | BalSymbolDefinitionType.WixMbaPrereqOptions.ToString(), | ||
12 | new[] | ||
13 | { | ||
14 | new IntermediateFieldDefinition(nameof(WixMbaPrereqOptionsSymbolFields.AlwaysInstallPrereqs), IntermediateFieldType.Number), | ||
15 | }, | ||
16 | typeof(WixMbaPrereqOptionsSymbol)); | ||
17 | } | ||
18 | } | ||
19 | |||
20 | namespace WixToolset.Bal.Symbols | ||
21 | { | ||
22 | using WixToolset.Data; | ||
23 | |||
24 | public enum WixMbaPrereqOptionsSymbolFields | ||
25 | { | ||
26 | AlwaysInstallPrereqs, | ||
27 | } | ||
28 | |||
29 | public class WixMbaPrereqOptionsSymbol : IntermediateSymbol | ||
30 | { | ||
31 | public WixMbaPrereqOptionsSymbol() : base(BalSymbolDefinitions.WixMbaPrereqOptions, null, null) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | public WixMbaPrereqOptionsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixMbaPrereqOptions, sourceLineNumber, id) | ||
36 | { | ||
37 | } | ||
38 | |||
39 | public IntermediateField this[WixMbaPrereqOptionsSymbolFields index] => this.Fields[(int)index]; | ||
40 | |||
41 | public int AlwaysInstallPrereqs | ||
42 | { | ||
43 | get => this.Fields[(int)WixMbaPrereqOptionsSymbolFields.AlwaysInstallPrereqs].AsNumber(); | ||
44 | set => this.Set((int)WixMbaPrereqOptionsSymbolFields.AlwaysInstallPrereqs, value); | ||
45 | } | ||
46 | } | ||
47 | } | ||