diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-25 14:43:50 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-25 14:50:31 -0700 |
| commit | 38afa9e7bc7eacc021f8805f607368a05751e3c3 (patch) | |
| tree | 803b0a8d9a06a7d6f7c4df408437017ae21a883e /src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs | |
| parent | 8968578d50858721317d410549a9f9b5c62bf1f7 (diff) | |
| download | wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.tar.gz wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.tar.bz2 wix-38afa9e7bc7eacc021f8805f607368a05751e3c3.zip | |
The Great Tuple to Symbol Rename (tm)
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs index 9741fcd9..5c296f74 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs | |||
| @@ -10,7 +10,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 10 | using System.Runtime.InteropServices; | 10 | using System.Runtime.InteropServices; |
| 11 | using WixToolset.Core.Bind; | 11 | using WixToolset.Core.Bind; |
| 12 | using WixToolset.Data; | 12 | using WixToolset.Data; |
| 13 | using WixToolset.Data.Tuples; | 13 | using WixToolset.Data.Symbols; |
| 14 | using WixToolset.Data.WindowsInstaller; | 14 | using WixToolset.Data.WindowsInstaller; |
| 15 | using WixToolset.Extensibility; | 15 | using WixToolset.Extensibility; |
| 16 | using WixToolset.Extensibility.Data; | 16 | using WixToolset.Extensibility.Data; |
| @@ -32,7 +32,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 32 | 32 | ||
| 33 | 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 |
| 34 | 34 | ||
| 35 | public CreateCabinetsCommand(IWixToolsetServiceProvider serviceProvider, IBackendHelper backendHelper, WixMediaTemplateTuple mediaTemplate) | 35 | public CreateCabinetsCommand(IWixToolsetServiceProvider serviceProvider, IBackendHelper backendHelper, WixMediaTemplateSymbol mediaTemplate) |
| 36 | { | 36 | { |
| 37 | this.fileTransfers = new List<IFileTransfer>(); | 37 | this.fileTransfers = new List<IFileTransfer>(); |
| 38 | 38 | ||
| @@ -51,7 +51,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 51 | 51 | ||
| 52 | private IBackendHelper BackendHelper { get; } | 52 | private IBackendHelper BackendHelper { get; } |
| 53 | 53 | ||
| 54 | private WixMediaTemplateTuple MediaTemplate { get; } | 54 | private WixMediaTemplateSymbol MediaTemplate { get; } |
| 55 | 55 | ||
| 56 | /// <summary> | 56 | /// <summary> |
| 57 | /// Sets the number of threads to use for cabinet creation. | 57 | /// Sets the number of threads to use for cabinet creation. |
| @@ -80,9 +80,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 80 | 80 | ||
| 81 | public string ModularizationSuffix { private get; set; } | 81 | public string ModularizationSuffix { private get; set; } |
| 82 | 82 | ||
| 83 | public Dictionary<MediaTuple, IEnumerable<FileFacade>> FileFacadesByCabinet { private get; set; } | 83 | public Dictionary<MediaSymbol, IEnumerable<FileFacade>> FileFacadesByCabinet { private get; set; } |
| 84 | 84 | ||
| 85 | public Func<MediaTuple, string, string, string> ResolveMedia { private get; set; } | 85 | public Func<MediaSymbol, string, string, string> ResolveMedia { private get; set; } |
| 86 | 86 | ||
| 87 | public TableDefinitionCollection TableDefinitions { private get; set; } | 87 | public TableDefinitionCollection TableDefinitions { private get; set; } |
| 88 | 88 | ||
| @@ -113,12 +113,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 113 | 113 | ||
| 114 | foreach (var entry in this.FileFacadesByCabinet) | 114 | foreach (var entry in this.FileFacadesByCabinet) |
| 115 | { | 115 | { |
| 116 | var mediaTuple = entry.Key; | 116 | var mediaSymbol = entry.Key; |
| 117 | var files = entry.Value; | 117 | var files = entry.Value; |
| 118 | var compressionLevel = mediaTuple.CompressionLevel ?? this.DefaultCompressionLevel ?? CompressionLevel.Medium; | 118 | var compressionLevel = mediaSymbol.CompressionLevel ?? this.DefaultCompressionLevel ?? CompressionLevel.Medium; |
| 119 | var cabinetDir = this.ResolveMedia(mediaTuple, mediaTuple.Layout, this.LayoutDirectory); | 119 | var cabinetDir = this.ResolveMedia(mediaSymbol, mediaSymbol.Layout, this.LayoutDirectory); |
| 120 | 120 | ||
| 121 | var cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaTuple, compressionLevel, files); | 121 | var cabinetWorkItem = this.CreateCabinetWorkItem(this.Output, cabinetDir, mediaSymbol, compressionLevel, files); |
| 122 | if (null != cabinetWorkItem) | 122 | if (null != cabinetWorkItem) |
| 123 | { | 123 | { |
| 124 | cabinetBuilder.Enqueue(cabinetWorkItem); | 124 | cabinetBuilder.Enqueue(cabinetWorkItem); |
| @@ -176,28 +176,28 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 176 | /// </summary> | 176 | /// </summary> |
| 177 | /// <param name="output">Output for the current database.</param> | 177 | /// <param name="output">Output for the current database.</param> |
| 178 | /// <param name="cabinetDir">Directory to create cabinet in.</param> | 178 | /// <param name="cabinetDir">Directory to create cabinet in.</param> |
| 179 | /// <param name="mediaTuple">Media tuple containing information about the cabinet.</param> | 179 | /// <param name="mediaSymbol">Media symbol containing information about the cabinet.</param> |
| 180 | /// <param name="fileFacades">Collection of files in this cabinet.</param> | 180 | /// <param name="fileFacades">Collection of files in this cabinet.</param> |
| 181 | /// <returns>created CabinetWorkItem object</returns> | 181 | /// <returns>created CabinetWorkItem object</returns> |
| 182 | private CabinetWorkItem CreateCabinetWorkItem(WindowsInstallerData output, string cabinetDir, MediaTuple mediaTuple, CompressionLevel compressionLevel, IEnumerable<FileFacade> fileFacades) | 182 | private CabinetWorkItem CreateCabinetWorkItem(WindowsInstallerData output, string cabinetDir, MediaSymbol mediaSymbol, CompressionLevel compressionLevel, IEnumerable<FileFacade> fileFacades) |
| 183 | { | 183 | { |
| 184 | CabinetWorkItem cabinetWorkItem = null; | 184 | CabinetWorkItem cabinetWorkItem = null; |
| 185 | var tempCabinetFileX = Path.Combine(this.IntermediateFolder, mediaTuple.Cabinet); | 185 | var tempCabinetFileX = Path.Combine(this.IntermediateFolder, mediaSymbol.Cabinet); |
| 186 | 186 | ||
| 187 | // check for an empty cabinet | 187 | // check for an empty cabinet |
| 188 | if (!fileFacades.Any()) | 188 | if (!fileFacades.Any()) |
| 189 | { | 189 | { |
| 190 | // Remove the leading '#' from the embedded cabinet name to make the warning easier to understand | 190 | // Remove the leading '#' from the embedded cabinet name to make the warning easier to understand |
| 191 | var cabinetName = mediaTuple.Cabinet.TrimStart('#'); | 191 | var cabinetName = mediaSymbol.Cabinet.TrimStart('#'); |
| 192 | 192 | ||
| 193 | // If building a patch, remind them to run -p for torch. | 193 | // If building a patch, remind them to run -p for torch. |
| 194 | if (OutputType.Patch == output.Type) | 194 | if (OutputType.Patch == output.Type) |
| 195 | { | 195 | { |
| 196 | this.Messaging.Write(WarningMessages.EmptyCabinet(mediaTuple.SourceLineNumbers, cabinetName, true)); | 196 | this.Messaging.Write(WarningMessages.EmptyCabinet(mediaSymbol.SourceLineNumbers, cabinetName, true)); |
| 197 | } | 197 | } |
| 198 | else | 198 | else |
| 199 | { | 199 | { |
| 200 | this.Messaging.Write(WarningMessages.EmptyCabinet(mediaTuple.SourceLineNumbers, cabinetName)); | 200 | this.Messaging.Write(WarningMessages.EmptyCabinet(mediaSymbol.SourceLineNumbers, cabinetName)); |
| 201 | } | 201 | } |
| 202 | } | 202 | } |
| 203 | 203 | ||
| @@ -213,7 +213,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 213 | } | 213 | } |
| 214 | else // reuse the cabinet from the cabinet cache. | 214 | else // reuse the cabinet from the cabinet cache. |
| 215 | { | 215 | { |
| 216 | this.Messaging.Write(VerboseMessages.ReusingCabCache(mediaTuple.SourceLineNumbers, mediaTuple.Cabinet, resolvedCabinet.Path)); | 216 | this.Messaging.Write(VerboseMessages.ReusingCabCache(mediaSymbol.SourceLineNumbers, mediaSymbol.Cabinet, resolvedCabinet.Path)); |
| 217 | 217 | ||
| 218 | try | 218 | try |
| 219 | { | 219 | { |
| @@ -227,27 +227,27 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 227 | } | 227 | } |
| 228 | catch (Exception e) | 228 | catch (Exception e) |
| 229 | { | 229 | { |
| 230 | this.Messaging.Write(WarningMessages.CannotUpdateCabCache(mediaTuple.SourceLineNumbers, resolvedCabinet.Path, e.Message)); | 230 | this.Messaging.Write(WarningMessages.CannotUpdateCabCache(mediaSymbol.SourceLineNumbers, resolvedCabinet.Path, e.Message)); |
| 231 | } | 231 | } |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | var trackResolvedCabinet = this.BackendHelper.TrackFile(resolvedCabinet.Path, TrackedFileType.Intermediate, mediaTuple.SourceLineNumbers); | 234 | var trackResolvedCabinet = this.BackendHelper.TrackFile(resolvedCabinet.Path, TrackedFileType.Intermediate, mediaSymbol.SourceLineNumbers); |
| 235 | this.trackedFiles.Add(trackResolvedCabinet); | 235 | this.trackedFiles.Add(trackResolvedCabinet); |
| 236 | 236 | ||
| 237 | if (mediaTuple.Cabinet.StartsWith("#", StringComparison.Ordinal)) | 237 | if (mediaSymbol.Cabinet.StartsWith("#", StringComparison.Ordinal)) |
| 238 | { | 238 | { |
| 239 | var streamsTable = output.EnsureTable(this.TableDefinitions["_Streams"]); | 239 | var streamsTable = output.EnsureTable(this.TableDefinitions["_Streams"]); |
| 240 | 240 | ||
| 241 | var streamRow = streamsTable.CreateRow(mediaTuple.SourceLineNumbers); | 241 | var streamRow = streamsTable.CreateRow(mediaSymbol.SourceLineNumbers); |
| 242 | streamRow[0] = mediaTuple.Cabinet.Substring(1); | 242 | streamRow[0] = mediaSymbol.Cabinet.Substring(1); |
| 243 | streamRow[1] = resolvedCabinet.Path; | 243 | streamRow[1] = resolvedCabinet.Path; |
| 244 | } | 244 | } |
| 245 | else | 245 | else |
| 246 | { | 246 | { |
| 247 | var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaTuple.Cabinet), TrackedFileType.Final, mediaTuple.SourceLineNumbers); | 247 | var trackDestination = this.BackendHelper.TrackFile(Path.Combine(cabinetDir, mediaSymbol.Cabinet), TrackedFileType.Final, mediaSymbol.SourceLineNumbers); |
| 248 | this.trackedFiles.Add(trackDestination); | 248 | this.trackedFiles.Add(trackDestination); |
| 249 | 249 | ||
| 250 | var transfer = this.BackendHelper.CreateFileTransfer(resolvedCabinet.Path, trackDestination.Path, resolvedCabinet.BuildOption == CabinetBuildOption.BuildAndMove, mediaTuple.SourceLineNumbers); | 250 | var transfer = this.BackendHelper.CreateFileTransfer(resolvedCabinet.Path, trackDestination.Path, resolvedCabinet.BuildOption == CabinetBuildOption.BuildAndMove, mediaSymbol.SourceLineNumbers); |
| 251 | this.fileTransfers.Add(transfer); | 251 | this.fileTransfers.Add(transfer); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| @@ -372,7 +372,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 372 | } | 372 | } |
| 373 | 373 | ||
| 374 | // The new Row has to be inserted just after the last cab in this cabinet split chain according to DiskID Sort | 374 | // The new Row has to be inserted just after the last cab in this cabinet split chain according to DiskID Sort |
| 375 | // This is because the FDI Extract requires DiskID of Split Cabinets to be continuous. It Fails otherwise with | 375 | // This is because the FDI Extract requires DiskID of Split Cabinets to be continuous. It Fails otherwise with |
| 376 | // Error 2350 (FDI Server Error) as next DiskID did not have the right split cabinet during extraction | 376 | // Error 2350 (FDI Server Error) as next DiskID did not have the right split cabinet during extraction |
| 377 | MediaRow newMediaRow = (MediaRow)mediaTable.CreateRow(null); | 377 | MediaRow newMediaRow = (MediaRow)mediaTable.CreateRow(null); |
| 378 | newMediaRow.Cabinet = newCabinetName; | 378 | newMediaRow.Cabinet = newCabinetName; |
