From ecbaffc08239e061a7dbaa92ff3c72acd53a0bae Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 15 Jan 2023 20:59:56 -0600 Subject: Write an error when the .NET Core BA is missing the BAFactoryAssembly. 7166 --- src/ext/Bal/wixext/BalBurnBackendExtension.cs | 6 ++++-- src/ext/Bal/wixext/BalErrors.cs | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/ext/Bal/wixext') diff --git a/src/ext/Bal/wixext/BalBurnBackendExtension.cs b/src/ext/Bal/wixext/BalBurnBackendExtension.cs index a27ff739..be294131 100644 --- a/src/ext/Bal/wixext/BalBurnBackendExtension.cs +++ b/src/ext/Bal/wixext/BalBurnBackendExtension.cs @@ -121,7 +121,7 @@ namespace WixToolset.Bal if (isDNC) { - this.FinalizeBAFactorySymbol(section); + this.FinalizeBAFactorySymbol(section, baSymbol); } if (isIuiBA || isStdBA || isMBA || isDNC) @@ -135,11 +135,12 @@ namespace WixToolset.Bal } } - private void FinalizeBAFactorySymbol(IntermediateSection section) + private void FinalizeBAFactorySymbol(IntermediateSection section, WixBootstrapperApplicationDllSymbol baSymbol) { var factorySymbol = section.Symbols.OfType().SingleOrDefault(); if (null == factorySymbol) { + this.Messaging.Write(BalErrors.MissingDNCBAFactoryAssembly(baSymbol.SourceLineNumbers)); return; } @@ -148,6 +149,7 @@ namespace WixToolset.Bal .SingleOrDefault(); if (null == factoryPayloadSymbol) { + this.Messaging.Write(BalErrors.MissingDNCBAFactoryAssembly(factorySymbol.SourceLineNumbers)); return; } diff --git a/src/ext/Bal/wixext/BalErrors.cs b/src/ext/Bal/wixext/BalErrors.cs index cde37143..2548b279 100644 --- a/src/ext/Bal/wixext/BalErrors.cs +++ b/src/ext/Bal/wixext/BalErrors.cs @@ -43,6 +43,11 @@ namespace WixToolset.Bal return Message(sourceLineNumbers, Ids.IuibaPrimaryPackageEnableFeatureSelection, "When using WixInternalUIBootstrapperApplication, primary packages must not have feature selection enabled because it interferes with the user selecting feature through the MSI UI."); } + public static Message MissingDNCBAFactoryAssembly(SourceLineNumber sourceLineNumbers) + { + return Message(sourceLineNumbers, Ids.MissingDNCBAFactoryAssembly, "The BA's entry point DLL must have bal:BAFactoryAssembly=\"yes\" when using the DotNetCoreBootstrapperApplicationHost."); + } + public static Message MissingDNCPrereq() { return Message(null, Ids.MissingDNCPrereq, "There must be at least one package with bal:PrereqPackage=\"yes\" when using the DotNetCoreBootstrapperApplicationHost with SelfContainedDeployment set to \"no\"."); @@ -116,6 +121,7 @@ namespace WixToolset.Bal IuibaPrimaryPackageEnableFeatureSelection = 6815, OverridableVariableCollision = 6816, OverridableVariableCollision2 = 6817, + MissingDNCBAFactoryAssembly = 6818, } } } -- cgit v1.2.3-55-g6feb