main
cs 73 lines 3.56 KB
Raw
1 // 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.
2
3 namespace WixToolset.Extensibility
4 {
5 using System.Collections.Generic;
6 using WixToolset.Data;
7 using WixToolset.Data.Symbols;
8 using WixToolset.Data.WindowsInstaller;
9 using WixToolset.Extensibility.Data;
10
11 /// <summary>
12 /// Interface all binder extensions implement.
13 /// </summary>
14 public interface IWindowsInstallerBackendBinderExtension
15 {
16 /// <summary>
17 /// Table definitions provided by the extension.
18 /// </summary>
19 IReadOnlyCollection<TableDefinition> TableDefinitions { get; }
20
21 /// <summary>
22 /// Called before binding occurs.
23 /// </summary>
24 void PreBackendBind(IBindContext context);
25
26 /// <summary>
27 /// Extension can process the intermediate before the Windows Installer data is created.
28 /// </summary>
29 /// <param name="section">The finalized intermediate section.</param>
30 void SymbolsFinalized(IntermediateSection section);
31
32 /// <summary>
33 /// Extension can process the filter ids applied to rows when processing patches.
34 /// </summary>
35 /// <param name="data">The <c>WindowsInstallerData</c> with rows to apply filters to.</param>
36 /// <param name="rowToFilterId">The mapping that applies a filter id to a row.</param>
37 /// <param name="filterIdPrefix">The prefix to use applying additional filters to rows.</param>
38 void FinalizePatchFilterIds(WindowsInstallerData data, IDictionary<Row, string> rowToFilterId, string filterIdPrefix);
39
40 /// <summary>
41 /// Finds an existing cabinet that contains the provided files.
42 /// </summary>
43 /// <param name="cabinetPath">Path to the cabinet.</param>
44 /// <param name="files">Files contained in the cabinet.</param>
45 /// <returns>Resolved cabinet options or null if the cabinet could not be found.</returns>
46 IResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<IBindFileWithPath> files);
47
48 /// <summary>
49 /// Override layout location for a media.
50 /// </summary>
51 /// <param name="mediaSymbol">Media symbol.</param>
52 /// <param name="mediaLayoutDirectory">Default media specific layout directory.</param>
53 /// <param name="layoutDirectory">Default overall layout directory.</param>
54 /// <returns>Layout location or null to use the default processing.</returns>
55 string ResolveMedia(MediaSymbol mediaSymbol, string mediaLayoutDirectory, string layoutDirectory);
56
57 /// <summary>
58 /// Called for each extension symbol that hasn't been handled yet.
59 /// </summary>
60 /// <param name="section">The linked section.</param>
61 /// <param name="symbol">The current symbol.</param>
62 /// <param name="data">Windows Installer data </param>
63 /// <param name="tableDefinitions">Collection of table definitions available for the output.</param>
64 /// <returns>True if the symbol was handled, or false if not.</returns>
65 bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions);
66
67 /// <summary>
68 /// Called after all output changes occur and right before the output is bound into its final format.
69 /// </summary>
70 /// <param name="result">Bind result to process.</param>
71 void PostBackendBind(IBindResult result);
72 }
73 }