diff options
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 | } | ||