From d529525a1e331f3ef9ec2707791c99bd78fdd82f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 30 May 2020 14:53:05 -0700 Subject: Basic patching support --- src/WixToolset.Core/Bind/FileFacade.cs | 24 +++++++++++++++++++----- src/WixToolset.Core/CommandLine/BuildCommand.cs | 1 + 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'src/WixToolset.Core') diff --git a/src/WixToolset.Core/Bind/FileFacade.cs b/src/WixToolset.Core/Bind/FileFacade.cs index 7bfdb9bb..f0ce14ca 100644 --- a/src/WixToolset.Core/Bind/FileFacade.cs +++ b/src/WixToolset.Core/Bind/FileFacade.cs @@ -15,18 +15,27 @@ namespace WixToolset.Core.Bind { this.FileTuple = file; this.AssemblyTuple = assembly; + + this.Identifier = file.Id; + this.ComponentRef = file.ComponentRef; } public FileFacade(bool fromModule, FileTuple file) { this.FromModule = fromModule; this.FileTuple = file; + + this.Identifier = file.Id; + this.ComponentRef = file.ComponentRef; } - internal FileFacade(FileRow row) + public FileFacade(FileRow row) { this.FromTransform = true; this.FileRow = row; + + this.Identifier = new Identifier(AccessModifier.Private, row.File); + this.ComponentRef = row.Component; } public bool FromModule { get; } @@ -39,11 +48,11 @@ namespace WixToolset.Core.Bind private AssemblyTuple AssemblyTuple { get; } - public string Id => this.FileRow == null ? this.FileTuple.Id.Id : this.FileRow.File; + public string Id => this.Identifier.Id; - public Identifier Identifier => this.FileRow == null ? this.FileTuple.Id : throw new NotImplementedException(); + public Identifier Identifier { get; } - public string ComponentRef => this.FileRow == null ? this.FileTuple.ComponentRef : this.FileRow.Component; + public string ComponentRef { get; } public int DiskId { @@ -137,7 +146,7 @@ namespace WixToolset.Core.Bind } } - public AssemblyType? AssemblyType => this.FileRow == null ? this.AssemblyTuple?.Type : throw new NotImplementedException(); + public AssemblyType? AssemblyType => this.FileRow == null ? this.AssemblyTuple?.Type : null; public string AssemblyApplicationFileRef => this.FileRow == null ? this.AssemblyTuple?.ApplicationFileRef : throw new NotImplementedException(); @@ -153,5 +162,10 @@ namespace WixToolset.Core.Bind /// Gets or sets the MsiFileHash row for this file. /// public MsiFileHashTuple Hash { get; set; } + + /// + /// Allows direct access to the underlying FileRow as requried for patching. + /// + public FileRow GetFileRow() => this.FileRow ?? throw new NotImplementedException(); } } diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 80003392..8392131f 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs @@ -334,6 +334,7 @@ namespace WixToolset.Core.CommandLine context.DelayedFields = resolveResult.DelayedFields; context.ExpectedEmbeddedFiles = resolveResult.ExpectedEmbeddedFiles; context.Extensions = this.ExtensionManager.GetServices(); + context.FileSystemExtensions = this.ExtensionManager.GetServices(); context.Ices = Array.Empty(); // TODO: set this correctly context.IntermediateFolder = intermediateFolder; context.IntermediateRepresentation = resolveResult.IntermediateRepresentation; -- cgit v1.2.3-55-g6feb