aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
index 53451752..411f64bf 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
@@ -32,8 +32,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
32 32
33 this.PathResolver = this.ServiceProvider.GetService<IPathResolver>(); 33 this.PathResolver = this.ServiceProvider.GetService<IPathResolver>();
34 34
35 this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions();
36
37 this.CabbingThreadCount = context.CabbingThreadCount; 35 this.CabbingThreadCount = context.CabbingThreadCount;
38 this.CabCachePath = context.CabCachePath; 36 this.CabCachePath = context.CabCachePath;
39 this.Codepage = context.Codepage; 37 this.Codepage = context.Codepage;
@@ -86,8 +84,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
86 84
87 private bool SuppressLayout { get; } 85 private bool SuppressLayout { get; }
88 86
89 private TableDefinitionCollection TableDefinitions { get; }
90
91 private string IntermediateFolder { get; } 87 private string IntermediateFolder { get; }
92 88
93 private Validator Validator { get; } 89 private Validator Validator { get; }
@@ -111,6 +107,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind
111 // If there are any fields to resolve later, create the cache to populate during bind. 107 // If there are any fields to resolve later, create the cache to populate during bind.
112 var variableCache = this.DelayedFields.Any() ? new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase) : null; 108 var variableCache = this.DelayedFields.Any() ? new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase) : null;
113 109
110 TableDefinitionCollection tableDefinitions;
111 {
112 var command = new LoadTableDefinitionsCommand(section);
113 command.Execute();
114
115 tableDefinitions = command.TableDefinitions;
116 }
117
114 // Process the summary information table before the other tables. 118 // Process the summary information table before the other tables.
115 bool compressed; 119 bool compressed;
116 bool longNames; 120 bool longNames;
@@ -231,7 +235,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
231 command.FileFacades = fileFacades; 235 command.FileFacades = fileFacades;
232 command.UpdateFileFacades = fileFacades.Where(f => !f.FromModule); 236 command.UpdateFileFacades = fileFacades.Where(f => !f.FromModule);
233 command.OverwriteHash = true; 237 command.OverwriteHash = true;
234 command.TableDefinitions = this.TableDefinitions; 238 command.TableDefinitions = tableDefinitions;
235 command.VariableCache = variableCache; 239 command.VariableCache = variableCache;
236 command.Execute(); 240 command.Execute();
237 } 241 }
@@ -308,7 +312,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
308 // Time to create the output object. Try to put as much above here as possible, updating the IR is better. 312 // Time to create the output object. Try to put as much above here as possible, updating the IR is better.
309 Output output; 313 Output output;
310 { 314 {
311 var command = new CreateOutputFromIRCommand(section, this.TableDefinitions, this.BackendExtensions); 315 var command = new CreateOutputFromIRCommand(this.Messaging, section, tableDefinitions, this.BackendExtensions);
312 command.Execute(); 316 command.Execute();
313 317
314 output = command.Output; 318 output = command.Output;
@@ -402,7 +406,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
402 command.Compressed = compressed; 406 command.Compressed = compressed;
403 command.FileRowsByCabinet = filesByCabinetMedia; 407 command.FileRowsByCabinet = filesByCabinetMedia;
404 command.ResolveMedia = this.ResolveMedia; 408 command.ResolveMedia = this.ResolveMedia;
405 command.TableDefinitions = this.TableDefinitions; 409 command.TableDefinitions = tableDefinitions;
406 command.TempFilesLocation = this.IntermediateFolder; 410 command.TempFilesLocation = this.IntermediateFolder;
407 command.Execute(); 411 command.Execute();
408 412
@@ -429,11 +433,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind
429 // Generate database file. 433 // Generate database file.
430 this.Messaging.Write(VerboseMessages.GeneratingDatabase()); 434 this.Messaging.Write(VerboseMessages.GeneratingDatabase());
431 435
432 var trackMsi = this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.Final); 436 {
433 trackedFiles.Add(trackMsi); 437 var trackMsi = this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.Final);
438 trackedFiles.Add(trackMsi);
434 439
435 var temporaryFiles = this.GenerateDatabase(output, trackMsi.Path, false, false); 440 var temporaryFiles = this.GenerateDatabase(output, tableDefinitions, trackMsi.Path, false, false);
436 trackedFiles.AddRange(temporaryFiles); 441 trackedFiles.AddRange(temporaryFiles);
442 }
437 443
438 // Stop processing if an error previously occurred. 444 // Stop processing if an error previously occurred.
439 if (this.Messaging.EncounteredError) 445 if (this.Messaging.EncounteredError)
@@ -456,7 +462,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
456 462
457 if (null == sequenceTable) 463 if (null == sequenceTable)
458 { 464 {
459 sequenceTable = output.EnsureTable(this.TableDefinitions[sequenceTableName]); 465 sequenceTable = output.EnsureTable(tableDefinitions[sequenceTableName]);
460 } 466 }
461 467
462 if (0 == sequenceTable.Rows.Count) 468 if (0 == sequenceTable.Rows.Count)
@@ -911,7 +917,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
911 /// <param name="databaseFile">The database file to create.</param> 917 /// <param name="databaseFile">The database file to create.</param>
912 /// <param name="keepAddedColumns">Whether to keep columns added in a transform.</param> 918 /// <param name="keepAddedColumns">Whether to keep columns added in a transform.</param>
913 /// <param name="useSubdirectory">Whether to use a subdirectory based on the <paramref name="databaseFile"/> file name for intermediate files.</param> 919 /// <param name="useSubdirectory">Whether to use a subdirectory based on the <paramref name="databaseFile"/> file name for intermediate files.</param>
914 private IEnumerable<ITrackedFile> GenerateDatabase(Output output, string databaseFile, bool keepAddedColumns, bool useSubdirectory) 920 private IEnumerable<ITrackedFile> GenerateDatabase(Output output, TableDefinitionCollection tableDefinitions, string databaseFile, bool keepAddedColumns, bool useSubdirectory)
915 { 921 {
916 var command = new GenerateDatabaseCommand(); 922 var command = new GenerateDatabaseCommand();
917 command.BackendHelper = this.BackendHelper; 923 command.BackendHelper = this.BackendHelper;
@@ -921,7 +927,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
921 command.KeepAddedColumns = keepAddedColumns; 927 command.KeepAddedColumns = keepAddedColumns;
922 command.UseSubDirectory = useSubdirectory; 928 command.UseSubDirectory = useSubdirectory;
923 command.SuppressAddingValidationRows = this.SuppressAddingValidationRows; 929 command.SuppressAddingValidationRows = this.SuppressAddingValidationRows;
924 command.TableDefinitions = this.TableDefinitions; 930 command.TableDefinitions = tableDefinitions;
925 command.IntermediateFolder = this.IntermediateFolder; 931 command.IntermediateFolder = this.IntermediateFolder;
926 command.Codepage = this.Codepage; 932 command.Codepage = this.Codepage;
927 command.Execute(); 933 command.Execute();