From 39e930d9aaff250e0fd5019eeedaa40717a6c6fe Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 29 Apr 2020 19:28:50 +1000 Subject: Add DotNetCoreBootstrapperApplicationHost for an SCD-style .NET Core BA. --- src/wixext/BalCompiler.cs | 9 +++++ src/wixext/Tuples/BalTupleDefinitions.cs | 15 ++++++++ src/wixext/Tuples/WixBalBAFactoryAssemblyTuple.cs | 47 +++++++++++++++++++++++ src/wixext/bal.xsd | 17 +++++++- 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 src/wixext/Tuples/WixBalBAFactoryAssemblyTuple.cs (limited to 'src/wixext') diff --git a/src/wixext/BalCompiler.cs b/src/wixext/BalCompiler.cs index da32234c..33400f3b 100644 --- a/src/wixext/BalCompiler.cs +++ b/src/wixext/BalCompiler.cs @@ -197,6 +197,15 @@ namespace WixToolset.Bal { switch (attribute.Name.LocalName) { + case "BAFactoryAssembly": + if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute)) + { + section.AddTuple(new WixBalBAFactoryAssemblyTuple(sourceLineNumbers) + { + PayloadId = payloadId, + }); + } + break; case "BAFunctions": if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attribute)) { diff --git a/src/wixext/Tuples/BalTupleDefinitions.cs b/src/wixext/Tuples/BalTupleDefinitions.cs index 676db9f6..48199f95 100644 --- a/src/wixext/Tuples/BalTupleDefinitions.cs +++ b/src/wixext/Tuples/BalTupleDefinitions.cs @@ -4,9 +4,11 @@ namespace WixToolset.Bal { using System; using WixToolset.Data; + using WixToolset.Data.Burn; public enum BalTupleDefinitionType { + WixBalBAFactoryAssembly, WixBalBAFunctions, WixBalCondition, WixMbaPrereqInformation, @@ -32,6 +34,9 @@ namespace WixToolset.Bal { switch (type) { + case BalTupleDefinitionType.WixBalBAFactoryAssembly: + return BalTupleDefinitions.WixBalBAFactoryAssembly; + case BalTupleDefinitionType.WixBalBAFunctions: return BalTupleDefinitions.WixBalBAFunctions; @@ -51,5 +56,15 @@ namespace WixToolset.Bal throw new ArgumentOutOfRangeException(nameof(type)); } } + + static BalTupleDefinitions() + { + WixBalBAFactoryAssembly.AddTag(BurnConstants.BootstrapperApplicationDataTupleDefinitionTag); + WixBalBAFunctions.AddTag(BurnConstants.BootstrapperApplicationDataTupleDefinitionTag); + WixBalCondition.AddTag(BurnConstants.BootstrapperApplicationDataTupleDefinitionTag); + WixMbaPrereqInformation.AddTag(BurnConstants.BootstrapperApplicationDataTupleDefinitionTag); + WixStdbaOptions.AddTag(BurnConstants.BootstrapperApplicationDataTupleDefinitionTag); + WixStdbaOverridableVariable.AddTag(BurnConstants.BootstrapperApplicationDataTupleDefinitionTag); + } } } diff --git a/src/wixext/Tuples/WixBalBAFactoryAssemblyTuple.cs b/src/wixext/Tuples/WixBalBAFactoryAssemblyTuple.cs new file mode 100644 index 00000000..e33ea562 --- /dev/null +++ b/src/wixext/Tuples/WixBalBAFactoryAssemblyTuple.cs @@ -0,0 +1,47 @@ +// 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.Tuples; + + public static partial class BalTupleDefinitions + { + public static readonly IntermediateTupleDefinition WixBalBAFactoryAssembly = new IntermediateTupleDefinition( + BalTupleDefinitionType.WixBalBAFactoryAssembly.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixBalBAFactoryTupleFields.PayloadId), IntermediateFieldType.String), + }, + typeof(WixBalBAFactoryAssemblyTuple)); + } +} + +namespace WixToolset.Bal.Tuples +{ + using WixToolset.Data; + + public enum WixBalBAFactoryTupleFields + { + PayloadId, + } + + public class WixBalBAFactoryAssemblyTuple : IntermediateTuple + { + public WixBalBAFactoryAssemblyTuple() : base(BalTupleDefinitions.WixBalBAFactoryAssembly, null, null) + { + } + + public WixBalBAFactoryAssemblyTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalTupleDefinitions.WixBalBAFactoryAssembly, sourceLineNumber, id) + { + } + + public IntermediateField this[WixBalBAFactoryTupleFields index] => this.Fields[(int)index]; + + public string PayloadId + { + get => this.Fields[(int)WixBalBAFactoryTupleFields.PayloadId].AsString(); + set => this.Set((int)WixBalBAFactoryTupleFields.PayloadId, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/bal.xsd b/src/wixext/bal.xsd index 3081a279..52f9142f 100644 --- a/src/wixext/bal.xsd +++ b/src/wixext/bal.xsd @@ -9,7 +9,7 @@ xmlns="http://wixtoolset.org/schemas/v4/wxs/bal"> - The source code schema for the WiX Toolset Burn User Experience Extension. + The source code schema for the WiX Toolset Bootstrapper Application Layer Extension. @@ -215,10 +215,25 @@ + + + + When set to "yes", DotNetCoreBootstrapperApplicationHost will load the DLL and instantiate the type with the BootstrapperApplicationFactoryAttribute. + There must be corresponding deps.json and runtimeconfig.json files (set EnableDynamicLoading to True in the .NET Core project). + The .NET Core project must have been published, not just built. + Only one payload may be marked with this attribute set to "yes". + + + + + + + When set to "yes", WixStdBA will load the DLL and work with it to handle BA messages. + Only one payload may be marked with this attribute set to "yes". -- cgit v1.2.3-55-g6feb