From 0d3d54992104288e9ee0c834d0b96e8502fd2d42 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 11 Jan 2024 18:26:20 -0800 Subject: Move the BootstrapperApplication out of proc --- src/ext/Bal/wixext/BalBurnBackendExtension.cs | 74 ++---- src/ext/Bal/wixext/BalCompiler.cs | 289 ++++++++++++++++----- src/ext/Bal/wixext/BalErrors.cs | 12 +- src/ext/Bal/wixext/BalWarnings.cs | 6 + src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs | 24 +- .../Symbols/WixBalBAFactoryAssemblySymbol.cs | 7 +- .../Symbols/WixBalBootstrapperApplicationSymbol.cs | 4 + src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs | 47 ---- .../Symbols/WixMbaPrereqInformationSymbol.cs | 63 ----- .../wixext/Symbols/WixMbaPrereqOptionsSymbol.cs | 47 ---- .../wixext/Symbols/WixPrereqInformationSymbol.cs | 63 +++++ .../Bal/wixext/Symbols/WixPrereqOptionsSymbol.cs | 63 +++++ 12 files changed, 399 insertions(+), 300 deletions(-) delete mode 100644 src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs delete mode 100644 src/ext/Bal/wixext/Symbols/WixMbaPrereqInformationSymbol.cs delete mode 100644 src/ext/Bal/wixext/Symbols/WixMbaPrereqOptionsSymbol.cs create mode 100644 src/ext/Bal/wixext/Symbols/WixPrereqInformationSymbol.cs create mode 100644 src/ext/Bal/wixext/Symbols/WixPrereqOptionsSymbol.cs (limited to 'src/ext/Bal/wixext') diff --git a/src/ext/Bal/wixext/BalBurnBackendExtension.cs b/src/ext/Bal/wixext/BalBurnBackendExtension.cs index 0293b236..84e4323e 100644 --- a/src/ext/Bal/wixext/BalBurnBackendExtension.cs +++ b/src/ext/Bal/wixext/BalBurnBackendExtension.cs @@ -18,16 +18,17 @@ namespace WixToolset.Bal { private static readonly IntermediateSymbolDefinition[] BurnSymbolDefinitions = { +#pragma warning disable 0612 // obsolete BalSymbolDefinitions.WixBalBAFactoryAssembly, +#pragma warning restore 0612 BalSymbolDefinitions.WixBalBAFunctions, BalSymbolDefinitions.WixBalCondition, BalSymbolDefinitions.WixBalPackageInfo, - BalSymbolDefinitions.WixDncOptions, - BalSymbolDefinitions.WixMbaPrereqInformation, + BalSymbolDefinitions.WixPrereqInformation, BalSymbolDefinitions.WixStdbaCommandLine, BalSymbolDefinitions.WixStdbaOptions, BalSymbolDefinitions.WixStdbaOverridableVariable, - BalSymbolDefinitions.WixMbaPrereqOptions, + BalSymbolDefinitions.WixPrereqOptions, }; protected override IReadOnlyCollection SymbolDefinitions => BurnSymbolDefinitions; @@ -112,59 +113,28 @@ namespace WixToolset.Bal } var isIuiBA = balBaSymbol.Type == WixBalBootstrapperApplicationType.InternalUi; + var isPreqBA = balBaSymbol.Type == WixBalBootstrapperApplicationType.Prerequisite; var isStdBA = balBaSymbol.Type == WixBalBootstrapperApplicationType.Standard; - var isMBA = balBaSymbol.Type == WixBalBootstrapperApplicationType.ManagedHost; - var isDNC = balBaSymbol.Type == WixBalBootstrapperApplicationType.DotNetCoreHost; - var isSCD = isDNC && this.VerifySCD(section); - - if (!isIuiBA && !isStdBA && !isMBA && !isDNC) + if (!isIuiBA && !isPreqBA && !isStdBA) { throw new WixException($"Invalid WixBalBootstrapperApplicationType: '{balBaSymbol.Type}'"); } + this.VerifyBAFunctions(section); + if (isIuiBA) { // This needs to happen before VerifyPrereqPackages because it can add prereq packages. this.VerifyPrimaryPackages(section, balBaSymbol.SourceLineNumbers); } - if (isDNC) + if (isIuiBA || isPreqBA) { - this.FinalizeBAFactorySymbol(section, balBaSymbol.SourceLineNumbers); - } - - if (isIuiBA || isStdBA || isMBA || isDNC) - { - this.VerifyBAFunctions(section); - } - - if (isIuiBA || isMBA || (isDNC && !isSCD)) - { - this.VerifyPrereqPackages(section, balBaSymbol.SourceLineNumbers, isDNC, isIuiBA); + this.VerifyPrereqPackages(section, balBaSymbol.SourceLineNumbers, isIuiBA); } } - private void FinalizeBAFactorySymbol(IntermediateSection section, SourceLineNumber baSourceLineNumbers) - { - var factorySymbol = section.Symbols.OfType().SingleOrDefault(); - if (null == factorySymbol) - { - this.Messaging.Write(BalErrors.MissingDNCBAFactoryAssembly(baSourceLineNumbers)); - return; - } - - var factoryPayloadSymbol = section.Symbols.OfType() - .Where(p => p.Id.Id == factorySymbol.PayloadId) - .SingleOrDefault(); - if (null == factoryPayloadSymbol) - { - throw new WixException($"Missing payload symbol with id: 'factorySymbol.PayloadId'"); - } - - factorySymbol.FilePath = factoryPayloadSymbol.Name; - } - private void VerifyBAFunctions(IntermediateSection section) { WixBalBAFunctionsSymbol baFunctionsSymbol = null; @@ -234,7 +204,7 @@ namespace WixToolset.Bal var nonPermanentNonPrimaryPackages = new List(); var balPackageInfoSymbolsByPackageId = section.Symbols.OfType().ToDictionary(x => x.PackageId); - var mbaPrereqInfoSymbolsByPackageId = section.Symbols.OfType().ToDictionary(x => x.PackageId); + var mbaPrereqInfoSymbolsByPackageId = section.Symbols.OfType().ToDictionary(x => x.PackageId); var msiPackageSymbolsByPackageId = section.Symbols.OfType().ToDictionary(x => x.Id.Id); var packageSymbols = section.Symbols.OfType().ToList(); foreach (var packageSymbol in packageSymbols) @@ -263,7 +233,7 @@ namespace WixToolset.Bal { if (!isPrereq) { - var prereqInfoSymbol = section.AddSymbol(new WixMbaPrereqInformationSymbol(packageSymbol.SourceLineNumbers, new Identifier(AccessModifier.Global, packageId)) + var prereqInfoSymbol = section.AddSymbol(new WixPrereqInformationSymbol(packageSymbol.SourceLineNumbers, new Identifier(AccessModifier.Global, packageId)) { PackageId = packageId, }); @@ -476,13 +446,12 @@ namespace WixToolset.Bal } } - private void VerifyPrereqPackages(IntermediateSection section, SourceLineNumber baSourceLineNumbers, bool isDNC, bool isIuiBA) + private void VerifyPrereqPackages(IntermediateSection section, SourceLineNumber baSourceLineNumbers, bool isIuiBA) { - var prereqInfoSymbols = section.Symbols.OfType().ToList(); + var prereqInfoSymbols = section.Symbols.OfType().ToList(); if (!isIuiBA && prereqInfoSymbols.Count == 0) { - var message = isDNC ? BalErrors.MissingDNCPrereq(baSourceLineNumbers) : BalErrors.MissingMBAPrereq(baSourceLineNumbers); - this.Messaging.Write(message); + this.Messaging.Write(BalErrors.MissingPrereq(baSourceLineNumbers)); return; } @@ -514,18 +483,5 @@ namespace WixToolset.Bal } } } - - private bool VerifySCD(IntermediateSection section) - { - var isSCD = false; - - var dncOptions = section.Symbols.OfType().SingleOrDefault(); - if (dncOptions != null) - { - isSCD = dncOptions.SelfContainedDeployment != 0; - } - - return isSCD; - } } } diff --git a/src/ext/Bal/wixext/BalCompiler.cs b/src/ext/Bal/wixext/BalCompiler.cs index 72883bdf..829da0e6 100644 --- a/src/ext/Bal/wixext/BalCompiler.cs +++ b/src/ext/Bal/wixext/BalCompiler.cs @@ -7,6 +7,7 @@ namespace WixToolset.Bal using System.Xml.Linq; using WixToolset.Bal.Symbols; using WixToolset.Data; + using WixToolset.Data.Burn; using WixToolset.Data.Symbols; using WixToolset.Extensibility; using WixToolset.Extensibility.Data; @@ -17,16 +18,9 @@ namespace WixToolset.Bal public sealed class BalCompiler : BaseCompilerExtension { private readonly Dictionary packageInfoSymbolsByPackageId = new Dictionary(); - private readonly Dictionary prereqInfoSymbolsByPackageId = new Dictionary(); + private readonly Dictionary prereqInfoSymbolsByPackageId = new Dictionary(); - private enum WixDotNetCoreBootstrapperApplicationHostTheme - { - Unknown, - None, - Standard, - } - - private enum WixManagedBootstrapperApplicationHostTheme + private enum WixPrerequisiteBootstrapperApplicationTheme { Unknown, None, @@ -63,17 +57,35 @@ namespace WixToolset.Bal /// Extra information about the context in which this element is being parsed. public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) { + this.ParsePossibleKeyPathElement(intermediate, section, parentElement, element, context); + } + + /// + /// Processes an element for the Compiler. + /// + /// Source line number for the parent element. + /// Parent element of element to process. + /// Element to process. + /// Extra information about the context in which this element is being parsed. + public override IComponentKeyPath ParsePossibleKeyPathElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary context) + { + IComponentKeyPath exePayloadRef = null; + switch (parentElement.Name.LocalName) { case "Bundle": case "Fragment": switch (element.Name.LocalName) { + case "BootstrapperApplicationPrerequisiteInformation": + this.ParseBootstrapperApplicationPrerequisiteInformationElement(intermediate, section, element); + break; case "Condition": this.ParseConditionElement(intermediate, section, element); break; case "ManagedBootstrapperApplicationPrereqInformation": - this.ParseMbaPrereqInfoElement(intermediate, section, element); + this.Messaging.Write(WarningMessages.DeprecatedElement(this.ParseHelper.GetSourceLineNumbers(element), element.Name.LocalName, "BootstrapperApplicationPrerequisiteInformation")); + this.ParseBootstrapperApplicationPrerequisiteInformationElement(intermediate, section, element); break; default: this.ParseHelper.UnexpectedElement(parentElement, element); @@ -84,16 +96,19 @@ namespace WixToolset.Bal switch (element.Name.LocalName) { case "WixInternalUIBootstrapperApplication": - this.ParseWixInternalUIBootstrapperApplicationElement(intermediate, section, element); + exePayloadRef = this.ParseWixInternalUIBootstrapperApplicationElement(intermediate, section, element); + break; + case "WixPrerequisiteBootstrapperApplication": + this.ParseWixPrerequisiteBootstrapperApplicationElement(intermediate, section, element, context); break; case "WixStandardBootstrapperApplication": - this.ParseWixStandardBootstrapperApplicationElement(intermediate, section, element); + exePayloadRef = this.ParseWixStandardBootstrapperApplicationElement(intermediate, section, element); break; case "WixManagedBootstrapperApplicationHost": - this.ParseWixManagedBootstrapperApplicationHostElement(intermediate, section, element); + this.Messaging.Write(WarningMessages.DeprecatedElement(this.ParseHelper.GetSourceLineNumbers(element), element.Name.LocalName)); break; case "WixDotNetCoreBootstrapperApplicationHost": - this.ParseWixDotNetCoreBootstrapperApplicationHostElement(intermediate, section, element); + this.Messaging.Write(WarningMessages.DeprecatedElement(this.ParseHelper.GetSourceLineNumbers(element), element.Name.LocalName)); break; default: this.ParseHelper.UnexpectedElement(parentElement, element); @@ -104,6 +119,8 @@ namespace WixToolset.Bal this.ParseHelper.UnexpectedElement(parentElement, element); break; } + + return exePayloadRef; } /// @@ -282,15 +299,7 @@ namespace WixToolset.Bal switch (attribute.Name.LocalName) { case "BAFactoryAssembly": - if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute)) - { - // There can only be one. - var id = new Identifier(AccessModifier.Global, "TheBAFactoryAssembly"); - section.AddSymbol(new WixBalBAFactoryAssemblySymbol(sourceLineNumbers, id) - { - PayloadId = payloadId, - }); - } + this.Messaging.Write(BalWarnings.DeprecatedBAFactoryAssemblyAttribute(this.ParseHelper.GetSourceLineNumbers(parentElement), parentElement.Name.LocalName, attribute.Name.LocalName)); break; case "BAFunctions": if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute)) @@ -352,15 +361,15 @@ namespace WixToolset.Bal return packageInfo; } - private WixMbaPrereqInformationSymbol GetMbaPrereqInformationSymbol(IntermediateSection section, SourceLineNumber sourceLineNumbers, XAttribute prereqAttribute, string packageId) + private WixPrereqInformationSymbol GetMbaPrereqInformationSymbol(IntermediateSection section, SourceLineNumber sourceLineNumbers, XAttribute prereqAttribute, string packageId) { - WixMbaPrereqInformationSymbol prereqInfo = null; + WixPrereqInformationSymbol prereqInfo = null; if (prereqAttribute != null && YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, prereqAttribute)) { if (!this.prereqInfoSymbolsByPackageId.TryGetValue(packageId, out prereqInfo)) { - prereqInfo = section.AddSymbol(new WixMbaPrereqInformationSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, packageId)) + prereqInfo = section.AddSymbol(new WixPrereqInformationSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, packageId)) { PackageId = packageId, }); @@ -432,7 +441,7 @@ namespace WixToolset.Bal /// Parses a Condition element for Bundles. /// /// The element to parse. - private void ParseMbaPrereqInfoElement(Intermediate intermediate, IntermediateSection section, XElement node) + private void ParseBootstrapperApplicationPrerequisiteInformationElement(Intermediate intermediate, IntermediateSection section, XElement node) { var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); string packageId = null; @@ -480,7 +489,7 @@ namespace WixToolset.Bal if (!this.Messaging.EncounteredError) { - section.AddSymbol(new WixMbaPrereqInformationSymbol(sourceLineNumbers) + section.AddSymbol(new WixPrereqInformationSymbol(sourceLineNumbers) { PackageId = packageId, LicenseFile = licenseFile, @@ -490,14 +499,16 @@ namespace WixToolset.Bal } } - private void ParseWixInternalUIBootstrapperApplicationElement(Intermediate intermediate, IntermediateSection section, XElement node) + private IComponentKeyPath ParseWixInternalUIBootstrapperApplicationElement(Intermediate intermediate, IntermediateSection section, XElement node) { var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); - WixInternalUIBootstrapperApplicationTheme? theme = null; + var theme = WixInternalUIBootstrapperApplicationTheme.Standard; string themeFile = null; string logoFile = null; string localizationFile = null; + IComponentKeyPath exePayloadRef = null; + foreach (var attrib in node.Attributes()) { if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) @@ -542,11 +553,6 @@ namespace WixToolset.Bal this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); - if (!theme.HasValue) - { - theme = WixInternalUIBootstrapperApplicationTheme.Standard; - } - if (!this.Messaging.EncounteredError) { if (!String.IsNullOrEmpty(logoFile)) @@ -573,23 +579,41 @@ namespace WixToolset.Bal }); } - var baId = "WixInternalUIBootstrapperApplication"; switch (theme) { case WixInternalUIBootstrapperApplicationTheme.Standard: - baId = "WixInternalUIBootstrapperApplication.Standard"; + this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixIuibaStandardPayloads", platformSpecific: false); break; } - this.CreateBARef(section, sourceLineNumbers, node, baId, WixBalBootstrapperApplicationType.InternalUi); + section.AddSymbol(new WixBalBootstrapperApplicationSymbol(sourceLineNumbers) + { + Type = WixBalBootstrapperApplicationType.InternalUi, + }); + + section.AddSymbol(new WixPrereqOptionsSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixPrereqOptions")) + { + Primary = 1, + HandleHelp = 1, + HandleLayout = 1, + }); + + var exePayloadId = this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixInternalUIBootstrapperApplication", platformSpecific: true); + + exePayloadRef = this.CreateComponentKeyPath(); + exePayloadRef.Id = new Identifier(AccessModifier.Section, exePayloadId); + exePayloadRef.Explicit = true; // Internal UI BA is always secondary because the PrereqBA is always primary to handle the help and layout options. + exePayloadRef.Type = PossibleKeyPathType.File; } + + return exePayloadRef; } /// /// Parses a WixStandardBootstrapperApplication element for Bundles. /// /// The element to parse. - private void ParseWixStandardBootstrapperApplicationElement(Intermediate intermediate, IntermediateSection section, XElement node) + private IComponentKeyPath ParseWixStandardBootstrapperApplicationElement(Intermediate intermediate, IntermediateSection section, XElement node) { var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); string launchTarget = null; @@ -610,6 +634,8 @@ namespace WixToolset.Bal var showVersion = YesNoType.NotSet; var supportCacheOnly = YesNoType.NotSet; + IComponentKeyPath exePayloadRef = null; + foreach (var attrib in node.Attributes()) { if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) @@ -840,35 +866,159 @@ namespace WixToolset.Bal } } - var baId = "WixStandardBootstrapperApplication"; switch (theme) { case WixStandardBootstrapperApplicationTheme.HyperlinkLargeLicense: - baId = "WixStandardBootstrapperApplication.HyperlinkLargeLicense"; + this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixStdbaHyperlinkLargeLicensePayloads", platformSpecific: false); break; case WixStandardBootstrapperApplicationTheme.HyperlinkLicense: - baId = "WixStandardBootstrapperApplication.HyperlinkLicense"; + this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixStdbaHyperlinkLicensePayloads", platformSpecific: false); break; case WixStandardBootstrapperApplicationTheme.HyperlinkSidebarLicense: - baId = "WixStandardBootstrapperApplication.HyperlinkSidebarLicense"; + this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixStdbaHyperlinkSidebarLicensePayloads", platformSpecific: false); break; case WixStandardBootstrapperApplicationTheme.RtfLargeLicense: - baId = "WixStandardBootstrapperApplication.RtfLargeLicense"; + this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixStdbaRtfLargeLicensePayloads", platformSpecific: false); break; case WixStandardBootstrapperApplicationTheme.RtfLicense: - baId = "WixStandardBootstrapperApplication.RtfLicense"; + this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixStdbaRtfLicensePayloads", platformSpecific: false); + break; + } + + section.AddSymbol(new WixBalBootstrapperApplicationSymbol(sourceLineNumbers) + { + Type = WixBalBootstrapperApplicationType.Standard, + }); + + var exePayloadId = this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixStandardBootstrapperApplication", platformSpecific: true); + + exePayloadRef = this.CreateComponentKeyPath(); + exePayloadRef.Id = new Identifier(AccessModifier.Section, exePayloadId); + exePayloadRef.Type = PossibleKeyPathType.File; + } + + return exePayloadRef; + } + + /// + /// Parses a WixManagedBootstrapperApplicationHost element for Bundles. + /// + /// The element to parse. + private void ParseWixPrerequisiteBootstrapperApplicationElement(Intermediate intermediate, IntermediateSection section, XElement node, IDictionary context) + { + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); + string logoFile = null; + string themeFile = null; + string localizationFile = null; + var theme = WixPrerequisiteBootstrapperApplicationTheme.Standard; + + foreach (var attrib in node.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "LogoFile": + logoFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "ThemeFile": + themeFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "LocalizationFile": + localizationFile = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Theme": + var themeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib); + switch (themeValue) + { + case "none": + theme = WixPrerequisiteBootstrapperApplicationTheme.None; + break; + case "standard": + theme = WixPrerequisiteBootstrapperApplicationTheme.Standard; + break; + default: + this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Theme", themeValue, "none", "standard")); + theme = WixPrerequisiteBootstrapperApplicationTheme.Unknown; + break; + } + break; + default: + this.ParseHelper.UnexpectedAttribute(node, attrib); + break; + } + } + else + { + this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib); + } + } + + this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node); + + if (!this.Messaging.EncounteredError) + { + if (!String.IsNullOrEmpty(logoFile)) + { + section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixPreqbaLogo")) + { + Value = logoFile, + }); + } + + if (!String.IsNullOrEmpty(themeFile)) + { + section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixPreqbaThemeXml")) + { + Value = themeFile, + }); + } + + if (!String.IsNullOrEmpty(localizationFile)) + { + section.AddSymbol(new WixVariableSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixPreqbaThemeWxl")) + { + Value = localizationFile, + }); + } + + switch (theme) + { + case WixPrerequisiteBootstrapperApplicationTheme.Standard: + this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixPreqbaStandardPayloads", platformSpecific: false); break; } - this.CreateBARef(section, sourceLineNumbers, node, baId, WixBalBootstrapperApplicationType.Standard); + section.AddSymbol(new WixBalBootstrapperApplicationSymbol(sourceLineNumbers) + { + Type = WixBalBootstrapperApplicationType.Prerequisite, + }); + + var primary = context.TryGetValue("Secondary", out var parentSecondaryValue) && "True".Equals(parentSecondaryValue, StringComparison.OrdinalIgnoreCase) ? true : false; + + var baId = this.CreateIdentifierFromPlatform(sourceLineNumbers, node, primary ? "WixPrereqBootstrapperApplication.Primary" : "WixPrereqBootstrapperApplication.Secondary"); + + if (!String.IsNullOrEmpty(baId)) + { + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixBootstrapperApplication, baId); + } + + if (primary) + { + section.AddSymbol(new WixPrereqOptionsSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixPrereqOptions")) + { + Primary = 1 + }); + } } } +#if DELETE /// /// Parses a WixManagedBootstrapperApplicationHost element for Bundles. /// /// The element to parse. - private void ParseWixManagedBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node) + private IComponentKeyPath ParseWixManagedBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node) { var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); bool alwaysInstallPrereqs = false; @@ -877,6 +1027,8 @@ namespace WixToolset.Bal string localizationFile = null; WixManagedBootstrapperApplicationHostTheme? theme = null; + IComponentKeyPath exePayloadRef = null; + foreach (var attrib in node.Attributes()) { if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) @@ -963,23 +1115,25 @@ namespace WixToolset.Bal break; } - this.CreateBARef(section, sourceLineNumbers, node, baId, WixBalBootstrapperApplicationType.ManagedHost); + exePayloadRef = this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixManagedBootstrapperApplicationHost", baId, WixBalBootstrapperApplicationType.ManagedHost); if (alwaysInstallPrereqs) { - section.AddSymbol(new WixMbaPrereqOptionsSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixMbaPrereqOptions")) + section.AddSymbol(new WixPrereqOptionsSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixPrereqOptions")) { AlwaysInstallPrereqs = 1, }); } } + + return exePayloadRef; } /// /// Parses a WixDotNetCoreBootstrapperApplication element for Bundles. /// /// The element to parse. - private void ParseWixDotNetCoreBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node) + private IComponentKeyPath ParseWixDotNetCoreBootstrapperApplicationHostElement(Intermediate intermediate, IntermediateSection section, XElement node) { var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node); bool alwaysInstallPrereqs = false; @@ -989,6 +1143,8 @@ namespace WixToolset.Bal var selfContainedDeployment = YesNoType.NotSet; WixDotNetCoreBootstrapperApplicationHostTheme? theme = null; + IComponentKeyPath exePayloadRef = null; + foreach (var attrib in node.Attributes()) { if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) @@ -1086,19 +1242,36 @@ namespace WixToolset.Bal break; } - this.CreateBARef(section, sourceLineNumbers, node, baId, WixBalBootstrapperApplicationType.DotNetCoreHost); + exePayloadRef = this.CreatePayloadGroupRef(section, sourceLineNumbers, node, "WixDotNetCoreBootstrapperApplicationHost", baId, WixBalBootstrapperApplicationType.DotNetCoreHost); if (alwaysInstallPrereqs) { - section.AddSymbol(new WixMbaPrereqOptionsSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixMbaPrereqOptions")) + section.AddSymbol(new WixPrereqOptionsSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixPrereqOptions")) { AlwaysInstallPrereqs = 1, }); } } + + return exePayloadRef; + } +#endif + + private string CreatePayloadGroupRef(IntermediateSection section, SourceLineNumber sourceLineNumbers, XElement node, string basePayloadGroupId, bool platformSpecific) + { + var id = platformSpecific ? this.CreateIdentifierFromPlatform(sourceLineNumbers, node, basePayloadGroupId) : basePayloadGroupId; + + if (!String.IsNullOrEmpty(id)) + { + this.ParseHelper.CreateWixGroupSymbol(section, sourceLineNumbers, ComplexReferenceParentType.Container, BurnConstants.BurnUXContainerName, ComplexReferenceChildType.PayloadGroup, id); + + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixBundlePayloadGroup, id); + } + + return id; } - private void CreateBARef(IntermediateSection section, SourceLineNumber sourceLineNumbers, XElement node, string name, WixBalBootstrapperApplicationType baType) + private string CreateIdentifierFromPlatform(SourceLineNumber sourceLineNumbers, XElement node, string name) { var id = this.ParseHelper.CreateIdentifierValueFromPlatform(name, this.Context.Platform, BurnPlatforms.X86 | BurnPlatforms.X64 | BurnPlatforms.ARM64); if (id == null) @@ -1106,15 +1279,7 @@ namespace WixToolset.Bal this.Messaging.Write(ErrorMessages.UnsupportedPlatformForElement(sourceLineNumbers, this.Context.Platform.ToString(), node.Name.LocalName)); } - if (!this.Messaging.EncounteredError) - { - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixBootstrapperApplication, id); - - section.AddSymbol(new WixBalBootstrapperApplicationSymbol(sourceLineNumbers) - { - Type = baType, - }); - } + return id; } } } diff --git a/src/ext/Bal/wixext/BalErrors.cs b/src/ext/Bal/wixext/BalErrors.cs index 7fbccecb..10986f0e 100644 --- a/src/ext/Bal/wixext/BalErrors.cs +++ b/src/ext/Bal/wixext/BalErrors.cs @@ -48,9 +48,9 @@ namespace WixToolset.Bal return Message(sourceLineNumbers, Ids.MissingDNCBAFactoryAssembly, "When using DotNetCoreBootstrapperApplicationHost, the Payload element for the BA's entry point DLL must have bal:BAFactoryAssembly=\"yes\"."); } - public static Message MissingDNCPrereq(SourceLineNumber sourceLineNumbers) + public static Message MissingPrereq(SourceLineNumber sourceLineNumbers) { - return Message(sourceLineNumbers, Ids.MissingDNCPrereq, "There must be at least one package with bal:PrereqPackage=\"yes\" when using the DotNetCoreBootstrapperApplicationHost with SelfContainedDeployment set to \"no\"."); + return Message(sourceLineNumbers, Ids.MissingPrereq, "There must be at least one package with bal:PrereqPackage=\"yes\" when using the bal:WixPrerequisiteBootstrapperApplication."); } public static Message MissingIUIPrimaryPackage(SourceLineNumber sourceLineNumbers) @@ -58,11 +58,6 @@ namespace WixToolset.Bal return Message(sourceLineNumbers, Ids.MissingIUIPrimaryPackage, "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\"."); } - public static Message MissingMBAPrereq(SourceLineNumber sourceLineNumbers) - { - return Message(sourceLineNumbers, Ids.MissingMBAPrereq, "There must be at least one package with bal:PrereqPackage=\"yes\" when using the ManagedBootstrapperApplicationHost.\nThis is typically done by using the WixNetFxExtension and referencing one of the NetFxAsPrereq package groups."); - } - public static Message MultipleBAFunctions(SourceLineNumber sourceLineNumbers) { return Message(sourceLineNumbers, Ids.MultipleBAFunctions, "WixStandardBootstrapperApplication doesn't support multiple BAFunctions DLLs."); @@ -106,11 +101,10 @@ namespace WixToolset.Bal public enum Ids { AttributeRequiresPrereqPackage = 6801, - MissingMBAPrereq = 6802, + MissingPrereq = 6802, MultiplePrereqLicenses = 6803, MultipleBAFunctions = 6804, BAFunctionsPayloadRequiredInUXContainer = 6805, - MissingDNCPrereq = 6806, MissingIUIPrimaryPackage = 6808, MultiplePrimaryPackageType = 6809, MultiplePrimaryPackageType2 = 6810, diff --git a/src/ext/Bal/wixext/BalWarnings.cs b/src/ext/Bal/wixext/BalWarnings.cs index 96e7a523..73a19d07 100644 --- a/src/ext/Bal/wixext/BalWarnings.cs +++ b/src/ext/Bal/wixext/BalWarnings.cs @@ -33,6 +33,11 @@ namespace WixToolset.Bal return Message(sourceLineNumbers, Ids.UnmarkedBAFunctionsDLL, "WixStandardBootstrapperApplication doesn't automatically load BAFunctions.dll. Use the bal:BAFunctions attribute to indicate that it should be loaded."); } + public static Message DeprecatedBAFactoryAssemblyAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) + { + return Message(sourceLineNumbers, Ids.DeprecatedBAFactoryAssemblyAttribute, "The {0}/@{1} attribute has been deprecated. Move the Payload/@SourceFile attribute to be the BootstrapperApplication/@SourceFile attribute and remove the Payload element.", elementName, attributeName); + } + private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) { return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args); @@ -50,6 +55,7 @@ namespace WixToolset.Bal IuibaPrimaryPackageInstallCondition = 6503, IuibaPrimaryPackageDisplayInternalUICondition = 6504, IuibaPrereqPackageAfterPrimaryPackage = 6505, + DeprecatedBAFactoryAssemblyAttribute = 6506, } } } diff --git a/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs b/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs index 5229f278..5e9fb936 100644 --- a/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs +++ b/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs @@ -13,11 +13,11 @@ namespace WixToolset.Bal WixBalCondition, WixBalPackageInfo, WixDncOptions, - WixMbaPrereqInformation, + WixPrereqInformation, WixStdbaCommandLine, WixStdbaOptions, WixStdbaOverridableVariable, - WixMbaPrereqOptions, + WixPrereqOptions, WixBalBootstrapperApplication, } @@ -37,8 +37,10 @@ namespace WixToolset.Bal { switch (type) { +#pragma warning disable 0612 // obsolete case BalSymbolDefinitionType.WixBalBAFactoryAssembly: return BalSymbolDefinitions.WixBalBAFactoryAssembly; +#pragma warning restore 0612 case BalSymbolDefinitionType.WixBalBAFunctions: return BalSymbolDefinitions.WixBalBAFunctions; @@ -49,11 +51,8 @@ namespace WixToolset.Bal case BalSymbolDefinitionType.WixBalPackageInfo: return BalSymbolDefinitions.WixBalPackageInfo; - case BalSymbolDefinitionType.WixDncOptions: - return BalSymbolDefinitions.WixDncOptions; - - case BalSymbolDefinitionType.WixMbaPrereqInformation: - return BalSymbolDefinitions.WixMbaPrereqInformation; + case BalSymbolDefinitionType.WixPrereqInformation: + return BalSymbolDefinitions.WixPrereqInformation; case BalSymbolDefinitionType.WixStdbaCommandLine: return BalSymbolDefinitions.WixStdbaCommandLine; @@ -64,8 +63,8 @@ namespace WixToolset.Bal case BalSymbolDefinitionType.WixStdbaOverridableVariable: return BalSymbolDefinitions.WixStdbaOverridableVariable; - case BalSymbolDefinitionType.WixMbaPrereqOptions: - return BalSymbolDefinitions.WixMbaPrereqOptions; + case BalSymbolDefinitionType.WixPrereqOptions: + return BalSymbolDefinitions.WixPrereqOptions; case BalSymbolDefinitionType.WixBalBootstrapperApplication: return BalSymbolDefinitions.WixBalBootstrapperApplication; @@ -77,16 +76,17 @@ namespace WixToolset.Bal static BalSymbolDefinitions() { +#pragma warning disable 0612 // obsolete WixBalBAFactoryAssembly.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); +#pragma warning restore 0612 WixBalBAFunctions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); WixBalCondition.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); WixBalPackageInfo.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); - WixDncOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); - WixMbaPrereqInformation.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); + WixPrereqInformation.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); WixStdbaCommandLine.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); WixStdbaOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); WixStdbaOverridableVariable.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); - WixMbaPrereqOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); + WixPrereqOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); } } } diff --git a/src/ext/Bal/wixext/Symbols/WixBalBAFactoryAssemblySymbol.cs b/src/ext/Bal/wixext/Symbols/WixBalBAFactoryAssemblySymbol.cs index 52042e4c..3ce535a3 100644 --- a/src/ext/Bal/wixext/Symbols/WixBalBAFactoryAssemblySymbol.cs +++ b/src/ext/Bal/wixext/Symbols/WixBalBAFactoryAssemblySymbol.cs @@ -2,11 +2,13 @@ namespace WixToolset.Bal { + using System; using WixToolset.Data; using WixToolset.Bal.Symbols; public static partial class BalSymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition WixBalBAFactoryAssembly = new IntermediateSymbolDefinition( BalSymbolDefinitionType.WixBalBAFactoryAssembly.ToString(), new[] @@ -20,14 +22,17 @@ namespace WixToolset.Bal namespace WixToolset.Bal.Symbols { + using System; using WixToolset.Data; + [Obsolete] public enum WixBalBAFactorySymbolFields { PayloadId, FilePath, } + [Obsolete] public class WixBalBAFactoryAssemblySymbol : IntermediateSymbol { public WixBalBAFactoryAssemblySymbol() : base(BalSymbolDefinitions.WixBalBAFactoryAssembly, null, null) @@ -52,4 +57,4 @@ namespace WixToolset.Bal.Symbols set => this.Set((int)WixBalBAFactorySymbolFields.FilePath, value); } } -} \ No newline at end of file +} diff --git a/src/ext/Bal/wixext/Symbols/WixBalBootstrapperApplicationSymbol.cs b/src/ext/Bal/wixext/Symbols/WixBalBootstrapperApplicationSymbol.cs index 7096930d..47e930c2 100644 --- a/src/ext/Bal/wixext/Symbols/WixBalBootstrapperApplicationSymbol.cs +++ b/src/ext/Bal/wixext/Symbols/WixBalBootstrapperApplicationSymbol.cs @@ -19,15 +19,19 @@ namespace WixToolset.Bal namespace WixToolset.Bal.Symbols { + using System; using WixToolset.Data; public enum WixBalBootstrapperApplicationType { Unknown, Standard, + [Obsolete] ManagedHost, + [Obsolete] DotNetCoreHost, InternalUi, + Prerequisite, } public enum WixBalBootstrapperApplicationSymbolFields diff --git a/src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs b/src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs deleted file mode 100644 index b9a41c21..00000000 --- a/src/ext/Bal/wixext/Symbols/WixDncOptionsSymbol.cs +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -namespace WixToolset.Bal -{ - using WixToolset.Data; - using WixToolset.Bal.Symbols; - - public static partial class BalSymbolDefinitions - { - public static readonly IntermediateSymbolDefinition WixDncOptions = new IntermediateSymbolDefinition( - BalSymbolDefinitionType.WixDncOptions.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(WixDncOptionsSymbolFields.SelfContainedDeployment), IntermediateFieldType.Number), - }, - typeof(WixDncOptionsSymbol)); - } -} - -namespace WixToolset.Bal.Symbols -{ - using WixToolset.Data; - - public enum WixDncOptionsSymbolFields - { - SelfContainedDeployment, - } - - public class WixDncOptionsSymbol : IntermediateSymbol - { - public WixDncOptionsSymbol() : base(BalSymbolDefinitions.WixDncOptions, null, null) - { - } - - public WixDncOptionsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixDncOptions, sourceLineNumber, id) - { - } - - public IntermediateField this[WixDncOptionsSymbolFields index] => this.Fields[(int)index]; - - public int SelfContainedDeployment - { - get => this.Fields[(int)WixDncOptionsSymbolFields.SelfContainedDeployment].AsNumber(); - set => this.Set((int)WixDncOptionsSymbolFields.SelfContainedDeployment, value); - } - } -} \ No newline at end of file diff --git a/src/ext/Bal/wixext/Symbols/WixMbaPrereqInformationSymbol.cs b/src/ext/Bal/wixext/Symbols/WixMbaPrereqInformationSymbol.cs deleted file mode 100644 index e4d78da0..00000000 --- a/src/ext/Bal/wixext/Symbols/WixMbaPrereqInformationSymbol.cs +++ /dev/null @@ -1,63 +0,0 @@ -// 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. - -namespace WixToolset.Bal -{ - using WixToolset.Data; - using WixToolset.Bal.Symbols; - - public static partial class BalSymbolDefinitions - { - public static readonly IntermediateSymbolDefinition WixMbaPrereqInformation = new IntermediateSymbolDefinition( - BalSymbolDefinitionType.WixMbaPrereqInformation.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationSymbolFields.PackageId), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationSymbolFields.LicenseFile), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixMbaPrereqInformationSymbolFields.LicenseUrl), IntermediateFieldType.String), - }, - typeof(WixMbaPrereqInformationSymbol)); - } -} - -namespace WixToolset.Bal.Symbols -{ - using WixToolset.Data; - - public enum WixMbaPrereqInformationSymbolFields - { - PackageId, - LicenseFile, - LicenseUrl, - } - - public class WixMbaPrereqInformationSymbol : IntermediateSymbol - { - public WixMbaPrereqInformationSymbol() : base(BalSymbolDefinitions.WixMbaPrereqInformation, null, null) - { - } - - public WixMbaPrereqInformationSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixMbaPrereqInformation, sourceLineNumber, id) - { - } - - public IntermediateField this[WixMbaPrereqInformationSymbolFields index] => this.Fields[(int)index]; - - public string PackageId - { - get => this.Fields[(int)WixMbaPrereqInformationSymbolFields.PackageId].AsString(); - set => this.Set((int)WixMbaPrereqInformationSymbolFields.PackageId, value); - } - - public string LicenseFile - { - get => this.Fields[(int)WixMbaPrereqInformationSymbolFields.LicenseFile].AsString(); - set => this.Set((int)WixMbaPrereqInformationSymbolFields.LicenseFile, value); - } - - public string LicenseUrl - { - get => this.Fields[(int)WixMbaPrereqInformationSymbolFields.LicenseUrl].AsString(); - set => this.Set((int)WixMbaPrereqInformationSymbolFields.LicenseUrl, value); - } - } -} \ No newline at end of file diff --git a/src/ext/Bal/wixext/Symbols/WixMbaPrereqOptionsSymbol.cs b/src/ext/Bal/wixext/Symbols/WixMbaPrereqOptionsSymbol.cs deleted file mode 100644 index 66374579..00000000 --- a/src/ext/Bal/wixext/Symbols/WixMbaPrereqOptionsSymbol.cs +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -namespace WixToolset.Bal -{ - using WixToolset.Data; - using WixToolset.Bal.Symbols; - - public static partial class BalSymbolDefinitions - { - public static readonly IntermediateSymbolDefinition WixMbaPrereqOptions = new IntermediateSymbolDefinition( - BalSymbolDefinitionType.WixMbaPrereqOptions.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(WixMbaPrereqOptionsSymbolFields.AlwaysInstallPrereqs), IntermediateFieldType.Number), - }, - typeof(WixMbaPrereqOptionsSymbol)); - } -} - -namespace WixToolset.Bal.Symbols -{ - using WixToolset.Data; - - public enum WixMbaPrereqOptionsSymbolFields - { - AlwaysInstallPrereqs, - } - - public class WixMbaPrereqOptionsSymbol : IntermediateSymbol - { - public WixMbaPrereqOptionsSymbol() : base(BalSymbolDefinitions.WixMbaPrereqOptions, null, null) - { - } - - public WixMbaPrereqOptionsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixMbaPrereqOptions, sourceLineNumber, id) - { - } - - public IntermediateField this[WixMbaPrereqOptionsSymbolFields index] => this.Fields[(int)index]; - - public int AlwaysInstallPrereqs - { - get => this.Fields[(int)WixMbaPrereqOptionsSymbolFields.AlwaysInstallPrereqs].AsNumber(); - set => this.Set((int)WixMbaPrereqOptionsSymbolFields.AlwaysInstallPrereqs, value); - } - } -} diff --git a/src/ext/Bal/wixext/Symbols/WixPrereqInformationSymbol.cs b/src/ext/Bal/wixext/Symbols/WixPrereqInformationSymbol.cs new file mode 100644 index 00000000..4b5e301e --- /dev/null +++ b/src/ext/Bal/wixext/Symbols/WixPrereqInformationSymbol.cs @@ -0,0 +1,63 @@ +// 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. + +namespace WixToolset.Bal +{ + using WixToolset.Data; + using WixToolset.Bal.Symbols; + + public static partial class BalSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixPrereqInformation = new IntermediateSymbolDefinition( + BalSymbolDefinitionType.WixPrereqInformation.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixPrereqInformationSymbolFields.PackageId), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixPrereqInformationSymbolFields.LicenseFile), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixPrereqInformationSymbolFields.LicenseUrl), IntermediateFieldType.String), + }, + typeof(WixPrereqInformationSymbol)); + } +} + +namespace WixToolset.Bal.Symbols +{ + using WixToolset.Data; + + public enum WixPrereqInformationSymbolFields + { + PackageId, + LicenseFile, + LicenseUrl, + } + + public class WixPrereqInformationSymbol : IntermediateSymbol + { + public WixPrereqInformationSymbol() : base(BalSymbolDefinitions.WixPrereqInformation, null, null) + { + } + + public WixPrereqInformationSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixPrereqInformation, sourceLineNumber, id) + { + } + + public IntermediateField this[WixPrereqInformationSymbolFields index] => this.Fields[(int)index]; + + public string PackageId + { + get => this.Fields[(int)WixPrereqInformationSymbolFields.PackageId].AsString(); + set => this.Set((int)WixPrereqInformationSymbolFields.PackageId, value); + } + + public string LicenseFile + { + get => this.Fields[(int)WixPrereqInformationSymbolFields.LicenseFile].AsString(); + set => this.Set((int)WixPrereqInformationSymbolFields.LicenseFile, value); + } + + public string LicenseUrl + { + get => this.Fields[(int)WixPrereqInformationSymbolFields.LicenseUrl].AsString(); + set => this.Set((int)WixPrereqInformationSymbolFields.LicenseUrl, value); + } + } +} diff --git a/src/ext/Bal/wixext/Symbols/WixPrereqOptionsSymbol.cs b/src/ext/Bal/wixext/Symbols/WixPrereqOptionsSymbol.cs new file mode 100644 index 00000000..a351d7da --- /dev/null +++ b/src/ext/Bal/wixext/Symbols/WixPrereqOptionsSymbol.cs @@ -0,0 +1,63 @@ +// 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. + +namespace WixToolset.Bal +{ + using WixToolset.Data; + using WixToolset.Bal.Symbols; + + public static partial class BalSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixPrereqOptions = new IntermediateSymbolDefinition( + BalSymbolDefinitionType.WixPrereqOptions.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixPrereqOptionsSymbolFields.Primary), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixPrereqOptionsSymbolFields.HandleHelp), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixPrereqOptionsSymbolFields.HandleLayout), IntermediateFieldType.Number), + }, + typeof(WixPrereqOptionsSymbol)); + } +} + +namespace WixToolset.Bal.Symbols +{ + using WixToolset.Data; + + public enum WixPrereqOptionsSymbolFields + { + Primary, + HandleHelp, + HandleLayout, + } + + public class WixPrereqOptionsSymbol : IntermediateSymbol + { + public WixPrereqOptionsSymbol() : base(BalSymbolDefinitions.WixPrereqOptions, null, null) + { + } + + public WixPrereqOptionsSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixPrereqOptions, sourceLineNumber, id) + { + } + + public IntermediateField this[WixPrereqOptionsSymbolFields index] => this.Fields[(int)index]; + + public int Primary + { + get => this.Fields[(int)WixPrereqOptionsSymbolFields.Primary].AsNumber(); + set => this.Set((int)WixPrereqOptionsSymbolFields.Primary, value); + } + + public int? HandleHelp + { + get => (int?)this.Fields[(int)WixPrereqOptionsSymbolFields.HandleHelp]; + set => this.Set((int)WixPrereqOptionsSymbolFields.HandleHelp, value); + } + + public int? HandleLayout + { + get => (int?)this.Fields[(int)WixPrereqOptionsSymbolFields.HandleLayout]; + set => this.Set((int)WixPrereqOptionsSymbolFields.HandleLayout, value); + } + } +} -- cgit v1.2.3-55-g6feb