diff options
author | Rob Mensching <rob@firegiant.com> | 2022-03-23 10:16:51 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2022-03-30 14:12:12 -0700 |
commit | eedde7ee47ab7b3bef417f2d631814b586cdb011 (patch) | |
tree | 73aa9284ee0bcbcf321528b97b17540e9b588112 | |
parent | a6f5079719f26ed809f3b60cca6f1d46e9f7423e (diff) | |
download | wix-eedde7ee47ab7b3bef417f2d631814b586cdb011.tar.gz wix-eedde7ee47ab7b3bef417f2d631814b586cdb011.tar.bz2 wix-eedde7ee47ab7b3bef417f2d631814b586cdb011.zip |
Simplify BaseWindowsInstallerBackendBinderExtension
Move the standard symbol to table row conversion into the Binder so
there is less functionality in the extension assembly.
-rw-r--r-- | src/api/wix/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs | 15 | ||||
-rw-r--r-- | src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs | 11 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/api/wix/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs b/src/api/wix/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs index ffff186b..e48579d7 100644 --- a/src/api/wix/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs +++ b/src/api/wix/WixToolset.Extensibility/BaseWindowsInstallerBackendBinderExtension.cs | |||
@@ -63,23 +63,24 @@ namespace WixToolset.Extensibility | |||
63 | /// <summary> | 63 | /// <summary> |
64 | /// See <see cref="IWindowsInstallerBackendBinderExtension.PreBackendBind(IBindContext)"/> | 64 | /// See <see cref="IWindowsInstallerBackendBinderExtension.PreBackendBind(IBindContext)"/> |
65 | /// </summary> | 65 | /// </summary> |
66 | public virtual IResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<IBindFileWithPath> files) => null; | 66 | public virtual IResolvedCabinet ResolveCabinet(string cabinetPath, IEnumerable<IBindFileWithPath> files) |
67 | { | ||
68 | return null; | ||
69 | } | ||
67 | 70 | ||
68 | /// <summary> | 71 | /// <summary> |
69 | /// See <see cref="IWindowsInstallerBackendBinderExtension.PreBackendBind(IBindContext)"/> | 72 | /// See <see cref="IWindowsInstallerBackendBinderExtension.PreBackendBind(IBindContext)"/> |
70 | /// </summary> | 73 | /// </summary> |
71 | public virtual string ResolveMedia(MediaSymbol mediaRow, string mediaLayoutDirectory, string layoutDirectory) => null; | 74 | public virtual string ResolveMedia(MediaSymbol mediaRow, string mediaLayoutDirectory, string layoutDirectory) |
75 | { | ||
76 | return null; | ||
77 | } | ||
72 | 78 | ||
73 | /// <summary> | 79 | /// <summary> |
74 | /// See <see cref="IWindowsInstallerBackendBinderExtension.TryProcessSymbol(IntermediateSection, IntermediateSymbol, WindowsInstallerData, TableDefinitionCollection)"/> | 80 | /// See <see cref="IWindowsInstallerBackendBinderExtension.TryProcessSymbol(IntermediateSection, IntermediateSymbol, WindowsInstallerData, TableDefinitionCollection)"/> |
75 | /// </summary> | 81 | /// </summary> |
76 | public virtual bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions) | 82 | public virtual bool TryProcessSymbol(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions) |
77 | { | 83 | { |
78 | if (this.TableDefinitions.Any(t => t.SymbolDefinition == symbol.Definition)) | ||
79 | { | ||
80 | return this.BackendHelper.TryAddSymbolToMatchingTableDefinitions(section, symbol, data, tableDefinitions); | ||
81 | } | ||
82 | |||
83 | return false; | 84 | return false; |
84 | } | 85 | } |
85 | 86 | ||
diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs b/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs index a4f6200e..5b44e765 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs | |||
@@ -264,7 +264,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
264 | break; | 264 | break; |
265 | 265 | ||
266 | case SymbolDefinitionType.MustBeFromAnExtension: | 266 | case SymbolDefinitionType.MustBeFromAnExtension: |
267 | unknownSymbol = !this.AddSymbolFromExtension(symbol); | 267 | if (!this.AddSymbolFromExtension(symbol)) |
268 | { | ||
269 | unknownSymbol = !this.AddSymbolDefaultly(symbol); | ||
270 | } | ||
268 | break; | 271 | break; |
269 | 272 | ||
270 | default: | 273 | default: |
@@ -1267,8 +1270,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
1267 | return false; | 1270 | return false; |
1268 | } | 1271 | } |
1269 | 1272 | ||
1270 | private bool AddSymbolDefaultly(IntermediateSymbol symbol) => | 1273 | private bool AddSymbolDefaultly(IntermediateSymbol symbol) |
1271 | this.BackendHelper.TryAddSymbolToMatchingTableDefinitions(this.Section, symbol, this.Data, this.TableDefinitions); | 1274 | { |
1275 | return this.BackendHelper.TryAddSymbolToMatchingTableDefinitions(this.Section, symbol, this.Data, this.TableDefinitions); | ||
1276 | } | ||
1272 | 1277 | ||
1273 | private void EnsureModuleIgnoredTable(IntermediateSymbol symbol, string ignoredTable) | 1278 | private void EnsureModuleIgnoredTable(IntermediateSymbol symbol, string ignoredTable) |
1274 | { | 1279 | { |