diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-10-14 16:12:07 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-10-14 16:12:07 -0700 |
| commit | dbde9e7104b907bbbaea17e21247d8cafc8b3a4c (patch) | |
| tree | 0f5fbbb6fe12c6b2e5e622a0e18ce4c5b4eb2b96 /src/WixToolset.Core.Burn/BundleBackend.cs | |
| parent | fbf986eb97f68396797a89fc7d40dec07b775440 (diff) | |
| download | wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.tar.gz wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.tar.bz2 wix-dbde9e7104b907bbbaea17e21247d8cafc8b3a4c.zip | |
Massive refactoring to introduce the concept of IBackend
Diffstat (limited to 'src/WixToolset.Core.Burn/BundleBackend.cs')
| -rw-r--r-- | src/WixToolset.Core.Burn/BundleBackend.cs | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/WixToolset.Core.Burn/BundleBackend.cs b/src/WixToolset.Core.Burn/BundleBackend.cs new file mode 100644 index 00000000..ef4d362c --- /dev/null +++ b/src/WixToolset.Core.Burn/BundleBackend.cs | |||
| @@ -0,0 +1,58 @@ | |||
| 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 WixToolset.Core.Burn | ||
| 4 | { | ||
| 5 | using System; | ||
| 6 | using System.IO; | ||
| 7 | using WixToolset.Core.Burn.Bundles; | ||
| 8 | using WixToolset.Core.Burn.Inscribe; | ||
| 9 | using WixToolset.Data; | ||
| 10 | using WixToolset.Data.Bind; | ||
| 11 | using WixToolset.Extensibility; | ||
| 12 | |||
| 13 | internal class BundleBackend : IBackend | ||
| 14 | { | ||
| 15 | public BindResult Bind(IBindContext context) | ||
| 16 | { | ||
| 17 | BindBundleCommand command = new BindBundleCommand(context); | ||
| 18 | //command.DefaultCompressionLevel = context.DefaultCompressionLevel; | ||
| 19 | //command.Extensions = context.Extensions; | ||
| 20 | //command.IntermediateFolder = context.IntermediateFolder; | ||
| 21 | //command.Output = context.IntermediateRepresentation; | ||
| 22 | //command.OutputPath = context.OutputPath; | ||
| 23 | //command.PdbFile = context.OutputPdbPath; | ||
| 24 | //command.WixVariableResolver = context.WixVariableResolver; | ||
| 25 | command.Execute(); | ||
| 26 | |||
| 27 | return new BindResult(command.FileTransfers, command.ContentFilePaths); | ||
| 28 | } | ||
| 29 | |||
| 30 | public bool Inscribe(IInscribeContext context) | ||
| 31 | { | ||
| 32 | if (String.IsNullOrEmpty(context.SignedEngineFile)) | ||
| 33 | { | ||
| 34 | var command = new InscribeBundleCommand(context); | ||
| 35 | return command.Execute(); | ||
| 36 | } | ||
| 37 | else | ||
| 38 | { | ||
| 39 | var command = new InscribeBundleEngineCommand(context); | ||
| 40 | return command.Execute(); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 44 | public Output Unbind(IUnbindContext context) | ||
| 45 | { | ||
| 46 | string uxExtractPath = Path.Combine(context.ExportBasePath, "UX"); | ||
| 47 | string acExtractPath = Path.Combine(context.ExportBasePath, "AttachedContainer"); | ||
| 48 | |||
| 49 | using (BurnReader reader = BurnReader.Open(context.InputFilePath)) | ||
| 50 | { | ||
| 51 | reader.ExtractUXContainer(uxExtractPath, context.IntermediateFolder); | ||
| 52 | reader.ExtractAttachedContainer(acExtractPath, context.IntermediateFolder); | ||
| 53 | } | ||
| 54 | |||
| 55 | return null; | ||
| 56 | } | ||
| 57 | } | ||
| 58 | } | ||
