From 4a176b759c47fa1970fcfd0d9e25c294bda82ef4 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 22 Dec 2019 13:51:35 +1100 Subject: Update the MbaHost test project to use an external exe to load the BA, which allows loading a different .NET than the one running the tests. This also allows writing the tests in C# instead of C++/CLI. --- .../BootstrapperApplicationData.xml | Bin 0 -> 20128 bytes .../Example.FullFramework2MBA.csproj | 77 +++++++++++++++++++++ .../examples/FullFramework2MBA/FullFramework2BA.cs | 27 ++++++++ .../FullFramework2MBA/FullFramework2BAFactory.cs | 14 ++++ .../FullFramework2MBA/Properties/AssemblyInfo.cs | 18 +++++ .../FullFramework2MBA/WixToolset.Mba.Host.config | 20 ++++++ .../examples/FullFramework2MBA/packages.config | 4 ++ 7 files changed, 160 insertions(+) create mode 100644 src/test/examples/FullFramework2MBA/BootstrapperApplicationData.xml create mode 100644 src/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj create mode 100644 src/test/examples/FullFramework2MBA/FullFramework2BA.cs create mode 100644 src/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs create mode 100644 src/test/examples/FullFramework2MBA/Properties/AssemblyInfo.cs create mode 100644 src/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config create mode 100644 src/test/examples/FullFramework2MBA/packages.config (limited to 'src/test/examples/FullFramework2MBA') diff --git a/src/test/examples/FullFramework2MBA/BootstrapperApplicationData.xml b/src/test/examples/FullFramework2MBA/BootstrapperApplicationData.xml new file mode 100644 index 00000000..7c4169b1 Binary files /dev/null and b/src/test/examples/FullFramework2MBA/BootstrapperApplicationData.xml differ diff --git a/src/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj b/src/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj new file mode 100644 index 00000000..dec1ff1e --- /dev/null +++ b/src/test/examples/FullFramework2MBA/Example.FullFramework2MBA.csproj @@ -0,0 +1,77 @@ + + + + + + + + {CC4236FC-226E-4232-AB50-24CBEC4D314D} + Example.FullFramework2MBA + Library + Example.FullFramework2MBA + v2.0 + false + + + true + false + $(DefineConstants);DEBUG;TRACE + + + true + true + $(DefineConstants);TRACE + + + + + + + + + + + + + + + + + + + + ..\..\..\..\packages\WixToolset.Mba.Core.4.0.12\lib\net20\WixToolset.Mba.Core.dll + + + + + {12c87c77-3547-44f8-8134-29bc915cb19d} + false + + + {F2BA1935-70FA-4156-B161-FD03850B4FAA} + false + Content + PreserveNewest + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + \ No newline at end of file diff --git a/src/test/examples/FullFramework2MBA/FullFramework2BA.cs b/src/test/examples/FullFramework2MBA/FullFramework2BA.cs new file mode 100644 index 00000000..13d4673a --- /dev/null +++ b/src/test/examples/FullFramework2MBA/FullFramework2BA.cs @@ -0,0 +1,27 @@ +// 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 Example.FullFramework2MBA +{ + using WixToolset.Mba.Core; + + public class FullFramework2BA : BootstrapperApplication + { + public FullFramework2BA(IEngine engine) + : base(engine) + { + + } + + protected override void Run() + { + } + + protected override void OnShutdown(ShutdownEventArgs args) + { + base.OnShutdown(args); + + var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString(); + this.engine.Log(LogLevel.Standard, message); + } + } +} diff --git a/src/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs b/src/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs new file mode 100644 index 00000000..d3cafc70 --- /dev/null +++ b/src/test/examples/FullFramework2MBA/FullFramework2BAFactory.cs @@ -0,0 +1,14 @@ +// 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 Example.FullFramework2MBA +{ + using WixToolset.Mba.Core; + + public class FullFramework2BAFactory : BaseBootstrapperApplicationFactory + { + protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) + { + return new FullFramework2BA(engine); + } + } +} diff --git a/src/test/examples/FullFramework2MBA/Properties/AssemblyInfo.cs b/src/test/examples/FullFramework2MBA/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..640c17ad --- /dev/null +++ b/src/test/examples/FullFramework2MBA/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +// 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. + +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using WixToolset.Mba.Core; + +[assembly: AssemblyTitle("Example.FullFramework2MBA")] +[assembly: AssemblyDescription("Example.FullFramework2MBA")] +[assembly: AssemblyProduct("WiX Toolset")] +[assembly: AssemblyCompany("WiX Toolset Team")] +[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and contributors. All rights reserved.")] + +// Types should not be visible to COM by default. +[assembly: ComVisible(false)] +[assembly: Guid("7A671EAF-FAE5-41A2-83DD-C35AB3779651")] + +[assembly: BootstrapperApplicationFactory(typeof(Example.FullFramework2MBA.FullFramework2BAFactory))] diff --git a/src/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config b/src/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config new file mode 100644 index 00000000..be450a4f --- /dev/null +++ b/src/test/examples/FullFramework2MBA/WixToolset.Mba.Host.config @@ -0,0 +1,20 @@ + + + + + + + +
+ + + + + + + + + + + + diff --git a/src/test/examples/FullFramework2MBA/packages.config b/src/test/examples/FullFramework2MBA/packages.config new file mode 100644 index 00000000..77b7e398 --- /dev/null +++ b/src/test/examples/FullFramework2MBA/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file -- cgit v1.2.3-55-g6feb