diff options
| author | Rob Mensching <rob@firegiant.com> | 2024-01-11 18:26:20 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2024-03-06 18:03:38 -0800 |
| commit | 0d3d54992104288e9ee0c834d0b96e8502fd2d42 (patch) | |
| tree | 9efa49c4983cd2ba1becab64bd1f2faccac88acf /src/ext/Bal/test/examples/LatestCoreMBA | |
| parent | 2824298d9dd817a47527c920363556b54ead5d5d (diff) | |
| download | wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.tar.gz wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.tar.bz2 wix-0d3d54992104288e9ee0c834d0b96e8502fd2d42.zip | |
Move the BootstrapperApplication out of proc
Diffstat (limited to 'src/ext/Bal/test/examples/LatestCoreMBA')
4 files changed, 25 insertions, 28 deletions
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj b/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj index 236e715c..c4d31151 100644 --- a/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj +++ b/src/ext/Bal/test/examples/LatestCoreMBA/Example.LatestCoreMBA.csproj | |||
| @@ -3,7 +3,12 @@ | |||
| 3 | <PropertyGroup> | 3 | <PropertyGroup> |
| 4 | <TargetFramework>net6.0</TargetFramework> | 4 | <TargetFramework>net6.0</TargetFramework> |
| 5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> | 5 | <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers> |
| 6 | <IsDncBA>true</IsDncBA> | 6 | <OutputType>WinExe</OutputType> |
| 7 | <DebugType>embedded</DebugType> | ||
| 7 | <Description>Latest .NET Core MBA</Description> | 8 | <Description>Latest .NET Core MBA</Description> |
| 8 | </PropertyGroup> | 9 | </PropertyGroup> |
| 10 | |||
| 11 | <ItemGroup> | ||
| 12 | <PackageReference Include="WixToolset.Mba.Core" /> | ||
| 13 | </ItemGroup> | ||
| 9 | </Project> | 14 | </Project> |
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs index 50386a87..bd5378eb 100644 --- a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs +++ b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBA.cs | |||
| @@ -6,13 +6,9 @@ namespace Example.LatestCoreMBA | |||
| 6 | 6 | ||
| 7 | public class LatestCoreBA : BootstrapperApplication | 7 | public class LatestCoreBA : BootstrapperApplication |
| 8 | { | 8 | { |
| 9 | public LatestCoreBA(IEngine engine) | ||
| 10 | : base(engine) | ||
| 11 | { | ||
| 12 | } | ||
| 13 | |||
| 14 | protected override void Run() | 9 | protected override void Run() |
| 15 | { | 10 | { |
| 11 | this.engine.Quit(0); | ||
| 16 | } | 12 | } |
| 17 | 13 | ||
| 18 | protected override void OnStartup(StartupEventArgs args) | 14 | protected override void OnStartup(StartupEventArgs args) |
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs b/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs deleted file mode 100644 index fff3b5c5..00000000 --- a/src/ext/Bal/test/examples/LatestCoreMBA/LatestCoreBAFactory.cs +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 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 | } | ||
diff --git a/src/ext/Bal/test/examples/LatestCoreMBA/Program.cs b/src/ext/Bal/test/examples/LatestCoreMBA/Program.cs new file mode 100644 index 00000000..94da360b --- /dev/null +++ b/src/ext/Bal/test/examples/LatestCoreMBA/Program.cs | |||
| @@ -0,0 +1,18 @@ | |||
| 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 | internal class Program | ||
| 8 | { | ||
| 9 | private static int Main() | ||
| 10 | { | ||
| 11 | var application = new LatestCoreBA(); | ||
| 12 | |||
| 13 | ManagedBootstrapperApplication.Run(application); | ||
| 14 | |||
| 15 | return 0; | ||
| 16 | } | ||
| 17 | } | ||
| 18 | } | ||
