@joebigelow / wix / commits / 85e611c4

Remove references to "Output" and use "Data" instead

Rob Mensching committed Mar 2, 2021 at 01:49 UTC 85e611c40c3c8bf3ff3b06b52d53d046bc8ff392
4 files changed +55 -55
src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+19 -21
@@ -402,31 +402,29 @@ namespace WixToolset.Core.WindowsInstaller.Bind
402 return null;
403 }
404
405 - // Time to create the output object. Try to put as much above here as possible, updating the IR is better.
406 - WindowsInstallerData output;
405 + // Time to create the WindowsInstallerData object. Try to put as much above here as possible, updating the IR is better.
406 + WindowsInstallerData data;
407 {
408 - var command = new CreateOutputFromIRCommand(this.Messaging, section, tableDefinitions, this.BackendExtensions, this.WindowsInstallerBackendHelper);
409 - command.Execute();
410 -
411 - output = command.Output;
408 + var command = new CreateWindowsInstallerDataFromIRCommand(this.Messaging, section, tableDefinitions, this.BackendExtensions, this.WindowsInstallerBackendHelper);
409 + data = command.Execute();
410 }
411
412 IEnumerable<string> suppressedTableNames = null;
415 - if (output.Type == OutputType.Module)
413 + if (data.Type == OutputType.Module)
414 {
415 // Modularize identifiers.
418 - var modularize = new ModularizeCommand(output, modularizationSuffix, section.Symbols.OfType<WixSuppressModularizationSymbol>());
416 + var modularize = new ModularizeCommand(data, modularizationSuffix, section.Symbols.OfType<WixSuppressModularizationSymbol>());
417 modularize.Execute();
418
419 // Ensure all sequence tables in place because, mergemod.dll requires them.
422 - var unsuppress = new AddBackSuppressedSequenceTablesCommand(output, tableDefinitions);
420 + var unsuppress = new AddBackSuppressedSequenceTablesCommand(data, tableDefinitions);
421 suppressedTableNames = unsuppress.Execute();
422 }
425 - else if (output.Type == OutputType.Patch)
423 + else if (data.Type == OutputType.Patch)
424 {
425 foreach (var storage in this.SubStorages)
426 {
429 - output.SubStorages.Add(storage);
427 + data.SubStorages.Add(storage);
428 }
429 }
430
@@ -448,7 +446,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
446
447 // create cabinet files and process uncompressed files
448 var layoutDirectory = Path.GetDirectoryName(this.OutputPath);
451 - if (!this.SuppressLayout || OutputType.Module == output.Type)
449 + if (!this.SuppressLayout || OutputType.Module == data.Type)
450 {
451 this.Messaging.Write(VerboseMessages.CreatingCabinetFiles());
452
@@ -458,7 +456,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
456 command.CabbingThreadCount = this.CabbingThreadCount;
457 command.CabCachePath = this.CabCachePath;
458 command.DefaultCompressionLevel = this.DefaultCompressionLevel;
461 - command.Output = output;
459 + command.Data = data;
460 command.Messaging = this.Messaging;
461 command.BackendExtensions = this.BackendExtensions;
462 command.LayoutDirectory = layoutDirectory;
@@ -481,15 +479,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind
479 }
480
481 // We can create instance transforms since Component Guids and Outputs are created.
484 - if (output.Type == OutputType.Product)
482 + if (data.Type == OutputType.Product)
483 {
486 - var command = new CreateInstanceTransformsCommand(section, output, tableDefinitions, this.WindowsInstallerBackendHelper);
484 + var command = new CreateInstanceTransformsCommand(section, data, tableDefinitions, this.WindowsInstallerBackendHelper);
485 command.Execute();
486 }
489 - else if (output.Type == OutputType.Patch)
487 + else if (data.Type == OutputType.Patch)
488 {
489 // Copy output data back into the transforms.
492 - var command = new UpdateTransformsWithFileFacades(this.Messaging, output, this.SubStorages, tableDefinitions, fileFacades);
490 + var command = new UpdateTransformsWithFileFacades(this.Messaging, data, this.SubStorages, tableDefinitions, fileFacades);
491 command.Execute();
492 }
493
@@ -500,7 +498,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
498 var trackMsi = this.WindowsInstallerBackendHelper.TrackFile(this.OutputPath, TrackedFileType.Final);
499 trackedFiles.Add(trackMsi);
500
503 - var command = new GenerateDatabaseCommand(this.Messaging, this.WindowsInstallerBackendHelper, this.FileSystemManager, output, trackMsi.Path, tableDefinitions, this.IntermediateFolder, this.Codepage, keepAddedColumns: false, this.SuppressAddingValidationRows, useSubdirectory: false);
501 + var command = new GenerateDatabaseCommand(this.Messaging, this.WindowsInstallerBackendHelper, this.FileSystemManager, data, trackMsi.Path, tableDefinitions, this.IntermediateFolder, this.Codepage, keepAddedColumns: false, this.SuppressAddingValidationRows, useSubdirectory: false);
502 command.Execute();
503
504 trackedFiles.AddRange(command.GeneratedTemporaryFiles);
@@ -572,12 +570,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind
570 var result = this.ServiceProvider.GetService<IBindResult>();
571 result.FileTransfers = fileTransfers;
572 result.TrackedFiles = trackedFiles;
575 - result.Wixout = this.CreateWixout(trackedFiles, this.Intermediate, output);
573 + result.Wixout = this.CreateWixout(trackedFiles, this.Intermediate, data);
574
575 return result;
576 }
577
580 - private WixOutput CreateWixout(List<ITrackedFile> trackedFiles, Intermediate intermediate, WindowsInstallerData output)
578 + private WixOutput CreateWixout(List<ITrackedFile> trackedFiles, Intermediate intermediate, WindowsInstallerData data)
579 {
580 WixOutput wixout;
581
@@ -595,7 +593,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
593
594 intermediate.Save(wixout);
595
598 - output.Save(wixout);
596 + data.Save(wixout);
597
598 wixout.Reopen();
599
src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
+6 -6
@@ -72,7 +72,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
72
73 public IEnumerable<IWindowsInstallerBackendBinderExtension> BackendExtensions { private get; set; }
74
75 - public WindowsInstallerData Output { private get; set; }
75 + public WindowsInstallerData Data { private get; set; }
76
77 public string LayoutDirectory { private get; set; }
78
@@ -115,7 +115,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
115 var compressionLevel = mediaSymbol.CompressionLevel ?? this.DefaultCompressionLevel ?? CompressionLevel.Medium;
116 var cabinetDir = this.ResolveMedia(mediaSymbol, mediaSymbol.Layout, this.LayoutDirectory);
117
118 - var cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaSymbol, compressionLevel, files);
118 + var cabinetWorkItem = this.CreateCabinetWorkItem(this.Data, cabinetDir, mediaSymbol, compressionLevel, files);
119 if (null != cabinetWorkItem)
120 {
121 cabinetBuilder.Enqueue(cabinetWorkItem);
@@ -171,13 +171,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind
171 /// <summary>
172 /// Creates a work item to create a cabinet.
173 /// </summary>
174 - /// <param name="output">Output for the current database.</param>
174 + /// <param name="data">Windows Installer data for the current database.</param>
175 /// <param name="cabinetDir">Directory to create cabinet in.</param>
176 /// <param name="mediaSymbol">Media symbol containing information about the cabinet.</param>
177 /// <param name="compressionLevel">Desired compression level.</param>
178 /// <param name="fileFacades">Collection of files in this cabinet.</param>
179 /// <returns>created CabinetWorkItem object</returns>
180 - private CabinetWorkItem CreateCabinetWorkItem(WindowsInstallerData output, string cabinetDir, MediaSymbol mediaSymbol, CompressionLevel compressionLevel, IEnumerable<FileFacade> fileFacades)
180 + private CabinetWorkItem CreateCabinetWorkItem(WindowsInstallerData data, string cabinetDir, MediaSymbol mediaSymbol, CompressionLevel compressionLevel, IEnumerable<FileFacade> fileFacades)
181 {
182 CabinetWorkItem cabinetWorkItem = null;
183 var tempCabinetFileX = Path.Combine(this.IntermediateFolder, mediaSymbol.Cabinet);
@@ -189,7 +189,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
189 var cabinetName = mediaSymbol.Cabinet.TrimStart('#');
190
191 // If building a patch, remind them to run -p for torch.
192 - if (OutputType.Patch == output.Type)
192 + if (OutputType.Patch == data.Type)
193 {
194 this.Messaging.Write(WarningMessages.EmptyCabinet(mediaSymbol.SourceLineNumbers, cabinetName, true));
195 }
@@ -234,7 +234,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
234
235 if (mediaSymbol.Cabinet.StartsWith("#", StringComparison.Ordinal))
236 {
237 - var streamsTable = output.EnsureTable(this.TableDefinitions["_Streams"]);
237 + var streamsTable = data.EnsureTable(this.TableDefinitions["_Streams"]);
238
239 var streamRow = streamsTable.CreateRow(mediaSymbol.SourceLineNumbers);
240 streamRow[0] = mediaSymbol.Cabinet.Substring(1);
src/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs renamed
+26 -24
@@ -16,9 +16,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
16 using WixToolset.Extensibility;
17 using WixToolset.Extensibility.Services;
18
19 - internal class CreateOutputFromIRCommand
19 + internal class CreateWindowsInstallerDataFromIRCommand
20 {
21 - public CreateOutputFromIRCommand(IMessaging messaging, IntermediateSection section, TableDefinitionCollection tableDefinitions, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtensions, IWindowsInstallerBackendHelper backendHelper)
21 + public CreateWindowsInstallerDataFromIRCommand(IMessaging messaging, IntermediateSection section, TableDefinitionCollection tableDefinitions, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtensions, IWindowsInstallerBackendHelper backendHelper)
22 {
23 this.Messaging = messaging;
24 this.Section = section;
@@ -37,20 +37,22 @@ namespace WixToolset.Core.WindowsInstaller.Bind
37
38 private IntermediateSection Section { get; }
39
40 - public WindowsInstallerData Output { get; private set; }
40 + public WindowsInstallerData Data { get; private set; }
41
42 - public void Execute()
42 + public WindowsInstallerData Execute()
43 {
44 - this.Output = new WindowsInstallerData(this.Section.Symbols.First().SourceLineNumbers)
44 + this.Data = new WindowsInstallerData(this.Section.Symbols.First().SourceLineNumbers)
45 {
46 Codepage = this.Section.Codepage,
47 Type = SectionTypeToOutputType(this.Section.Type)
48 };
49
50 - this.AddSectionToOutput();
50 + this.AddSectionToData();
51 +
52 + return this.Data;
53 }
54
53 - private void AddSectionToOutput()
55 + private void AddSectionToData()
56 {
57 var cellsByTableAndRowId = new Dictionary<string, List<WixCustomTableCellSymbol>>();
58
@@ -61,7 +63,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
63 {
64 case SymbolDefinitionType.AppSearch:
65 this.AddSymbolDefaultly(symbol);
64 - this.Output.EnsureTable(this.TableDefinitions["Signature"]);
66 + this.Data.EnsureTable(this.TableDefinitions["Signature"]);
67 break;
68
69 case SymbolDefinitionType.Assembly:
@@ -154,7 +156,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
156
157 case SymbolDefinitionType.ProgId:
158 this.AddSymbolDefaultly(symbol);
157 - this.Output.EnsureTable(this.TableDefinitions["Extension"]);
159 + this.Data.EnsureTable(this.TableDefinitions["Extension"]);
160 break;
161
162 case SymbolDefinitionType.Property:
@@ -452,7 +454,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
454 row[8] = symbol.DefaultControlRef;
455 row[9] = symbol.CancelControlRef;
456
455 - this.Output.EnsureTable(this.TableDefinitions["ListBox"]);
457 + this.Data.EnsureTable(this.TableDefinitions["ListBox"]);
458 }
459
460 private void AddDirectorySymbol(DirectorySymbol symbol)
@@ -976,9 +978,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
978 switch (symbol.SequenceTable)
979 {
980 case SequenceTable.AdminExecuteSequence:
979 - if (OutputType.Module == this.Output.Type)
981 + if (OutputType.Module == this.Data.Type)
982 {
981 - this.Output.EnsureTable(this.TableDefinitions["AdminExecuteSequence"]);
983 + this.Data.EnsureTable(this.TableDefinitions["AdminExecuteSequence"]);
984 sequenceTableName = "ModuleAdminExecuteSequence";
985 }
986 else
@@ -987,9 +989,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
989 }
990 break;
991 case SequenceTable.AdminUISequence:
990 - if (OutputType.Module == this.Output.Type)
992 + if (OutputType.Module == this.Data.Type)
993 {
992 - this.Output.EnsureTable(this.TableDefinitions["AdminUISequence"]);
994 + this.Data.EnsureTable(this.TableDefinitions["AdminUISequence"]);
995 sequenceTableName = "ModuleAdminUISequence";
996 }
997 else
@@ -998,9 +1000,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1000 }
1001 break;
1002 case SequenceTable.AdvertiseExecuteSequence:
1001 - if (OutputType.Module == this.Output.Type)
1003 + if (OutputType.Module == this.Data.Type)
1004 {
1003 - this.Output.EnsureTable(this.TableDefinitions["AdvtExecuteSequence"]);
1005 + this.Data.EnsureTable(this.TableDefinitions["AdvtExecuteSequence"]);
1006 sequenceTableName = "ModuleAdvtExecuteSequence";
1007 }
1008 else
@@ -1009,9 +1011,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1011 }
1012 break;
1013 case SequenceTable.InstallExecuteSequence:
1012 - if (OutputType.Module == this.Output.Type)
1014 + if (OutputType.Module == this.Data.Type)
1015 {
1014 - this.Output.EnsureTable(this.TableDefinitions["InstallExecuteSequence"]);
1016 + this.Data.EnsureTable(this.TableDefinitions["InstallExecuteSequence"]);
1017 sequenceTableName = "ModuleInstallExecuteSequence";
1018 }
1019 else
@@ -1020,9 +1022,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1022 }
1023 break;
1024 case SequenceTable.InstallUISequence:
1023 - if (OutputType.Module == this.Output.Type)
1025 + if (OutputType.Module == this.Data.Type)
1026 {
1025 - this.Output.EnsureTable(this.TableDefinitions["InstallUISequence"]);
1027 + this.Data.EnsureTable(this.TableDefinitions["InstallUISequence"]);
1028 sequenceTableName = "ModuleInstallUISequence";
1029 }
1030 else
@@ -1147,14 +1149,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1149 private void AddWixEnsureTableSymbol(WixEnsureTableSymbol symbol)
1150 {
1151 var tableDefinition = this.TableDefinitions[symbol.Table];
1150 - this.Output.EnsureTable(tableDefinition);
1152 + this.Data.EnsureTable(tableDefinition);
1153 }
1154
1155 private bool AddSymbolFromExtension(IntermediateSymbol symbol)
1156 {
1157 foreach (var extension in this.BackendExtensions)
1158 {
1157 - if (extension.TryProcessSymbol(this.Section, symbol, this.Output, this.TableDefinitions))
1159 + if (extension.TryProcessSymbol(this.Section, symbol, this.Data, this.TableDefinitions))
1160 {
1161 return true;
1162 }
@@ -1164,7 +1166,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1166 }
1167
1168 private bool AddSymbolDefaultly(IntermediateSymbol symbol) =>
1167 - this.BackendHelper.TryAddSymbolToOutputMatchingTableDefinitions(this.Section, symbol, this.Output, this.TableDefinitions);
1169 + this.BackendHelper.TryAddSymbolToMatchingTableDefinitions(this.Section, symbol, this.Data, this.TableDefinitions);
1170
1171 private static OutputType SectionTypeToOutputType(SectionType type)
1172 {
@@ -1190,7 +1192,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1192 this.CreateRow(symbol, this.TableDefinitions[tableDefinitionName]);
1193
1194 private Row CreateRow(IntermediateSymbol symbol, TableDefinition tableDefinition) =>
1193 - this.BackendHelper.CreateRow(this.Section, symbol, this.Output, tableDefinition);
1195 + this.BackendHelper.CreateRow(this.Section, symbol, this.Data, tableDefinition);
1196
1197 private static string GetMsiFilenameValue(string shortName, string longName)
1198 {
src/WixToolset.Core.WindowsInstaller/ExtensibilityServices/WindowsInstallerBackendHelper.cs
+4 -4
@@ -34,9 +34,9 @@ namespace WixToolset.Core.WindowsInstaller.ExtensibilityServices
34
35 #region IWindowsInstallerBackendHelper interfaces
36
37 - public Row CreateRow(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinition tableDefinition)
37 + public Row CreateRow(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinition tableDefinition)
38 {
39 - var table = output.EnsureTable(tableDefinition);
39 + var table = data.EnsureTable(tableDefinition);
40
41 var row = table.CreateRow(symbol.SourceLineNumbers);
42 row.SectionId = section.Id;
@@ -44,7 +44,7 @@ namespace WixToolset.Core.WindowsInstaller.ExtensibilityServices
44 return row;
45 }
46
47 - public bool TryAddSymbolToOutputMatchingTableDefinitions(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData output, TableDefinitionCollection tableDefinitions)
47 + public bool TryAddSymbolToMatchingTableDefinitions(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions)
48 {
49 var tableDefinition = tableDefinitions.FirstOrDefault(t => t.SymbolDefinition?.Name == symbol.Definition.Name);
50 if (tableDefinition == null)
@@ -52,7 +52,7 @@ namespace WixToolset.Core.WindowsInstaller.ExtensibilityServices
52 return false;
53 }
54
55 - var row = this.CreateRow(section, symbol, output, tableDefinition);
55 + var row = this.CreateRow(section, symbol, data, tableDefinition);
56 var rowOffset = 0;
57
58 if (tableDefinition.SymbolIdIsPrimaryKey)