diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-05-03 15:55:48 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-05-03 15:55:48 -0700 |
| commit | ba7bab476501c16e437b0aee71c1be02c3dda176 (patch) | |
| tree | 814fba485c29a7dfe1adb396169e27ed641ef9a3 /src/ext/Bal/test/examples/LatestCoreMBA | |
| parent | 14987a72cc1a3493ca8f80693d273352fc314bd9 (diff) | |
| download | wix-ba7bab476501c16e437b0aee71c1be02c3dda176.tar.gz wix-ba7bab476501c16e437b0aee71c1be02c3dda176.tar.bz2 wix-ba7bab476501c16e437b0aee71c1be02c3dda176.zip | |
Move Bal.wixext into ext
Diffstat (limited to 'src/ext/Bal/test/examples/LatestCoreMBA')
3 files changed, 76 insertions, 0 deletions
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj b/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj new file mode 100644 index 00000000..9f3f02d9 --- /dev/null +++ b/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <Project Sdk="Microsoft.NET.Sdk"> | ||
| 2 | |||
| 3 | <PropertyGroup> | ||
| 4 | <TargetFramework>net5.0</TargetFramework> | ||
| 5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> | ||
| 6 | <EnableDynamicLoading>true</EnableDynamicLoading> | ||
| 7 | <Description>Latest .NET Core MBA</Description> | ||
| 8 | </PropertyGroup> | ||
| 9 | |||
| 10 | <ItemGroup> | ||
| 11 | <TrimmerRootAssembly Include="System.Diagnostics.Tools" /> | ||
| 12 | <TrimmerRootAssembly Include="System.Runtime" /> | ||
| 13 | <TrimmerRootAssembly Include="System.Runtime.InteropServices" /> | ||
| 14 | <TrimmerRootAssembly Include="System.Runtime.Loader" /> | ||
| 15 | </ItemGroup> | ||
| 16 | |||
| 17 | <ItemGroup> | ||
| 18 | <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="all" /> | ||
| 19 | <PackageReference Include="WixToolset.Mba.Core" Version="4.0.*" /> | ||
| 20 | </ItemGroup> | ||
| 21 | </Project> \ No newline at end of file | ||
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs new file mode 100644 index 00000000..50386a87 --- /dev/null +++ b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs | |||
| @@ -0,0 +1,33 @@ | |||
| 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 | namespace Example.LatestCoreMBA | ||
| 4 | { | ||
| 5 | using WixToolset.Mba.Core; | ||
| 6 | |||
| 7 | public class LatestCoreBA : BootstrapperApplication | ||
| 8 | { | ||
| 9 | public LatestCoreBA(IEngine engine) | ||
| 10 | : base(engine) | ||
| 11 | { | ||
| 12 | } | ||
| 13 | |||
| 14 | protected override void Run() | ||
| 15 | { | ||
| 16 | } | ||
| 17 | |||
| 18 | protected override void OnStartup(StartupEventArgs args) | ||
| 19 | { | ||
| 20 | base.OnStartup(args); | ||
| 21 | |||
| 22 | this.engine.Log(LogLevel.Standard, nameof(LatestCoreBA)); | ||
| 23 | } | ||
| 24 | |||
| 25 | protected override void OnShutdown(ShutdownEventArgs args) | ||
| 26 | { | ||
| 27 | base.OnShutdown(args); | ||
| 28 | |||
| 29 | var message = "Shutdown," + args.Action.ToString() + "," + args.HResult.ToString(); | ||
| 30 | this.engine.Log(LogLevel.Standard, message); | ||
| 31 | } | ||
| 32 | } | ||
| 33 | } | ||
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs new file mode 100644 index 00000000..fff3b5c5 --- /dev/null +++ b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs | |||
| @@ -0,0 +1,22 @@ | |||
| 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.LatestCoreMBA.LatestCoreBAFactory))] | ||
| 4 | namespace Example.LatestCoreMBA | ||
| 5 | { | ||
| 6 | using WixToolset.Mba.Core; | ||
| 7 | |||
| 8 | public class LatestCoreBAFactory : BaseBootstrapperApplicationFactory | ||
| 9 | { | ||
| 10 | private static int loadCount = 0; | ||
| 11 | |||
| 12 | protected override IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand) | ||
| 13 | { | ||
| 14 | if (loadCount > 0) | ||
| 15 | { | ||
| 16 | engine.Log(LogLevel.Standard, $"Reloaded {loadCount} time(s)"); | ||
| 17 | } | ||
| 18 | ++loadCount; | ||
| 19 | return new LatestCoreBA(engine); | ||
| 20 | } | ||
| 21 | } | ||
| 22 | } | ||
