aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-06-12 12:55:28 -0700
committerRob Mensching <rob@firegiant.com>2020-06-13 09:22:27 -0700
commitc0f1332a0e18e9d506fe80c328548b001dcf93df (patch)
tree4980dddd35350e79b00a61574feafa859e857e3f /src/WixToolset.Core.WindowsInstaller/Bind
parent167d26d002b1412e72d96ed2bbc0761fc0f1344b (diff)
downloadwix-c0f1332a0e18e9d506fe80c328548b001dcf93df.tar.gz
wix-c0f1332a0e18e9d506fe80c328548b001dcf93df.tar.bz2
wix-c0f1332a0e18e9d506fe80c328548b001dcf93df.zip
Remove use of remaining WixXxxRows
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs6
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs89
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs23
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs2
4 files changed, 46 insertions, 74 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
index b3f81212..6c2968ec 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
@@ -428,7 +428,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
428 { 428 {
429 this.Messaging.Write(VerboseMessages.CreatingCabinetFiles()); 429 this.Messaging.Write(VerboseMessages.CreatingCabinetFiles());
430 430
431 var command = new CreateCabinetsCommand(this.ServiceProvider, this.BackendHelper); 431 var mediaTemplate = section.Tuples.OfType<WixMediaTemplateTuple>().FirstOrDefault();
432
433 var command = new CreateCabinetsCommand(this.ServiceProvider, this.BackendHelper, mediaTemplate);
432 command.CabbingThreadCount = this.CabbingThreadCount; 434 command.CabbingThreadCount = this.CabbingThreadCount;
433 command.CabCachePath = this.CabCachePath; 435 command.CabCachePath = this.CabCachePath;
434 command.DefaultCompressionLevel = this.DefaultCompressionLevel; 436 command.DefaultCompressionLevel = this.DefaultCompressionLevel;
@@ -438,7 +440,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
438 command.LayoutDirectory = layoutDirectory; 440 command.LayoutDirectory = layoutDirectory;
439 command.Compressed = compressed; 441 command.Compressed = compressed;
440 command.ModularizationSuffix = modularizationSuffix; 442 command.ModularizationSuffix = modularizationSuffix;
441 command.FileRowsByCabinet = filesByCabinetMedia; 443 command.FileFacadesByCabinet = filesByCabinetMedia;
442 command.ResolveMedia = this.ResolveMedia; 444 command.ResolveMedia = this.ResolveMedia;
443 command.TableDefinitions = tableDefinitions; 445 command.TableDefinitions = tableDefinitions;
444 command.IntermediateFolder = this.IntermediateFolder; 446 command.IntermediateFolder = this.IntermediateFolder;
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
index f2f9895d..de357e53 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
@@ -12,7 +12,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
12 using WixToolset.Data; 12 using WixToolset.Data;
13 using WixToolset.Data.Tuples; 13 using WixToolset.Data.Tuples;
14 using WixToolset.Data.WindowsInstaller; 14 using WixToolset.Data.WindowsInstaller;
15 using WixToolset.Data.WindowsInstaller.Rows;
16 using WixToolset.Extensibility; 15 using WixToolset.Extensibility;
17 using WixToolset.Extensibility.Data; 16 using WixToolset.Extensibility.Data;
18 using WixToolset.Extensibility.Services; 17 using WixToolset.Extensibility.Services;
@@ -33,7 +32,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
33 32
34 private Dictionary<string, string> lastCabinetAddedToMediaTable; // Key is First Cabinet Name, Value is Last Cabinet Added in the Split Sequence 33 private Dictionary<string, string> lastCabinetAddedToMediaTable; // Key is First Cabinet Name, Value is Last Cabinet Added in the Split Sequence
35 34
36 public CreateCabinetsCommand(IWixToolsetServiceProvider serviceProvider, IBackendHelper backendHelper) 35 public CreateCabinetsCommand(IWixToolsetServiceProvider serviceProvider, IBackendHelper backendHelper, WixMediaTemplateTuple mediaTemplate)
37 { 36 {
38 this.fileTransfers = new List<IFileTransfer>(); 37 this.fileTransfers = new List<IFileTransfer>();
39 38
@@ -44,11 +43,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind
44 this.ServiceProvider = serviceProvider; 43 this.ServiceProvider = serviceProvider;
45 44
46 this.BackendHelper = backendHelper; 45 this.BackendHelper = backendHelper;
46
47 this.MediaTemplate = mediaTemplate;
47 } 48 }
48 49
49 public IWixToolsetServiceProvider ServiceProvider { get; } 50 private IWixToolsetServiceProvider ServiceProvider { get; }
51
52 private IBackendHelper BackendHelper { get; }
50 53
51 public IBackendHelper BackendHelper { get; } 54 private WixMediaTemplateTuple MediaTemplate { get; }
52 55
53 /// <summary> 56 /// <summary>
54 /// Sets the number of threads to use for cabinet creation. 57 /// Sets the number of threads to use for cabinet creation.
@@ -77,7 +80,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
77 80
78 public string ModularizationSuffix { private get; set; } 81 public string ModularizationSuffix { private get; set; }
79 82
80 public Dictionary<MediaTuple, IEnumerable<FileFacade>> FileRowsByCabinet { private get; set; } 83 public Dictionary<MediaTuple, IEnumerable<FileFacade>> FileFacadesByCabinet { private get; set; }
81 84
82 public Func<MediaTuple, string, string, string> ResolveMedia { private get; set; } 85 public Func<MediaTuple, string, string, string> ResolveMedia { private get; set; }
83 86
@@ -90,7 +93,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
90 /// <param name="output">Output to generate image for.</param> 93 /// <param name="output">Output to generate image for.</param>
91 /// <param name="layoutDirectory">The directory in which the image should be layed out.</param> 94 /// <param name="layoutDirectory">The directory in which the image should be layed out.</param>
92 /// <param name="compressed">Flag if source image should be compressed.</param> 95 /// <param name="compressed">Flag if source image should be compressed.</param>
93 /// <returns>The uncompressed file rows.</returns>
94 public void Execute() 96 public void Execute()
95 { 97 {
96 this.lastCabinetAddedToMediaTable = new Dictionary<string, string>(); 98 this.lastCabinetAddedToMediaTable = new Dictionary<string, string>();
@@ -109,7 +111,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
109 cabinetBuilder.MaximumCabinetSizeForLargeFileSplitting = maximumCabinetSizeForLargeFileSplitting; 111 cabinetBuilder.MaximumCabinetSizeForLargeFileSplitting = maximumCabinetSizeForLargeFileSplitting;
110 cabinetBuilder.MaximumUncompressedMediaSize = maximumUncompressedMediaSize; 112 cabinetBuilder.MaximumUncompressedMediaSize = maximumUncompressedMediaSize;
111 113
112 foreach (var entry in this.FileRowsByCabinet) 114 foreach (var entry in this.FileFacadesByCabinet)
113 { 115 {
114 var mediaTuple = entry.Key; 116 var mediaTuple = entry.Key;
115 var files = entry.Value; 117 var files = entry.Value;
@@ -175,28 +177,28 @@ namespace WixToolset.Core.WindowsInstaller.Bind
175 /// </summary> 177 /// </summary>
176 /// <param name="output">Output for the current database.</param> 178 /// <param name="output">Output for the current database.</param>
177 /// <param name="cabinetDir">Directory to create cabinet in.</param> 179 /// <param name="cabinetDir">Directory to create cabinet in.</param>
178 /// <param name="mediaRow">MediaRow containing information about the cabinet.</param> 180 /// <param name="mediaTuple">Media tuple containing information about the cabinet.</param>
179 /// <param name="fileFacades">Collection of files in this cabinet.</param> 181 /// <param name="fileFacades">Collection of files in this cabinet.</param>
180 /// <returns>created CabinetWorkItem object</returns> 182 /// <returns>created CabinetWorkItem object</returns>
181 private CabinetWorkItem CreateCabinetWorkItem(WindowsInstallerData output, string cabinetDir, MediaTuple mediaRow, CompressionLevel compressionLevel, IEnumerable<FileFacade> fileFacades) 183 private CabinetWorkItem CreateCabinetWorkItem(WindowsInstallerData output, string cabinetDir, MediaTuple mediaTuple, CompressionLevel compressionLevel, IEnumerable<FileFacade> fileFacades)
182 { 184 {
183 CabinetWorkItem cabinetWorkItem = null; 185 CabinetWorkItem cabinetWorkItem = null;
184 string tempCabinetFileX = Path.Combine(this.IntermediateFolder, mediaRow.Cabinet); 186 var tempCabinetFileX = Path.Combine(this.IntermediateFolder, mediaTuple.Cabinet);
185 187
186 // check for an empty cabinet 188 // check for an empty cabinet
187 if (!fileFacades.Any()) 189 if (!fileFacades.Any())
188 { 190 {
189 // Remove the leading '#' from the embedded cabinet name to make the warning easier to understand 191 // Remove the leading '#' from the embedded cabinet name to make the warning easier to understand
190 var cabinetName = mediaRow.Cabinet.TrimStart('#'); 192 var cabinetName = mediaTuple.Cabinet.TrimStart('#');
191 193
192 // If building a patch, remind them to run -p for torch. 194 // If building a patch, remind them to run -p for torch.
193 if (OutputType.Patch == output.Type) 195 if (OutputType.Patch == output.Type)
194 { 196 {
195 this.Messaging.Write(WarningMessages.EmptyCabinet(mediaRow.SourceLineNumbers, cabinetName, true)); 197 this.Messaging.Write(WarningMessages.EmptyCabinet(mediaTuple.SourceLineNumbers, cabinetName, true));
196 } 198 }
197 else 199 else
198 { 200 {
199 this.Messaging.Write(WarningMessages.EmptyCabinet(mediaRow.SourceLineNumbers, cabinetName)); 201 this.Messaging.Write(WarningMessages.EmptyCabinet(mediaTuple.SourceLineNumbers, cabinetName));
200 } 202 }
201 } 203 }
202 204
@@ -212,7 +214,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
212 } 214 }
213 else // reuse the cabinet from the cabinet cache. 215 else // reuse the cabinet from the cabinet cache.
214 { 216 {
215 this.Messaging.Write(VerboseMessages.ReusingCabCache(mediaRow.SourceLineNumbers, mediaRow.Cabinet, resolvedCabinet.Path)); 217 this.Messaging.Write(VerboseMessages.ReusingCabCache(mediaTuple.SourceLineNumbers, mediaTuple.Cabinet, resolvedCabinet.Path));
216 218
217 try 219 try
218 { 220 {
@@ -226,27 +228,27 @@ namespace WixToolset.Core.WindowsInstaller.Bind
226 } 228 }
227 catch (Exception e) 229 catch (Exception e)
228 { 230 {
229 this.Messaging.Write(WarningMessages.CannotUpdateCabCache(mediaRow.SourceLineNumbers, resolvedCabinet.Path, e.Message)); 231 this.Messaging.Write(WarningMessages.CannotUpdateCabCache(mediaTuple.SourceLineNumbers, resolvedCabinet.Path, e.Message));
230 } 232 }
231 } 233 }
232 234
233 var trackResolvedCabinet = this.BackendHelper.TrackFile(resolvedCabinet.Path, TrackedFileType.Intermediate, mediaRow.SourceLineNumbers); 235 var trackResolvedCabinet = this.BackendHelper.TrackFile(resolvedCabinet.Path, TrackedFileType.Intermediate, mediaTuple.SourceLineNumbers);
234 this.trackedFiles.Add(trackResolvedCabinet); 236 this.trackedFiles.Add(trackResolvedCabinet);
235 237
236 if (mediaRow.Cabinet.StartsWith("#", StringComparison.Ordinal)) 238 if (mediaTuple.Cabinet.StartsWith("#", StringComparison.Ordinal))
237 { 239 {
238 var streamsTable = output.EnsureTable(this.TableDefinitions["_Streams"]); 240 var streamsTable = output.EnsureTable(this.TableDefinitions["_Streams"]);
239 241
240 var streamRow = streamsTable.CreateRow(mediaRow.SourceLineNumbers); 242 var streamRow = streamsTable.CreateRow(mediaTuple.SourceLineNumbers);
241 streamRow[0] = mediaRow.Cabinet.Substring(1); 243 streamRow[0] = mediaTuple.Cabinet.Substring(1);
242 streamRow[1] = resolvedCabinet.Path; 244 streamRow[1] = resolvedCabinet.Path;
243 } 245 }
244 else 246 else
245 { 247 {
246 var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaRow.Cabinet), TrackedFileType.Final, mediaRow.SourceLineNumbers); 248 var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaTuple.Cabinet), TrackedFileType.Final, mediaTuple.SourceLineNumbers);
247 this.trackedFiles.Add(trackDestination); 249 this.trackedFiles.Add(trackDestination);
248 250
249 var transfer = this.BackendHelper.CreateFileTransfer(resolvedCabinet.Path, trackDestination.Path, resolvedCabinet.BuildOption == CabinetBuildOption.BuildAndMove, mediaRow.SourceLineNumbers); 251 var transfer = this.BackendHelper.CreateFileTransfer(resolvedCabinet.Path, trackDestination.Path, resolvedCabinet.BuildOption == CabinetBuildOption.BuildAndMove, mediaTuple.SourceLineNumbers);
250 this.fileTransfers.Add(transfer); 252 this.fileTransfers.Add(transfer);
251 } 253 }
252 254
@@ -417,36 +419,24 @@ namespace WixToolset.Core.WindowsInstaller.Bind
417 /// <summary> 419 /// <summary>
418 /// Gets Compiler Values of MediaTemplate Attributes governing Maximum Cabinet Size after applying Environment Variable Overrides 420 /// Gets Compiler Values of MediaTemplate Attributes governing Maximum Cabinet Size after applying Environment Variable Overrides
419 /// </summary> 421 /// </summary>
420 /// <param name="output">Output to generate image for.</param>
421 /// <param name="fileRows">The indexed file rows.</param>
422 private void GetMediaTemplateAttributes(out int maxCabSizeForLargeFileSplitting, out int maxUncompressedMediaSize) 422 private void GetMediaTemplateAttributes(out int maxCabSizeForLargeFileSplitting, out int maxUncompressedMediaSize)
423 { 423 {
424 // Get Environment Variable Overrides for MediaTemplate Attributes governing Maximum Cabinet Size 424 // Get Environment Variable Overrides for MediaTemplate Attributes governing Maximum Cabinet Size
425 string mcslfsString = Environment.GetEnvironmentVariable("WIX_MCSLFS"); 425 var mcslfsString = Environment.GetEnvironmentVariable("WIX_MCSLFS");
426 string mumsString = Environment.GetEnvironmentVariable("WIX_MUMS"); 426 var mumsString = Environment.GetEnvironmentVariable("WIX_MUMS");
427 int maxCabSizeForLargeFileInMB = 0;
428 int maxPreCompressedSizeInMB = 0;
429 ulong testOverFlow = 0;
430 427
431 // Supply Compile MediaTemplate Attributes to Cabinet Builder 428 // Supply Compile MediaTemplate Attributes to Cabinet Builder
432 Table mediaTemplateTable = this.Output.Tables["WixMediaTemplate"]; 429 if (this.MediaTemplate != null)
433 if (mediaTemplateTable != null)
434 { 430 {
435 WixMediaTemplateRow mediaTemplateRow = (WixMediaTemplateRow)mediaTemplateTable.Rows[0];
436
437 // Get the Value for Max Cab Size for File Splitting 431 // Get the Value for Max Cab Size for File Splitting
432 var maxCabSizeForLargeFileInMB = 0;
438 try 433 try
439 { 434 {
440 // Override authored mcslfs value if environment variable is authored. 435 // Override authored mcslfs value if environment variable is authored.
441 if (!String.IsNullOrEmpty(mcslfsString)) 436 maxCabSizeForLargeFileInMB = !String.IsNullOrEmpty(mcslfsString) ? Int32.Parse(mcslfsString) : this.MediaTemplate.MaximumCabinetSizeForLargeFileSplitting ?? MaxValueOfMaxCabSizeForLargeFileSplitting;
442 { 437
443 maxCabSizeForLargeFileInMB = Int32.Parse(mcslfsString); 438 var testOverFlow = (ulong)maxCabSizeForLargeFileInMB * 1024 * 1024;
444 } 439 maxCabSizeForLargeFileSplitting = maxCabSizeForLargeFileInMB;
445 else
446 {
447 maxCabSizeForLargeFileInMB = mediaTemplateRow.MaximumCabinetSizeForLargeFileSplitting;
448 }
449 testOverFlow = (ulong)maxCabSizeForLargeFileInMB * 1024 * 1024;
450 } 440 }
451 catch (FormatException) 441 catch (FormatException)
452 { 442 {
@@ -457,18 +447,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind
457 throw new WixException(ErrorMessages.MaximumCabinetSizeForLargeFileSplittingTooLarge(null, maxCabSizeForLargeFileInMB, MaxValueOfMaxCabSizeForLargeFileSplitting)); 447 throw new WixException(ErrorMessages.MaximumCabinetSizeForLargeFileSplittingTooLarge(null, maxCabSizeForLargeFileInMB, MaxValueOfMaxCabSizeForLargeFileSplitting));
458 } 448 }
459 449
450 var maxPreCompressedSizeInMB = 0;
460 try 451 try
461 { 452 {
462 // Override authored mums value if environment variable is authored. 453 // Override authored mums value if environment variable is authored.
463 if (!String.IsNullOrEmpty(mumsString)) 454 maxPreCompressedSizeInMB = !String.IsNullOrEmpty(mumsString) ? Int32.Parse(mumsString) : this.MediaTemplate.MaximumUncompressedMediaSize ?? DefaultMaximumUncompressedMediaSize;
464 { 455
465 maxPreCompressedSizeInMB = Int32.Parse(mumsString); 456 var testOverFlow = (ulong)maxPreCompressedSizeInMB * 1024 * 1024;
466 } 457 maxUncompressedMediaSize = maxPreCompressedSizeInMB;
467 else
468 {
469 maxPreCompressedSizeInMB = mediaTemplateRow.MaximumUncompressedMediaSize;
470 }
471 testOverFlow = (ulong)maxPreCompressedSizeInMB * 1024 * 1024;
472 } 458 }
473 catch (FormatException) 459 catch (FormatException)
474 { 460 {
@@ -478,9 +464,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
478 { 464 {
479 throw new WixException(ErrorMessages.MaximumUncompressedMediaSizeTooLarge(null, maxPreCompressedSizeInMB)); 465 throw new WixException(ErrorMessages.MaximumUncompressedMediaSizeTooLarge(null, maxPreCompressedSizeInMB));
480 } 466 }
481
482 maxCabSizeForLargeFileSplitting = maxCabSizeForLargeFileInMB;
483 maxUncompressedMediaSize = maxPreCompressedSizeInMB;
484 } 467 }
485 else 468 else
486 { 469 {
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
index 21c39423..448ed607 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs
@@ -15,9 +15,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
15 15
16 internal class CreateOutputFromIRCommand 16 internal class CreateOutputFromIRCommand
17 { 17 {
18 private const int DefaultMaximumUncompressedMediaSize = 200; // Default value is 200 MB
19 private const int MaxValueOfMaxCabSizeForLargeFileSplitting = 2 * 1024; // 2048 MB (i.e. 2 GB)
20
21 public CreateOutputFromIRCommand(IMessaging messaging, IntermediateSection section, TableDefinitionCollection tableDefinitions, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtensions, IWindowsInstallerBackendHelper backendHelper) 18 public CreateOutputFromIRCommand(IMessaging messaging, IntermediateSection section, TableDefinitionCollection tableDefinitions, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtensions, IWindowsInstallerBackendHelper backendHelper)
22 { 19 {
23 this.Messaging = messaging; 20 this.Messaging = messaging;
@@ -189,10 +186,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
189 this.AddWixActionTuple((WixActionTuple)tuple); 186 this.AddWixActionTuple((WixActionTuple)tuple);
190 break; 187 break;
191 188
192 case TupleDefinitionType.WixMediaTemplate:
193 this.AddWixMediaTemplateTuple((WixMediaTemplateTuple)tuple);
194 break;
195
196 case TupleDefinitionType.WixCustomTableCell: 189 case TupleDefinitionType.WixCustomTableCell:
197 this.IndexCustomTableCellTuple((WixCustomTableCellTuple)tuple, cellsByTableAndRowId); 190 this.IndexCustomTableCellTuple((WixCustomTableCellTuple)tuple, cellsByTableAndRowId);
198 break; 191 break;
@@ -202,6 +195,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
202 break; 195 break;
203 196
204 // Tuples used internally and are not added to the output. 197 // Tuples used internally and are not added to the output.
198 case TupleDefinitionType.WixBuildInfo:
205 case TupleDefinitionType.WixComponentGroup: 199 case TupleDefinitionType.WixComponentGroup:
206 case TupleDefinitionType.WixComplexReference: 200 case TupleDefinitionType.WixComplexReference:
207 case TupleDefinitionType.WixDeltaPatchFile: 201 case TupleDefinitionType.WixDeltaPatchFile:
@@ -211,6 +205,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
211 case TupleDefinitionType.WixInstanceComponent: 205 case TupleDefinitionType.WixInstanceComponent:
212 case TupleDefinitionType.WixInstanceTransforms: 206 case TupleDefinitionType.WixInstanceTransforms:
213 case TupleDefinitionType.WixFeatureModules: 207 case TupleDefinitionType.WixFeatureModules:
208 case TupleDefinitionType.WixGroup:
209 case TupleDefinitionType.WixMediaTemplate:
214 case TupleDefinitionType.WixMerge: 210 case TupleDefinitionType.WixMerge:
215 case TupleDefinitionType.WixOrdering: 211 case TupleDefinitionType.WixOrdering:
216 case TupleDefinitionType.WixPatchBaseline: 212 case TupleDefinitionType.WixPatchBaseline:
@@ -946,7 +942,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
946 } 942 }
947 else 943 else
948 { 944 {
949 bool after = (null == tuple.Before); 945 var after = (null == tuple.Before);
950 row[2] = after ? tuple.After : tuple.Before; 946 row[2] = after ? tuple.After : tuple.Before;
951 row[3] = after ? 1 : 0; 947 row[3] = after ? 1 : 0;
952 } 948 }
@@ -1052,17 +1048,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
1052 this.Output.EnsureTable(tableDefinition); 1048 this.Output.EnsureTable(tableDefinition);
1053 } 1049 }
1054 1050
1055 private void AddWixMediaTemplateTuple(WixMediaTemplateTuple tuple)
1056 {
1057 var row = (WixMediaTemplateRow)this.CreateRow(tuple, "WixMediaTemplate");
1058 row.CabinetTemplate = tuple.CabinetTemplate;
1059 row.CompressionLevel = tuple.CompressionLevel;
1060 row.DiskPrompt = tuple.DiskPrompt;
1061 row.VolumeLabel = tuple.VolumeLabel;
1062 row.MaximumUncompressedMediaSize = tuple.MaximumUncompressedMediaSize ?? DefaultMaximumUncompressedMediaSize;
1063 row.MaximumCabinetSizeForLargeFileSplitting = tuple.MaximumCabinetSizeForLargeFileSplitting ?? MaxValueOfMaxCabSizeForLargeFileSplitting;
1064 }
1065
1066 private bool AddTupleFromExtension(IntermediateTuple tuple) 1051 private bool AddTupleFromExtension(IntermediateTuple tuple)
1067 { 1052 {
1068 foreach (var extension in this.BackendExtensions) 1053 foreach (var extension in this.BackendExtensions)
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs
index 201a890c..fc713954 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateTransformCommand.cs
@@ -160,6 +160,7 @@ namespace WixToolset.Core.WindowsInstaller
160 { 160 {
161 if (index.TryGetValue(primaryKey, out var collisionRow)) 161 if (index.TryGetValue(primaryKey, out var collisionRow))
162 { 162 {
163#if TODO_PATCH // This case doesn't seem like it can happen any longer.
163 // Overriding WixActionRows have a primary key defined and take precedence in the index. 164 // Overriding WixActionRows have a primary key defined and take precedence in the index.
164 if (row is WixActionRow actionRow) 165 if (row is WixActionRow actionRow)
165 { 166 {
@@ -176,6 +177,7 @@ namespace WixToolset.Core.WindowsInstaller
176 // If we got this far, the row does not need to be indexed. 177 // If we got this far, the row does not need to be indexed.
177 return; 178 return;
178 } 179 }
180#endif
179 181
180 if (this.ShowPedanticMessages) 182 if (this.ShowPedanticMessages)
181 { 183 {