diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-01-24 15:27:20 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-02-05 16:15:47 -0800 |
| commit | 6ff680e386b1543ad1a58d1b1d465ce8aa20bc7d (patch) | |
| tree | c717333cd10d5592e59dfb898b391275bba1f389 /src/WixToolset.Core.WindowsInstaller/MspBackend.cs | |
| parent | 6e2e67ab55c75f4655397588c0dcc64f50d22f92 (diff) | |
| download | wix-6ff680e386b1543ad1a58d1b1d465ce8aa20bc7d.tar.gz wix-6ff680e386b1543ad1a58d1b1d465ce8aa20bc7d.tar.bz2 wix-6ff680e386b1543ad1a58d1b1d465ce8aa20bc7d.zip | |
Start on new patch infrastructure
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/MspBackend.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/MspBackend.cs | 68 |
1 files changed, 53 insertions, 15 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/MspBackend.cs b/src/WixToolset.Core.WindowsInstaller/MspBackend.cs index b6e72e11..8aa450bf 100644 --- a/src/WixToolset.Core.WindowsInstaller/MspBackend.cs +++ b/src/WixToolset.Core.WindowsInstaller/MspBackend.cs | |||
| @@ -3,36 +3,74 @@ | |||
| 3 | namespace WixToolset.Core.WindowsInstaller | 3 | namespace WixToolset.Core.WindowsInstaller |
| 4 | { | 4 | { |
| 5 | using System; | 5 | using System; |
| 6 | using System.ComponentModel; | 6 | using System.Collections.Generic; |
| 7 | using System.IO; | 7 | using System.IO; |
| 8 | using WixToolset.Core.Native; | 8 | using System.Linq; |
| 9 | using WixToolset.Core.WindowsInstaller.Bind; | ||
| 10 | using WixToolset.Core.WindowsInstaller.Msi; | ||
| 9 | using WixToolset.Core.WindowsInstaller.Unbind; | 11 | using WixToolset.Core.WindowsInstaller.Unbind; |
| 10 | using WixToolset.Data; | 12 | using WixToolset.Data; |
| 11 | using WixToolset.Data.Bind; | 13 | using WixToolset.Data.Tuples; |
| 14 | using WixToolset.Data.WindowsInstaller; | ||
| 12 | using WixToolset.Extensibility; | 15 | using WixToolset.Extensibility; |
| 13 | using WixToolset.Extensibility.Data; | 16 | using WixToolset.Extensibility.Data; |
| 14 | using WixToolset.Ole32; | 17 | using WixToolset.Extensibility.Services; |
| 15 | 18 | ||
| 16 | internal class MspBackend : IBackend | 19 | internal class MspBackend : IBackend |
| 17 | { | 20 | { |
| 18 | public IBindResult Bind(IBindContext context) | 21 | public IBindResult Bind(IBindContext context) |
| 19 | { | 22 | { |
| 20 | throw new NotImplementedException(); | 23 | var messaging = context.ServiceProvider.GetService<IMessaging>(); |
| 21 | } | ||
| 22 | 24 | ||
| 23 | public IDecompileResult Decompile(IDecompileContext context) | 25 | var extensionManager = context.ServiceProvider.GetService<IExtensionManager>(); |
| 24 | { | ||
| 25 | throw new NotImplementedException(); | ||
| 26 | } | ||
| 27 | 26 | ||
| 28 | public bool Inscribe(IInscribeContext context) | 27 | var backendExtensions = extensionManager.GetServices<IWindowsInstallerBackendBinderExtension>(); |
| 29 | { | 28 | |
| 30 | throw new NotImplementedException(); | 29 | foreach (var extension in backendExtensions) |
| 30 | { | ||
| 31 | extension.PreBackendBind(context); | ||
| 32 | } | ||
| 33 | |||
| 34 | // Create transforms named in patch transforms. | ||
| 35 | IEnumerable<PatchTransform> patchTransforms; | ||
| 36 | { | ||
| 37 | var command = new CreatePatchTransformsCommand(messaging, context.IntermediateRepresentation, context.IntermediateFolder); | ||
| 38 | patchTransforms = command.Execute(); | ||
| 39 | } | ||
| 40 | |||
| 41 | // Enhance the intermediate by attaching the created patch transforms. | ||
| 42 | IEnumerable<SubStorage> subStorages; | ||
| 43 | { | ||
| 44 | var command = new AttachPatchTransformsCommand(messaging, context.IntermediateRepresentation, patchTransforms); | ||
| 45 | subStorages = command.Execute(); | ||
| 46 | } | ||
| 47 | |||
| 48 | // Create WindowsInstallerData with patch metdata and transforms as sub-storages | ||
| 49 | // Create MSP from WindowsInstallerData | ||
| 50 | using (var command = new BindDatabaseCommand(context, backendExtensions, subStorages, null)) | ||
| 51 | { | ||
| 52 | command.Execute(); | ||
| 53 | |||
| 54 | var result = context.ServiceProvider.GetService<IBindResult>(); | ||
| 55 | result.FileTransfers = command.FileTransfers; | ||
| 56 | result.TrackedFiles = command.TrackedFiles; | ||
| 57 | |||
| 58 | foreach (var extension in backendExtensions) | ||
| 59 | { | ||
| 60 | extension.PostBackendBind(result, command.Wixout); | ||
| 61 | } | ||
| 62 | |||
| 63 | return result; | ||
| 64 | } | ||
| 31 | } | 65 | } |
| 32 | 66 | ||
| 67 | public IDecompileResult Decompile(IDecompileContext context) => throw new NotImplementedException(); | ||
| 68 | |||
| 69 | public bool Inscribe(IInscribeContext context) => throw new NotImplementedException(); | ||
| 70 | |||
| 33 | public Intermediate Unbind(IUnbindContext context) | 71 | public Intermediate Unbind(IUnbindContext context) |
| 34 | { | 72 | { |
| 35 | #if REVISIT_FOR_PATCHING | 73 | #if TODO_PATCHING |
| 36 | Output patch; | 74 | Output patch; |
| 37 | 75 | ||
| 38 | // patch files are essentially database files (use a special flag to let the API know its a patch file) | 76 | // patch files are essentially database files (use a special flag to let the API know its a patch file) |
| @@ -116,4 +154,4 @@ namespace WixToolset.Core.WindowsInstaller | |||
| 116 | throw new NotImplementedException(); | 154 | throw new NotImplementedException(); |
| 117 | } | 155 | } |
| 118 | } | 156 | } |
| 119 | } \ No newline at end of file | 157 | } |
