diff options
Diffstat (limited to 'src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs')
| -rw-r--r-- | src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs b/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs index 20151b71..264733ac 100644 --- a/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs +++ b/src/WixToolset.Mba.Core/BaseBootstrapperApplicationFactory.cs | |||
| @@ -2,15 +2,35 @@ | |||
| 2 | 2 | ||
| 3 | namespace WixToolset.Mba.Core | 3 | namespace WixToolset.Mba.Core |
| 4 | { | 4 | { |
| 5 | using System; | ||
| 6 | using System.Runtime.InteropServices; | ||
| 7 | |||
| 5 | public abstract class BaseBootstrapperApplicationFactory : IBootstrapperApplicationFactory | 8 | public abstract class BaseBootstrapperApplicationFactory : IBootstrapperApplicationFactory |
| 6 | { | 9 | { |
| 7 | public IBootstrapperApplication Create(IBootstrapperEngine pEngine, ref Command command) | 10 | public void Create(IntPtr pArgs, IntPtr pResults) |
| 8 | { | 11 | { |
| 9 | IEngine engine = new Engine(pEngine); | 12 | InitializeFromCreateArgs(pArgs, out var engine, out var bootstrapperCommand); |
| 10 | IBootstrapperCommand bootstrapperCommand = command.GetBootstrapperCommand(); | 13 | |
| 11 | return this.Create(engine, bootstrapperCommand); | 14 | var ba = this.Create(engine, bootstrapperCommand); |
| 15 | StoreBAInCreateResults(pResults, ba); | ||
| 12 | } | 16 | } |
| 13 | 17 | ||
| 14 | protected abstract IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand); | 18 | protected abstract IBootstrapperApplication Create(IEngine engine, IBootstrapperCommand bootstrapperCommand); |
| 19 | |||
| 20 | public static void InitializeFromCreateArgs(IntPtr pArgs, out IEngine engine, out IBootstrapperCommand bootstrapperCommand) | ||
| 21 | { | ||
| 22 | Command pCommand = new Command | ||
| 23 | { | ||
| 24 | cbSize = Marshal.SizeOf(typeof(Command)) | ||
| 25 | }; | ||
| 26 | var pEngine = BalUtil.InitializeFromCreateArgs(pArgs, ref pCommand); | ||
| 27 | engine = new Engine(pEngine); | ||
| 28 | bootstrapperCommand = pCommand.GetBootstrapperCommand(); | ||
| 29 | } | ||
| 30 | |||
| 31 | public static void StoreBAInCreateResults(IntPtr pResults, IBootstrapperApplication ba) | ||
| 32 | { | ||
| 33 | BalUtil.StoreBAInCreateResults(pResults, ba); | ||
| 34 | } | ||
| 15 | } | 35 | } |
| 16 | } | 36 | } |
