diff options
Diffstat (limited to 'src')
4 files changed, 61 insertions, 79 deletions
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 @@ | |||
| 2 | 2 | ||
| 3 | namespace WixToolset.Extensibility | 3 | namespace WixToolset.Extensibility |
| 4 | { | 4 | { |
| 5 | using System; | ||
| 5 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
| 6 | using System.Linq; | 7 | using System.Linq; |
| 7 | using WixToolset.Data; | 8 | using WixToolset.Data; |
| @@ -35,24 +36,8 @@ namespace WixToolset.Extensibility | |||
| 35 | protected virtual IEnumerable<IntermediateSymbolDefinition> SymbolDefinitions => Enumerable.Empty<IntermediateSymbolDefinition>(); | 36 | protected virtual IEnumerable<IntermediateSymbolDefinition> SymbolDefinitions => Enumerable.Empty<IntermediateSymbolDefinition>(); |
| 36 | 37 | ||
| 37 | /// <summary> | 38 | /// <summary> |
| 38 | /// Called after all output changes occur and right before the output is bound into its final format. | 39 | /// See <see cref="IBurnBackendExtension.PreBackendBind(IBindContext)"/> |
| 39 | /// </summary> | 40 | /// </summary> |
| 40 | public virtual void BundleFinalize() | ||
| 41 | { | ||
| 42 | } | ||
| 43 | |||
| 44 | /// <summary> | ||
| 45 | /// Called after output is bound into its final format. | ||
| 46 | /// </summary> | ||
| 47 | /// <param name="result"></param> | ||
| 48 | public virtual void PostBackendBind(IBindResult result) | ||
| 49 | { | ||
| 50 | } | ||
| 51 | |||
| 52 | /// <summary> | ||
| 53 | /// Called before binding occurs. | ||
| 54 | /// </summary> | ||
| 55 | /// <param name="context"></param> | ||
| 56 | public virtual void PreBackendBind(IBindContext context) | 41 | public virtual void PreBackendBind(IBindContext context) |
| 57 | { | 42 | { |
| 58 | this.Context = context; | 43 | this.Context = context; |
| @@ -61,44 +46,32 @@ namespace WixToolset.Extensibility | |||
| 61 | } | 46 | } |
| 62 | 47 | ||
| 63 | /// <summary> | 48 | /// <summary> |
| 64 | /// | 49 | /// See <see cref="IBurnBackendExtension.ResolveRelatedFile(String, String, String, SourceLineNumber)"/> |
| 65 | /// </summary> | 50 | /// </summary> |
| 66 | /// <param name="source"></param> | 51 | public virtual IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers) |
| 67 | /// <param name="relatedSource"></param> | ||
| 68 | /// <param name="type"></param> | ||
| 69 | /// <param name="sourceLineNumbers"></param> | ||
| 70 | /// <param name="bindStage"></param> | ||
| 71 | /// <returns></returns> | ||
| 72 | public virtual IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage) | ||
| 73 | { | 52 | { |
| 74 | return null; | 53 | return null; |
| 75 | } | 54 | } |
| 76 | 55 | ||
| 77 | /// <summary> | 56 | /// <summary> |
| 78 | /// | 57 | /// See <see cref="IBurnBackendExtension.SymbolsFinalized(IntermediateSection)"/> |
| 58 | /// </summary> | ||
| 59 | public virtual void SymbolsFinalized(IntermediateSection section) | ||
| 60 | { | ||
| 61 | } | ||
| 62 | |||
| 63 | /// <summary> | ||
| 64 | /// See <see cref="IBurnBackendExtension.ResolveUrl(String, String, String, String, String)"/> | ||
| 79 | /// </summary> | 65 | /// </summary> |
| 80 | /// <param name="url"></param> | ||
| 81 | /// <param name="fallbackUrl"></param> | ||
| 82 | /// <param name="packageId"></param> | ||
| 83 | /// <param name="payloadId"></param> | ||
| 84 | /// <param name="fileName"></param> | ||
| 85 | /// <returns></returns> | ||
| 86 | public virtual string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName) | 66 | public virtual string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName) |
| 87 | { | 67 | { |
| 88 | return null; | 68 | return null; |
| 89 | } | 69 | } |
| 90 | 70 | ||
| 91 | /// <summary> | 71 | /// <summary> |
| 92 | /// Called for each extension symbol that hasn't been handled yet. | 72 | /// See <see cref="IBurnBackendExtension.TryProcessSymbol(IntermediateSection, IntermediateSymbol)"/> |
| 93 | /// Use IBurnBackendHelper to add data to the appropriate data manifest. | ||
| 94 | /// </summary> | 73 | /// </summary> |
| 95 | /// <param name="section">The linked section.</param> | 74 | public virtual bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol) |
| 96 | /// <param name="symbol">The current symbol.</param> | ||
| 97 | /// <returns> | ||
| 98 | /// True if the extension handled the symbol, false otherwise. | ||
| 99 | /// The Burn backend will warn on all unhandled symbols. | ||
| 100 | /// </returns> | ||
| 101 | public virtual bool TryAddSymbolToDataManifest(IntermediateSection section, IntermediateSymbol symbol) | ||
| 102 | { | 75 | { |
| 103 | if (this.SymbolDefinitions.Any(t => t == symbol.Definition) && | 76 | if (this.SymbolDefinitions.Any(t => t == symbol.Definition) && |
| 104 | symbol.Definition.HasTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag)) | 77 | symbol.Definition.HasTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag)) |
| @@ -109,5 +82,13 @@ namespace WixToolset.Extensibility | |||
| 109 | 82 | ||
| 110 | return false; | 83 | return false; |
| 111 | } | 84 | } |
| 85 | |||
| 86 | /// <summary> | ||
| 87 | /// See <see cref="IBurnBackendExtension.PostBackendBind(IBindResult)"/> | ||
| 88 | /// </summary> | ||
| 89 | /// <param name="result"></param> | ||
| 90 | public virtual void PostBackendBind(IBindResult result) | ||
| 91 | { | ||
| 92 | } | ||
| 112 | } | 93 | } |
| 113 | } | 94 | } |
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 | |||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | /// <summary> | 55 | /// <summary> |
| 56 | /// See <see cref="IWindowsInstallerBackendBinderExtension.FullyResolved(IntermediateSection)"/> | 56 | /// See <see cref="IWindowsInstallerBackendBinderExtension.SymbolsFinalized(IntermediateSection)"/> |
| 57 | /// </summary> | 57 | /// </summary> |
| 58 | public virtual void FullyResolved(IntermediateSection section) | 58 | public virtual void SymbolsFinalized(IntermediateSection section) |
| 59 | { | 59 | { |
| 60 | } | 60 | } |
| 61 | 61 | ||
| @@ -70,13 +70,13 @@ namespace WixToolset.Extensibility | |||
| 70 | public virtual string ResolveMedia(MediaSymbol mediaRow, string mediaLayoutDirectory, string layoutDirectory) => null; | 70 | public virtual string ResolveMedia(MediaSymbol mediaRow, string mediaLayoutDirectory, string layoutDirectory) => null; |
| 71 | 71 | ||
| 72 | /// <summary> | 72 | /// <summary> |
| 73 | /// See <see cref="IWindowsInstallerBackendBinderExtension.PreBackendBind(IBindContext)"/> | 73 | /// See <see cref="IWindowsInstallerBackendBinderExtension.TryProcessSymbol(IntermediateSection, IntermediateSymbol, WindowsInstallerData, TableDefinitionCollection)"/> |
| 74 | /// </summary> | 74 | /// </summary> |
| 75 | public virtual bool TryAddSymbolToOutput(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions) | 75 | public virtual bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions) |
| 76 | { | 76 | { |
| 77 | if (this.TableDefinitions.Any(t => t.SymbolDefinition == symbol.Definition)) | 77 | if (this.TableDefinitions.Any(t => t.SymbolDefinition == symbol.Definition)) |
| 78 | { | 78 | { |
| 79 | return this.BackendHelper.TryAddSymbolToOutputMatchingTableDefinitions(section, symbol, output, tableDefinitions); | 79 | return this.BackendHelper.TryAddSymbolToOutputMatchingTableDefinitions(section, symbol, data, tableDefinitions); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | return false; | 82 | 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 | |||
| 16 | void PreBackendBind(IBindContext context); | 16 | void PreBackendBind(IBindContext context); |
| 17 | 17 | ||
| 18 | /// <summary> | 18 | /// <summary> |
| 19 | /// | 19 | /// Called to find a file related to another source in the authoring. For example, most often used |
| 20 | /// to find cabinets and uncompressed files for an MSI package. | ||
| 20 | /// </summary> | 21 | /// </summary> |
| 21 | /// <param name="source"></param> | 22 | /// <param name="source">Path to the source package.</param> |
| 22 | /// <param name="relatedSource"></param> | 23 | /// <param name="relatedSource">Expected path to the related file.</param> |
| 23 | /// <param name="type"></param> | 24 | /// <param name="type">Type of related file, such as "File" or "Cabinet"</param> |
| 24 | /// <param name="sourceLineNumbers"></param> | 25 | /// <param name="sourceLineNumbers">Source line number of source package.</param> |
| 25 | /// <param name="bindStage"></param> | 26 | /// <returns><c>IResolveFileResult</c> if the related file was found, or null for default handling.</returns> |
| 26 | /// <returns></returns> | 27 | IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers); |
| 27 | IResolveFileResult ResolveRelatedFile(string source, string relatedSource, string type, SourceLineNumber sourceLineNumbers, BindStage bindStage); | ||
| 28 | 28 | ||
| 29 | /// <summary> | 29 | /// <summary> |
| 30 | /// | 30 | /// Called right before the output is bound into its final format. |
| 31 | /// </summary> | 31 | /// </summary> |
| 32 | /// <param name="url"></param> | 32 | /// <param name="section">The finalized intermediate section.</param> |
| 33 | /// <param name="fallbackUrl"></param> | 33 | void SymbolsFinalized(IntermediateSection section); |
| 34 | /// <param name="packageId"></param> | 34 | |
| 35 | /// <param name="payloadId"></param> | 35 | /// <summary> |
| 36 | /// <param name="fileName"></param> | 36 | /// Called to customize the DownloadUrl provided in source cde. |
| 37 | /// <returns></returns> | 37 | /// </summary> |
| 38 | /// <param name="url">The value from the source code. May not actually be a URL.</param> | ||
| 39 | /// <param name="fallbackUrl">The default URL if the extension does not return a value.</param> | ||
| 40 | /// <param name="packageId">Identifier of the package.</param> | ||
| 41 | /// <param name="payloadId">Identifier of the payload.</param> | ||
| 42 | /// <param name="fileName">Filename of the payload.</param> | ||
| 43 | /// <returns>Url to override, or null to use default value.</returns> | ||
| 38 | string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName); | 44 | string ResolveUrl(string url, string fallbackUrl, string packageId, string payloadId, string fileName); |
| 39 | 45 | ||
| 40 | /// <summary> | 46 | /// <summary> |
| 41 | /// Called for each extension symbol that hasn't been handled yet. | 47 | /// Called for each extension symbol that hasn't been handled yet. |
| 42 | /// Use IBurnBackendHelper to add data to the appropriate data manifest. | 48 | /// Use IBurnBackendHelper to add data. |
| 43 | /// </summary> | 49 | /// </summary> |
| 44 | /// <param name="section">The linked section.</param> | 50 | /// <param name="section">The linked section.</param> |
| 45 | /// <param name="symbol">The current symbol.</param> | 51 | /// <param name="symbol">The current symbol.</param> |
| @@ -47,12 +53,7 @@ namespace WixToolset.Extensibility | |||
| 47 | /// True if the extension handled the symbol, false otherwise. | 53 | /// True if the extension handled the symbol, false otherwise. |
| 48 | /// The Burn backend will warn on all unhandled symbols. | 54 | /// The Burn backend will warn on all unhandled symbols. |
| 49 | /// </returns> | 55 | /// </returns> |
| 50 | bool TryAddSymbolToDataManifest(IntermediateSection section, IntermediateSymbol symbol); | 56 | bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol); |
| 51 | |||
| 52 | /// <summary> | ||
| 53 | /// Called after all output changes occur and right before the output is bound into its final format. | ||
| 54 | /// </summary> | ||
| 55 | void BundleFinalize(); | ||
| 56 | 57 | ||
| 57 | /// <summary> | 58 | /// <summary> |
| 58 | /// Called after output is bound into its final format. | 59 | /// 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 | |||
| 24 | void PreBackendBind(IBindContext context); | 24 | void PreBackendBind(IBindContext context); |
| 25 | 25 | ||
| 26 | /// <summary> | 26 | /// <summary> |
| 27 | /// | 27 | /// Extension can process the intermediate before the Windows Installer data is created. |
| 28 | /// </summary> | 28 | /// </summary> |
| 29 | /// <param name="section">The resolved intermedate section.</param> | 29 | /// <param name="section">The finalized intermediate section.</param> |
| 30 | void FullyResolved(IntermediateSection section); | 30 | void SymbolsFinalized(IntermediateSection section); |
| 31 | 31 | ||
| 32 | /// <summary> | 32 | /// <summary> |
| 33 | /// Finds an existing cabinet that contains the provided files. | 33 | /// Finds an existing cabinet that contains the provided files. |
| @@ -41,20 +41,20 @@ namespace WixToolset.Extensibility | |||
| 41 | /// Override layout location for a media. | 41 | /// Override layout location for a media. |
| 42 | /// </summary> | 42 | /// </summary> |
| 43 | /// <param name="mediaSymbol">Media symbol.</param> | 43 | /// <param name="mediaSymbol">Media symbol.</param> |
| 44 | /// <param name="mediaLayoutDirectory">Default media layout directory.</param> | 44 | /// <param name="mediaLayoutDirectory">Default media specific layout directory.</param> |
| 45 | /// <param name="layoutDirectory">Default layout directory.</param> | 45 | /// <param name="layoutDirectory">Default overall layout directory.</param> |
| 46 | /// <returns>Layout location or null to use the default processing.</returns> | 46 | /// <returns>Layout location or null to use the default processing.</returns> |
| 47 | string ResolveMedia(MediaSymbol mediaSymbol, string mediaLayoutDirectory, string layoutDirectory); | 47 | string ResolveMedia(MediaSymbol mediaSymbol, string mediaLayoutDirectory, string layoutDirectory); |
| 48 | 48 | ||
| 49 | /// <summary> | 49 | /// <summary> |
| 50 | /// | 50 | /// Called for each extension symbol that hasn't been handled yet. |
| 51 | /// </summary> | 51 | /// </summary> |
| 52 | /// <param name="section"></param> | 52 | /// <param name="section">The linked section.</param> |
| 53 | /// <param name="symbol"></param> | 53 | /// <param name="symbol">The current symbol.</param> |
| 54 | /// <param name="output">Windows Installer data </param> | 54 | /// <param name="data">Windows Installer data </param> |
| 55 | /// <param name="tableDefinitions">Collection of table definitions available for the output.</param> | 55 | /// <param name="tableDefinitions">Collection of table definitions available for the output.</param> |
| 56 | /// <returns>True if the symbol was added to the output, or false if not.</returns> | 56 | /// <returns>True if the symbol was handled, or false if not.</returns> |
| 57 | bool TryAddSymbolToOutput(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions); | 57 | bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions); |
| 58 | 58 | ||
| 59 | /// <summary> | 59 | /// <summary> |
| 60 | /// Called after all output changes occur and right before the output is bound into its final format. | 60 | /// Called after all output changes occur and right before the output is bound into its final format. |
