aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2019-05-22 00:58:13 -0700
committerRob Mensching <rob@firegiant.com>2019-05-23 16:02:37 -0700
commitd0462be8000f18aa7dc0791d02142f000bb19fbf (patch)
tree072aabc2bd9b8f171e17654473f85c44a8a42a66 /src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
parent1ed894bc0f39397ec7f7f6344370fc2123420c43 (diff)
downloadwix-d0462be8000f18aa7dc0791d02142f000bb19fbf.tar.gz
wix-d0462be8000f18aa7dc0791d02142f000bb19fbf.tar.bz2
wix-d0462be8000f18aa7dc0791d02142f000bb19fbf.zip
Integrate latest changes to tuple definitions
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs31
1 files changed, 7 insertions, 24 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
index 890c446c..be3c720f 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs
@@ -26,11 +26,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind
26 public const int DefaultMaximumUncompressedMediaSize = 200; // Default value is 200 MB 26 public const int DefaultMaximumUncompressedMediaSize = 200; // Default value is 200 MB
27 public const int MaxValueOfMaxCabSizeForLargeFileSplitting = 2 * 1024; // 2048 MB (i.e. 2 GB) 27 public const int MaxValueOfMaxCabSizeForLargeFileSplitting = 2 * 1024; // 2048 MB (i.e. 2 GB)
28 28
29 private List<IFileTransfer> fileTransfers; 29 private readonly List<IFileTransfer> fileTransfers;
30 30
31 private List<ITrackedFile> trackedFiles; 31 private readonly List<ITrackedFile> trackedFiles;
32 32
33 private FileSplitCabNamesCallback newCabNamesCallBack; 33 private readonly FileSplitCabNamesCallback newCabNamesCallBack;
34 34
35 private Dictionary<string, string> lastCabinetAddedToMediaTable; // Key is First Cabinet Name, Value is Last Cabinet Added in the Split Sequence 35 private Dictionary<string, string> lastCabinetAddedToMediaTable; // Key is First Cabinet Name, Value is Last Cabinet Added in the Split Sequence
36 36
@@ -82,8 +82,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
82 82
83 public TableDefinitionCollection TableDefinitions { private get; set; } 83 public TableDefinitionCollection TableDefinitions { private get; set; }
84 84
85 public IEnumerable<WixMediaTuple> WixMediaTuples { private get; set; }
86
87 public IEnumerable<IFileTransfer> FileTransfers => this.fileTransfers; 85 public IEnumerable<IFileTransfer> FileTransfers => this.fileTransfers;
88 86
89 public IEnumerable<ITrackedFile> TrackedFiles => this.trackedFiles; 87 public IEnumerable<ITrackedFile> TrackedFiles => this.trackedFiles;
@@ -94,14 +92,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind
94 /// <returns>The uncompressed file rows.</returns> 92 /// <returns>The uncompressed file rows.</returns>
95 public void Execute() 93 public void Execute()
96 { 94 {
97 var wixMediaTuples = this.WixMediaTuples.ToDictionary(t => t.DiskId_);
98
99 this.lastCabinetAddedToMediaTable = new Dictionary<string, string>(); 95 this.lastCabinetAddedToMediaTable = new Dictionary<string, string>();
100 96
101 this.SetCabbingThreadCount(); 97 this.SetCabbingThreadCount();
102 98
103 // Send Binder object to Facilitate NewCabNamesCallBack Callback 99 // Send Binder object to Facilitate NewCabNamesCallBack Callback
104 CabinetBuilder cabinetBuilder = new CabinetBuilder(this.Messaging, this.CabbingThreadCount, Marshal.GetFunctionPointerForDelegate(this.newCabNamesCallBack)); 100 var cabinetBuilder = new CabinetBuilder(this.Messaging, this.CabbingThreadCount, Marshal.GetFunctionPointerForDelegate(this.newCabNamesCallBack));
105 101
106 // Supply Compile MediaTemplate Attributes to Cabinet Builder 102 // Supply Compile MediaTemplate Attributes to Cabinet Builder
107 this.GetMediaTemplateAttributes(out var MaximumCabinetSizeForLargeFileSplitting, out var MaximumUncompressedMediaSize); 103 this.GetMediaTemplateAttributes(out var MaximumCabinetSizeForLargeFileSplitting, out var MaximumUncompressedMediaSize);
@@ -111,22 +107,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
111 foreach (var entry in this.FileRowsByCabinet) 107 foreach (var entry in this.FileRowsByCabinet)
112 { 108 {
113 var mediaTuple = entry.Key; 109 var mediaTuple = entry.Key;
114 IEnumerable<FileFacade> files = entry.Value; 110 var files = entry.Value;
115 CompressionLevel compressionLevel = this.DefaultCompressionLevel ?? CompressionLevel.Medium; 111 var compressionLevel = mediaTuple.CompressionLevel ?? this.DefaultCompressionLevel ?? CompressionLevel.Medium;
116 112 var cabinetDir = this.ResolveMedia(mediaTuple, mediaTuple.Layout, this.LayoutDirectory);
117 string mediaLayoutFolder = null;
118
119 if (wixMediaTuples.TryGetValue(mediaTuple.DiskId, out var wixMediaRow))
120 {
121 mediaLayoutFolder = wixMediaRow.Layout;
122
123 if (wixMediaRow.CompressionLevel.HasValue)
124 {
125 compressionLevel = wixMediaRow.CompressionLevel.Value;
126 }
127 }
128
129 string cabinetDir = this.ResolveMedia(mediaTuple, mediaLayoutFolder, this.LayoutDirectory);
130 113
131 var cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaTuple, compressionLevel, files); 114 var cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaTuple, compressionLevel, files);
132 if (null != cabinetWorkItem) 115 if (null != cabinetWorkItem)