From 21c430b0d2a46bae326655209fefde13ae17b051 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 23 Feb 2021 07:45:42 -0800 Subject: Rename FullyResolved to SymbolsFinalized and TryAddSymbolXxx to TryProcessSymbol Plus fix up more documentation --- .../BaseBurnBackendExtension.cs | 63 ++++++++-------------- .../BaseWindowsInstallerBackendBinderExtension.cs | 10 ++-- .../IBurnBackendExtension.cs | 45 ++++++++-------- .../IWindowsInstallerBackendBinderExtension.cs | 22 ++++---- 4 files changed, 61 insertions(+), 79 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Extensibility/BaseBurnBackendExtension.cs b/src/WixToolset.Extensibility/BaseBurnBackendExtension.cs index 0575d725..488f882a 100644 --- a/src/WixToolset.Extensibility/BaseBurnBackendExtension.cs +++ b/src/WixToolset.Extensibility/BaseBurnBackendExtension.cs @@ -2,6 +2,7 @@ namespace WixToolset.Extensibility { + using System; using System.Collections.Generic; using System.Linq; using WixToolset.Data; @@ -35,24 +36,8 @@ namespace WixToolset.Extensibility protected virtual IEnumerable SymbolDefinitions => Enumerable.Empty(); /// - /// Called after all output changes occur and right before the output is bound into its final format. + /// See /// - public virtual void BundleFinalize() - { - } - - /// - /// Called after output is bound into its final format. - /// - /// - public virtual void PostBackendBind(IBindResult result) - { - } - - /// - /// Called before binding occurs. - /// - /// public virtual void PreBackendBind(IBindContext context) { this.Context = context; @@ -61,44 +46,32 @@ namespace WixToolset.Extensibility } /// - /// + /// See /// - /// - /// - /// - /// - /// - /// - public virtual IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage) + public virtual IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers) { return null; } /// - /// + /// See + /// + public virtual void SymbolsFinalized(IntermediateSection section) + { + } + + /// + /// See /// - /// - /// - /// - /// - /// - /// public virtual string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName) { return null; } /// - /// Called for each extension symbol that hasn't been handled yet. - /// Use IBurnBackendHelper to add data to the appropriate data manifest. + /// See /// - /// The linked section. - /// The current symbol. - /// - /// True if the extension handled the symbol, false otherwise. - /// The Burn backend will warn on all unhandled symbols. - /// - public virtual bool TryAddSymbolToDataManifest(IntermediateSection section, IntermediateSymbol symbol) + public virtual bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol) { if (this.SymbolDefinitions.Any(t => t == symbol.Definition) && symbol.Definition.HasTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag)) @@ -109,5 +82,13 @@ namespace WixToolset.Extensibility return false; } + + /// + /// See + /// + /// + public virtual void PostBackendBind(IBindResult result) + { + } } } diff --git a/src/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs b/src/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs index c0086aed..47777fae 100644 --- a/src/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs +++ b/src/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs @@ -53,9 +53,9 @@ namespace WixToolset.Extensibility } /// - /// See + /// See /// - public virtual void FullyResolved(IntermediateSection section) + public virtual void SymbolsFinalized(IntermediateSection section) { } @@ -70,13 +70,13 @@ namespace WixToolset.Extensibility public virtual string ResolveMedia(MediaSymbol mediaRow, string mediaLayoutDirectory, string layoutDirectory) => null; /// - /// See + /// See /// - public virtual bool TryAddSymbolToOutput(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) + public virtual bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions) { if (this.TableDefinitions.Any(t => t.SymbolDefinition == symbol.Definition)) { - return this.BackendHelper.TryAddSymbolToOutputMatchingTableDefinitions(section, symbol, output, tableDefinitions); + return this.BackendHelper.TryAddSymbolToOutputMatchingTableDefinitions(section, symbol, data, tableDefinitions); } return false; diff --git a/src/WixToolset.Extensibility/IBurnBackendExtension.cs b/src/WixToolset.Extensibility/IBurnBackendExtension.cs index 769c2457..07f5cd1b 100644 --- a/src/WixToolset.Extensibility/IBurnBackendExtension.cs +++ b/src/WixToolset.Extensibility/IBurnBackendExtension.cs @@ -16,30 +16,36 @@ namespace WixToolset.Extensibility void PreBackendBind(IBindContext context); /// - /// + /// Called to find a file related to another source in the authoring. For example, most often used + /// to find cabinets and uncompressed files for an MSI package. /// - /// - /// - /// - /// - /// - /// - IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); + /// Path to the source package. + /// Expected path to the related file. + /// Type of related file, such as "File" or "Cabinet" + /// Source line number of source package. + /// IResolveFileResult if the related file was found, or null for default handling. + IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers); /// - /// + /// Called right before the output is bound into its final format. /// - /// - /// - /// - /// - /// - /// + /// The finalized intermediate section. + void SymbolsFinalized(IntermediateSection section); + + /// + /// Called to customize the DownloadUrl provided in source cde. + /// + /// The value from the source code. May not actually be a URL. + /// The default URL if the extension does not return a value. + /// Identifier of the package. + /// Identifier of the payload. + /// Filename of the payload. + /// Url to override, or null to use default value. string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName); /// /// Called for each extension symbol that hasn't been handled yet. - /// Use IBurnBackendHelper to add data to the appropriate data manifest. + /// Use IBurnBackendHelper to add data. /// /// The linked section. /// The current symbol. @@ -47,12 +53,7 @@ namespace WixToolset.Extensibility /// True if the extension handled the symbol, false otherwise. /// The Burn backend will warn on all unhandled symbols. /// - bool TryAddSymbolToDataManifest(IntermediateSection section, IntermediateSymbol symbol); - - /// - /// Called after all output changes occur and right before the output is bound into its final format. - /// - void BundleFinalize(); + bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol); /// /// Called after output is bound into its final format. diff --git a/src/WixToolset.Extensibility/IWindowsInstallerBackendBinderExtension.cs b/src/WixToolset.Extensibility/IWindowsInstallerBackendBinderExtension.cs index b913dadc..12a38b9a 100644 --- a/src/WixToolset.Extensibility/IWindowsInstallerBackendBinderExtension.cs +++ b/src/WixToolset.Extensibility/IWindowsInstallerBackendBinderExtension.cs @@ -24,10 +24,10 @@ namespace WixToolset.Extensibility void PreBackendBind(IBindContext context); /// - /// + /// Extension can process the intermediate before the Windows Installer data is created. /// - /// The resolved intermedate section. - void FullyResolved(IntermediateSection section); + /// The finalized intermediate section. + void SymbolsFinalized(IntermediateSection section); /// /// Finds an existing cabinet that contains the provided files. @@ -41,20 +41,20 @@ namespace WixToolset.Extensibility /// Override layout location for a media. /// /// Media symbol. - /// Default media layout directory. - /// Default layout directory. + /// Default media specific layout directory. + /// Default overall layout directory. /// Layout location or null to use the default processing. string ResolveMedia(MediaSymbol mediaSymbol, string mediaLayoutDirectory, string layoutDirectory); /// - /// + /// Called for each extension symbol that hasn't been handled yet. /// - /// - /// - /// Windows Installer data + /// The linked section. + /// The current symbol. + /// Windows Installer data /// Collection of table definitions available for the output. - /// True if the symbol was added to the output, or false if not. - bool TryAddSymbolToOutput(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions); + /// True if the symbol was handled, or false if not. + bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions); /// /// Called after all output changes occur and right before the output is bound into its final format. -- cgit v1.2.3-55-g6feb