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.FullFramework4MBA.csproj | 38 +++++++++++++++++++++ .../examples/FullFramework4MBA/FullFramework4BA.cs | 27 +++++++++++++++ .../FullFramework4MBA/FullFramework4BAFactory.cs | 15 ++++++++ .../FullFramework4MBA/WixToolset.Mba.Host.config | 17 +++++++++ 5 files changed, 97 insertions(+) create mode 100644 src/test/examples/FullFramework4MBA/BootstrapperApplicationData.xml create mode 100644 src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj create mode 100644 src/test/examples/FullFramework4MBA/FullFramework4BA.cs create mode 100644 src/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs create mode 100644 src/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config (limited to 'src/test/examples/FullFramework4MBA') diff --git a/src/test/examples/FullFramework4MBA/BootstrapperApplicationData.xml b/src/test/examples/FullFramework4MBA/BootstrapperApplicationData.xml new file mode 100644 index 00000000..7c4169b1 Binary files /dev/null and b/src/test/examples/FullFramework4MBA/BootstrapperApplicationData.xml differ diff --git a/src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj b/src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj new file mode 100644 index 00000000..e044c6b1 --- /dev/null +++ b/src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj @@ -0,0 +1,38 @@ + + + + net48 + Full Framework v4 MBA + + + + + + + + + + + + + + + {12c87c77-3547-44f8-8134-29bc915cb19d} + false + + + {F2BA1935-70FA-4156-B161-FD03850B4FAA} + false + Content + PreserveNewest + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/examples/FullFramework4MBA/FullFramework4BA.cs b/src/test/examples/FullFramework4MBA/FullFramework4BA.cs new file mode 100644 index 00000000..556a61a7 --- /dev/null +++ b/src/test/examples/FullFramework4MBA/FullFramework4BA.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.FullFramework4MBA +{ + using WixToolset.Mba.Core; + + public class FullFramework4BA : BootstrapperApplication + { + public FullFramework4BA(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/FullFramework4MBA/FullFramework4BAFactory.cs b/src/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs new file mode 100644 index 00000000..b7c8750d --- /dev/null +++ b/src/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs @@ -0,0 +1,15 @@ +// 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. + +[assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.FullFramework4MBA.FullFramework4BAFactory))] +namespace Example.FullFramework4MBA +{ + using WixToolset.Mba.Core; + + public class FullFramework4BAFactory : BaseBootstrapperApplicationFactory + { + protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) + { + return new FullFramework4BA(engine); + } + } +} diff --git a/src/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config b/src/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config new file mode 100644 index 00000000..96678cda --- /dev/null +++ b/src/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config @@ -0,0 +1,17 @@ + + + + + + + +
+ + + + + + + + + -- cgit v1.2.3-55-g6feb