From 284f7df20bd0402daeb559343aa4bd003a9ab71e Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 10 Jan 2022 14:51:51 -0800 Subject: Inscribe no longer a global backend concept The support steps around signing are specialized for each output type. Trying to normalize the process across backends was not a fruitful endeavor. --- .../Data/IInscribeContext.cs | 21 ---- src/api/wix/WixToolset.Extensibility/IBackend.cs | 2 - src/wix/WixToolset.BuildTasks/Insignia.cs | 120 --------------------- src/wix/WixToolset.Core.Burn/BundleBackend.cs | 5 - .../WixToolset.Core.WindowsInstaller/MsiBackend.cs | 9 -- .../WixToolset.Core.WindowsInstaller/MsmBackend.cs | 2 - .../WixToolset.Core.WindowsInstaller/MspBackend.cs | 2 - .../WixToolset.Core.WindowsInstaller/MstBackend.cs | 7 +- src/wix/WixToolset.Core/IncribeContext.cs | 26 ----- .../WixToolset.Core/WixToolsetServiceProvider.cs | 1 - 10 files changed, 1 insertion(+), 194 deletions(-) delete mode 100644 src/api/wix/WixToolset.Extensibility/Data/IInscribeContext.cs delete mode 100644 src/wix/WixToolset.BuildTasks/Insignia.cs delete mode 100644 src/wix/WixToolset.Core/IncribeContext.cs diff --git a/src/api/wix/WixToolset.Extensibility/Data/IInscribeContext.cs b/src/api/wix/WixToolset.Extensibility/Data/IInscribeContext.cs deleted file mode 100644 index 31c66aad..00000000 --- a/src/api/wix/WixToolset.Extensibility/Data/IInscribeContext.cs +++ /dev/null @@ -1,21 +0,0 @@ -// 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.Extensibility.Data -{ - using System; - using WixToolset.Extensibility.Services; - -#pragma warning disable 1591 // TODO: add documentation - public interface IInscribeContext - { - IServiceProvider ServiceProvider { get; } - - string InputFilePath { get; set; } - - string IntermediateFolder { get; set; } - - string OutputFile { get; set; } - - string SignedEngineFile { get; set; } - } -} diff --git a/src/api/wix/WixToolset.Extensibility/IBackend.cs b/src/api/wix/WixToolset.Extensibility/IBackend.cs index 9579c3ca..be8406e4 100644 --- a/src/api/wix/WixToolset.Extensibility/IBackend.cs +++ b/src/api/wix/WixToolset.Extensibility/IBackend.cs @@ -13,7 +13,5 @@ namespace WixToolset.Extensibility IDecompileResult Decompile(IDecompileContext context); Intermediate Unbind(IUnbindContext context); - - bool Inscribe(IInscribeContext context); } } diff --git a/src/wix/WixToolset.BuildTasks/Insignia.cs b/src/wix/WixToolset.BuildTasks/Insignia.cs deleted file mode 100644 index d89770db..00000000 --- a/src/wix/WixToolset.BuildTasks/Insignia.cs +++ /dev/null @@ -1,120 +0,0 @@ -// 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.BuildTasks -{ - using System; - using System.Diagnostics; - using System.Globalization; - using System.IO; - using System.Text; - - using Microsoft.Build.Framework; - using Microsoft.Build.Utilities; - -#if false - /// - /// An MSBuild task to run the WiX transform generator. - /// - public sealed class Insignia : WixToolTask - { - private const string InsigniaToolName = "insignia.exe"; - - /// - /// Gets or sets the path to the database to inscribe. - /// - public ITaskItem DatabaseFile { get; set; } - - /// - /// Gets or sets the path to the bundle to inscribe. - /// - public ITaskItem BundleFile { get; set; } - - /// - /// Gets or sets the path to the original bundle that contains the attached container. - /// - public ITaskItem OriginalBundleFile { get; set; } - - /// - /// Gets or sets the path to output the inscribed result. - /// - [Required] - public ITaskItem OutputFile { get; set; } - - /// - /// Gets or sets the output. Only set if insignia does work. - /// - [Output] - public ITaskItem Output { get; set; } - - /// - /// Get the name of the executable. - /// - /// The ToolName is used with the ToolPath to get the location of Insignia.exe. - /// The name of the executable. - protected override string ToolName - { - get { return InsigniaToolName; } - } - - /// - /// Get the path to the executable. - /// - /// GetFullPathToTool is only called when the ToolPath property is not set (see the ToolName remarks above). - /// The full path to the executable or simply Insignia.exe if it's expected to be in the system path. - protected override string GenerateFullPathToTool() - { - // If there's not a ToolPath specified, it has to be in the system path. - if (String.IsNullOrEmpty(this.ToolPath)) - { - return InsigniaToolName; - } - - return Path.Combine(Path.GetFullPath(this.ToolPath), InsigniaToolName); - } - - /// - /// Builds a command line from options in this task. - /// - protected override void BuildCommandLine(WixCommandLineBuilder commandLineBuilder) - { - base.BuildCommandLine(commandLineBuilder); - - commandLineBuilder.AppendSwitchIfNotNull("-im ", this.DatabaseFile); - if (null != this.OriginalBundleFile) - { - commandLineBuilder.AppendSwitchIfNotNull("-ab ", this.BundleFile); - commandLineBuilder.AppendFileNameIfNotNull(this.OriginalBundleFile); - } - else - { - commandLineBuilder.AppendSwitchIfNotNull("-ib ", this.BundleFile); - } - - commandLineBuilder.AppendSwitchIfNotNull("-out ", this.OutputFile); - commandLineBuilder.AppendTextIfNotNull(this.AdditionalOptions); - } - - /// - /// Executes a tool in-process by loading the tool assembly and invoking its entrypoint. - /// - /// Path to the tool to be executed; must be a managed executable. - /// Commands to be written to a response file. - /// Commands to be passed directly on the command-line. - /// The tool exit code. - protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands) - { - int returnCode = base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands); - if (0 == returnCode) // successfully did work. - { - this.Output = this.OutputFile; - } - else if (-1 == returnCode) // no work done. - { - returnCode = 0; - } - - return returnCode; - } - } -#endif -} diff --git a/src/wix/WixToolset.Core.Burn/BundleBackend.cs b/src/wix/WixToolset.Core.Burn/BundleBackend.cs index b179ea50..fa66ab1f 100644 --- a/src/wix/WixToolset.Core.Burn/BundleBackend.cs +++ b/src/wix/WixToolset.Core.Burn/BundleBackend.cs @@ -45,11 +45,6 @@ namespace WixToolset.Core.Burn throw new NotImplementedException(); } - public bool Inscribe(IInscribeContext context) - { - return false; - } - public Intermediate Unbind(IUnbindContext context) { var uxExtractPath = Path.Combine(context.ExportBasePath, "UX"); diff --git a/src/wix/WixToolset.Core.WindowsInstaller/MsiBackend.cs b/src/wix/WixToolset.Core.WindowsInstaller/MsiBackend.cs index ab8def5f..37de1904 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/MsiBackend.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/MsiBackend.cs @@ -2,10 +2,8 @@ namespace WixToolset.Core.WindowsInstaller { - using System; using WixToolset.Core.WindowsInstaller.Bind; using WixToolset.Core.WindowsInstaller.Decompile; - using WixToolset.Core.WindowsInstaller.Inscribe; using WixToolset.Core.WindowsInstaller.Unbind; using WixToolset.Data; using WixToolset.Extensibility; @@ -71,13 +69,6 @@ namespace WixToolset.Core.WindowsInstaller return result; } - public bool Inscribe(IInscribeContext context) - { - //var command = new InscribeMsiPackageCommand(context); - //return command.Execute(); - throw new NotImplementedException(); - } - public Intermediate Unbind(IUnbindContext context) { var command = new UnbindMsiOrMsmCommand(context); diff --git a/src/wix/WixToolset.Core.WindowsInstaller/MsmBackend.cs b/src/wix/WixToolset.Core.WindowsInstaller/MsmBackend.cs index 4927ee8c..450bf888 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/MsmBackend.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/MsmBackend.cs @@ -65,8 +65,6 @@ namespace WixToolset.Core.WindowsInstaller return result; } - public bool Inscribe(IInscribeContext context) => false; - public Intermediate Unbind(IUnbindContext context) { var command = new UnbindMsiOrMsmCommand(context); diff --git a/src/wix/WixToolset.Core.WindowsInstaller/MspBackend.cs b/src/wix/WixToolset.Core.WindowsInstaller/MspBackend.cs index c46b6027..76328bb1 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/MspBackend.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/MspBackend.cs @@ -71,8 +71,6 @@ namespace WixToolset.Core.WindowsInstaller public IDecompileResult Decompile(IDecompileContext context) => throw new NotImplementedException(); - public bool Inscribe(IInscribeContext context) => throw new NotImplementedException(); - public Intermediate Unbind(IUnbindContext context) { #if TODO_PATCHING diff --git a/src/wix/WixToolset.Core.WindowsInstaller/MstBackend.cs b/src/wix/WixToolset.Core.WindowsInstaller/MstBackend.cs index a6d86c10..8ce75265 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/MstBackend.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/MstBackend.cs @@ -30,15 +30,10 @@ namespace WixToolset.Core.WindowsInstaller throw new NotImplementedException(); } - public bool Inscribe(IInscribeContext context) - { - throw new NotImplementedException(); - } - public Intermediate Unbind(IUnbindContext context) { var command = new UnbindMsiOrMsmCommand(context); return command.Execute(); } } -} \ No newline at end of file +} diff --git a/src/wix/WixToolset.Core/IncribeContext.cs b/src/wix/WixToolset.Core/IncribeContext.cs deleted file mode 100644 index 9d7055ab..00000000 --- a/src/wix/WixToolset.Core/IncribeContext.cs +++ /dev/null @@ -1,26 +0,0 @@ -// 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 -{ - using System; - using WixToolset.Extensibility.Data; - using WixToolset.Extensibility.Services; - - internal class InscribeContext : IInscribeContext - { - public InscribeContext(IServiceProvider serviceProvider) - { - this.ServiceProvider = serviceProvider; - } - - public IServiceProvider ServiceProvider { get; } - - public string IntermediateFolder { get; set; } - - public string InputFilePath { get; set; } - - public string SignedEngineFile { get; set; } - - public string OutputFile { get; set; } - } -} diff --git a/src/wix/WixToolset.Core/WixToolsetServiceProvider.cs b/src/wix/WixToolset.Core/WixToolsetServiceProvider.cs index de89bb73..7bbd4075 100644 --- a/src/wix/WixToolset.Core/WixToolsetServiceProvider.cs +++ b/src/wix/WixToolset.Core/WixToolsetServiceProvider.cs @@ -40,7 +40,6 @@ namespace WixToolset.Core this.AddService((provider, singletons) => new BindContext(provider)); this.AddService((provider, singletons) => new DecompileContext(provider)); this.AddService((provider, singletons) => new LayoutContext(provider)); - this.AddService((provider, singletons) => new InscribeContext(provider)); this.AddService((provider, singletons) => new UnbindContext(provider)); this.AddService((provider, singletons) => new BindFileWithPath()); -- cgit v1.2.3-55-g6feb