aboutsummaryrefslogtreecommitdiff
path: root/src/test/examples/FullFramework4MBA
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2019-12-22 13:51:35 +1100
committerSean Hall <r.sean.hall@gmail.com>2019-12-22 13:34:07 +1000
commit4a176b759c47fa1970fcfd0d9e25c294bda82ef4 (patch)
tree961cc91c44569d72c12d9f2dc5b1c11a80bb94a9 /src/test/examples/FullFramework4MBA
parent43fb611edc680a74d229e8f1eeacb30adad8e3c7 (diff)
downloadwix-4a176b759c47fa1970fcfd0d9e25c294bda82ef4.tar.gz
wix-4a176b759c47fa1970fcfd0d9e25c294bda82ef4.tar.bz2
wix-4a176b759c47fa1970fcfd0d9e25c294bda82ef4.zip
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.
Diffstat (limited to 'src/test/examples/FullFramework4MBA')
-rw-r--r--src/test/examples/FullFramework4MBA/BootstrapperApplicationData.xmlbin0 -> 20128 bytes
-rw-r--r--src/test/examples/FullFramework4MBA/Example.FullFramework4MBA.csproj38
-rw-r--r--src/test/examples/FullFramework4MBA/FullFramework4BA.cs27
-rw-r--r--src/test/examples/FullFramework4MBA/FullFramework4BAFactory.cs15
-rw-r--r--src/test/examples/FullFramework4MBA/WixToolset.Mba.Host.config17
5 files changed, 97 insertions, 0 deletions
diff --git a/src/test/examples/FullFramework4MBA/BootstrapperApplicationData.xml b/src/test/examples/FullFramework4MBA/BootstrapperApplicationData.xml
new file mode 100644
index 00000000..7c4169b1
--- /dev/null
+++ b/src/test/examples/FullFramework4MBA/BootstrapperApplicationData.xml
Binary files 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 @@
1<Project Sdk="Microsoft.NET.Sdk">
2
3 <PropertyGroup>
4 <TargetFramework>net48</TargetFramework>
5 <Description>Full Framework v4 MBA</Description>
6 </PropertyGroup>
7
8 <ItemGroup>
9 <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" />
10 <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" PrivateAssets="All" />
11 </ItemGroup>
12
13 <ItemGroup>
14 <Content Include="BootstrapperApplicationData.xml" CopyToOutputDirectory="PreserveNewest" />
15 <Content Include="WixToolset.Mba.Host.config" CopyToOutputDirectory="PreserveNewest" />
16 </ItemGroup>
17
18 <ItemGroup>
19 <ProjectReference Include="..\..\..\mbahost\mbahost.vcxproj">
20 <Project>{12c87c77-3547-44f8-8134-29bc915cb19d}</Project>
21 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
22 </ProjectReference>
23 <ProjectReference Include="..\..\..\WixToolset.Mba.Host\WixToolset.Mba.Host.csproj">
24 <Project>{F2BA1935-70FA-4156-B161-FD03850B4FAA}</Project>
25 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
26 <OutputItemType>Content</OutputItemType>
27 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
28 </ProjectReference>
29 </ItemGroup>
30
31 <ItemGroup>
32 <MbaHostDependency Include="$(BaseOutputPath)$(Configuration)\Win32\mbahost.dll" />
33 </ItemGroup>
34
35 <Target Name="CopyMbaHostDependencies" AfterTargets="Build">
36 <Copy DestinationFolder="$(OutputPath)" SourceFiles="@(MbaHostDependency)" SkipUnchangedFiles="true" />
37 </Target>
38</Project> \ 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 @@
1// 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.
2
3namespace Example.FullFramework4MBA
4{
5 using WixToolset.Mba.Core;
6
7 public class FullFramework4BA : BootstrapperApplication
8 {
9 public FullFramework4BA(IEngine engine)
10 : base(engine)
11 {
12
13 }
14
15 protected override void Run()
16 {
17 }
18
19 protected override void OnShutdown(ShutdownEventArgs args)
20 {
21 base.OnShutdown(args);
22
23 var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString();
24 this.engine.Log(LogLevel.Standard, message);
25 }
26 }
27}
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 @@
1// 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.
2
3[assembly: WixToolset.Mba.Core.BootstrapperApplicationFactory(typeof(Example.FullFramework4MBA.FullFramework4BAFactory))]
4namespace Example.FullFramework4MBA
5{
6 using WixToolset.Mba.Core;
7
8 public class FullFramework4BAFactory : BaseBootstrapperApplicationFactory
9 {
10 protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand)
11 {
12 return new FullFramework4BA(engine);
13 }
14 }
15}
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 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<!-- 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. -->
3
4
5<configuration>
6 <configSections>
7 <sectionGroup name="wix.bootstrapper" type="WixToolset.Mba.Host.BootstrapperSectionGroup, WixToolset.Mba.Host">
8 <section name="host" type="WixToolset.Mba.Host.HostSection, WixToolset.Mba.Host" />
9 </sectionGroup>
10 </configSections>
11 <startup>
12 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
13 </startup>
14 <wix.bootstrapper>
15 <host assemblyName="Example.FullFramework4MBA" />
16 </wix.bootstrapper>
17</configuration>