From dbde9e7104b907bbbaea17e21247d8cafc8b3a4c Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 14 Oct 2017 16:12:07 -0700 Subject: Massive refactoring to introduce the concept of IBackend --- src/WixToolset.Core.WindowsInstaller/MsiBackend.cs | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/WixToolset.Core.WindowsInstaller/MsiBackend.cs (limited to 'src/WixToolset.Core.WindowsInstaller/MsiBackend.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs b/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs new file mode 100644 index 00000000..716ea000 --- /dev/null +++ b/src/WixToolset.Core.WindowsInstaller/MsiBackend.cs @@ -0,0 +1,36 @@ +// 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. + +namespace WixToolset.Core.WindowsInstaller +{ + using WixToolset.Core.WindowsInstaller.Bind; + using WixToolset.Core.WindowsInstaller.Inscribe; + using WixToolset.Core.WindowsInstaller.Unbind; + using WixToolset.Data; + using WixToolset.Data.Bind; + using WixToolset.Extensibility; + + internal class MsiBackend : IBackend + { + public BindResult Bind(IBindContext context) + { + var validator = Validator.CreateFromContext(context, "darice.cub"); + + var command = new BindDatabaseCommand(context, validator); + command.Execute(); + + return new BindResult(command.FileTransfers, command.ContentFilePaths); + } + + public bool Inscribe(IInscribeContext context) + { + var command = new InscribeMsiPackageCommand(context); + return command.Execute(); + } + + public Output Unbind(IUnbindContext context) + { + var command = new UnbindMsiOrMsmCommand(context); + return command.Execute(); + } + } +} -- cgit v1.2.3-55-g6feb