From dc9f4c329e6f55ce7595970463e0caf148096f4b Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 21 Dec 2017 13:42:52 -0800 Subject: Support wixout and extract Resolve and Layout from Binder --- .../Bind/BindDatabaseCommand.cs | 98 ++-------------------- 1 file changed, 6 insertions(+), 92 deletions(-) (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index 410e462a..2f161305 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs @@ -22,31 +22,27 @@ namespace WixToolset.Core.WindowsInstaller.Bind // As outlined in RFC 4122, this is our namespace for generating name-based (version 3) UUIDs. internal static readonly Guid WixComponentGuidNamespace = new Guid("{3064E5C6-FB63-4FE9-AC49-E446A792EFA5}"); - public BindDatabaseCommand(IBindContext context, IEnumerable backendExtension, Validator validator) + public BindDatabaseCommand(WixToolset.Extensibility.IBindContext context, IEnumerable backendExtension, Validator validator) { this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); - this.BindPaths = context.BindPaths; this.CabbingThreadCount = context.CabbingThreadCount; this.CabCachePath = context.CabCachePath; this.Codepage = context.Codepage; this.DefaultCompressionLevel = context.DefaultCompressionLevel; this.DelayedFields = context.DelayedFields; this.ExpectedEmbeddedFiles = context.ExpectedEmbeddedFiles; - this.Extensions = context.Extensions; + this.FileSystemExtensions = context.FileSystemExtensions; this.Intermediate = context.IntermediateRepresentation; this.Messaging = context.Messaging; this.OutputPath = context.OutputPath; this.PdbFile = context.OutputPdbPath; this.IntermediateFolder = context.IntermediateFolder; this.Validator = validator; - this.WixVariableResolver = context.WixVariableResolver; - + this.BackendExtensions = backendExtension; } - private IEnumerable BindPaths { get; } - private int Codepage { get; } private int CabbingThreadCount { get; } @@ -59,12 +55,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind public IEnumerable ExpectedEmbeddedFiles { get; } + public IEnumerable FileSystemExtensions { get; } + public bool DeltaBinaryPatch { get; set; } private IEnumerable BackendExtensions { get; } - private IEnumerable Extensions { get; } - private string PdbFile { get; } private Intermediate Intermediate { get; } @@ -83,7 +79,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind private Validator Validator { get; } - private IBindVariableResolver WixVariableResolver { get; } public IEnumerable FileTransfers { get; private set; } @@ -100,8 +95,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind // If there are any fields to resolve later, create the cache to populate during bind. var variableCache = this.DelayedFields.Any() ? new Dictionary(StringComparer.InvariantCultureIgnoreCase) : null; - this.LocalizeUI(section); - // Process the summary information table before the other tables. bool compressed; bool longNames; @@ -534,85 +527,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind intermediate.Save(Path.ChangeExtension(this.OutputPath, "wir")); } - /// - /// Localize dialogs and controls. - /// - /// The tables to localize. - private void LocalizeUI(IntermediateSection section) - { - foreach (var row in section.Tuples.OfType()) - { - string dialog = row.Dialog; - - if (this.WixVariableResolver.TryGetLocalizedControl(dialog, null, out LocalizedControl localizedControl)) - { - if (CompilerConstants.IntegerNotSet != localizedControl.X) - { - row.HCentering = localizedControl.X; - } - - if (CompilerConstants.IntegerNotSet != localizedControl.Y) - { - row.VCentering = localizedControl.Y; - } - - if (CompilerConstants.IntegerNotSet != localizedControl.Width) - { - row.Width = localizedControl.Width; - } - - if (CompilerConstants.IntegerNotSet != localizedControl.Height) - { - row.Height = localizedControl.Height; - } - - row.Attributes = row.Attributes | localizedControl.Attributes; - - if (!String.IsNullOrEmpty(localizedControl.Text)) - { - row.Title = localizedControl.Text; - } - } - } - - - foreach (var row in section.Tuples.OfType()) - { - string dialog = row.Dialog_; - string control = row.Control; - - if (this.WixVariableResolver.TryGetLocalizedControl(dialog, control, out LocalizedControl localizedControl)) - { - if (CompilerConstants.IntegerNotSet != localizedControl.X) - { - row.X = localizedControl.X; - } - - if (CompilerConstants.IntegerNotSet != localizedControl.Y) - { - row.Y = localizedControl.Y; - } - - if (CompilerConstants.IntegerNotSet != localizedControl.Width) - { - row.Width = localizedControl.Width; - } - - if (CompilerConstants.IntegerNotSet != localizedControl.Height) - { - row.Height = localizedControl.Height; - } - - row.Attributes = row.Attributes | localizedControl.Attributes; - - if (!String.IsNullOrEmpty(localizedControl.Text)) - { - row.Text = localizedControl.Text; - } - } - } - } - #if TODO_FINISH_PATCH /// /// Copy file data between transform substorages and the patch output object @@ -984,7 +898,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void GenerateDatabase(Output output, string databaseFile, bool keepAddedColumns, bool useSubdirectory) { var command = new GenerateDatabaseCommand(); - command.Extensions = this.Extensions; + command.Extensions = this.FileSystemExtensions; command.Output = output; command.OutputPath = databaseFile; command.KeepAddedColumns = keepAddedColumns; -- cgit v1.2.3-55-g6feb