diff options
| author | Rob Mensching <rob@firegiant.com> | 2018-07-26 23:52:12 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2018-07-27 11:31:18 -0700 |
| commit | 854e616eb3516c7405691b679617aa08c1dd1cdd (patch) | |
| tree | ce7694749bf88bc796825b84fbc4f9d8acae331d /src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |
| parent | c64faa7f6cb789a0756dff725146728889df8311 (diff) | |
| download | wix-854e616eb3516c7405691b679617aa08c1dd1cdd.tar.gz wix-854e616eb3516c7405691b679617aa08c1dd1cdd.tar.bz2 wix-854e616eb3516c7405691b679617aa08c1dd1cdd.zip | |
Support change of FileTransfer to interface
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index 119cbd55..3aad0709 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |||
| @@ -26,6 +26,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 26 | { | 26 | { |
| 27 | this.Messaging = context.ServiceProvider.GetService<IMessaging>(); | 27 | this.Messaging = context.ServiceProvider.GetService<IMessaging>(); |
| 28 | 28 | ||
| 29 | this.BackendHelper = context.ServiceProvider.GetService<IBackendHelper>(); | ||
| 30 | |||
| 29 | this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); | 31 | this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); |
| 30 | 32 | ||
| 31 | this.CabbingThreadCount = context.CabbingThreadCount; | 33 | this.CabbingThreadCount = context.CabbingThreadCount; |
| @@ -43,6 +45,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 43 | this.BackendExtensions = backendExtension; | 45 | this.BackendExtensions = backendExtension; |
| 44 | } | 46 | } |
| 45 | 47 | ||
| 48 | private IMessaging Messaging { get; } | ||
| 49 | |||
| 50 | private IBackendHelper BackendHelper { get; } | ||
| 51 | |||
| 46 | private int Codepage { get; } | 52 | private int Codepage { get; } |
| 47 | 53 | ||
| 48 | private int CabbingThreadCount { get; } | 54 | private int CabbingThreadCount { get; } |
| @@ -63,8 +69,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 63 | 69 | ||
| 64 | private Intermediate Intermediate { get; } | 70 | private Intermediate Intermediate { get; } |
| 65 | 71 | ||
| 66 | private IMessaging Messaging { get; } | ||
| 67 | |||
| 68 | private string OutputPath { get; } | 72 | private string OutputPath { get; } |
| 69 | 73 | ||
| 70 | private bool SuppressAddingValidationRows { get; } | 74 | private bool SuppressAddingValidationRows { get; } |
| @@ -77,7 +81,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 77 | 81 | ||
| 78 | private Validator Validator { get; } | 82 | private Validator Validator { get; } |
| 79 | 83 | ||
| 80 | public IEnumerable<FileTransfer> FileTransfers { get; private set; } | 84 | public IEnumerable<IFileTransfer> FileTransfers { get; private set; } |
| 81 | 85 | ||
| 82 | public IEnumerable<string> ContentFilePaths { get; private set; } | 86 | public IEnumerable<string> ContentFilePaths { get; private set; } |
| 83 | 87 | ||
| @@ -87,7 +91,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 87 | { | 91 | { |
| 88 | var section = this.Intermediate.Sections.Single(); | 92 | var section = this.Intermediate.Sections.Single(); |
| 89 | 93 | ||
| 90 | var fileTransfers = new List<FileTransfer>(); | 94 | var fileTransfers = new List<IFileTransfer>(); |
| 91 | 95 | ||
| 92 | var containsMergeModules = false; | 96 | var containsMergeModules = false; |
| 93 | var suppressedTableNames = new HashSet<string>(); | 97 | var suppressedTableNames = new HashSet<string>(); |
| @@ -375,7 +379,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 375 | { | 379 | { |
| 376 | this.Messaging.Write(VerboseMessages.CreatingCabinetFiles()); | 380 | this.Messaging.Write(VerboseMessages.CreatingCabinetFiles()); |
| 377 | 381 | ||
| 378 | var command = new CreateCabinetsCommand(); | 382 | var command = new CreateCabinetsCommand(this.BackendHelper); |
| 379 | command.CabbingThreadCount = this.CabbingThreadCount; | 383 | command.CabbingThreadCount = this.CabbingThreadCount; |
| 380 | command.CabCachePath = this.CabCachePath; | 384 | command.CabCachePath = this.CabCachePath; |
| 381 | command.DefaultCompressionLevel = this.DefaultCompressionLevel; | 385 | command.DefaultCompressionLevel = this.DefaultCompressionLevel; |
| @@ -415,11 +419,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 415 | string tempDatabaseFile = Path.Combine(this.IntermediateFolder, Path.GetFileName(this.OutputPath)); | 419 | string tempDatabaseFile = Path.Combine(this.IntermediateFolder, Path.GetFileName(this.OutputPath)); |
| 416 | this.GenerateDatabase(output, tempDatabaseFile, false, false); | 420 | this.GenerateDatabase(output, tempDatabaseFile, false, false); |
| 417 | 421 | ||
| 418 | if (FileTransfer.TryCreate(tempDatabaseFile, this.OutputPath, true, output.Type.ToString(), null, out var transfer)) // note where this database needs to move in the future | 422 | var transfer = this.BackendHelper.CreateFileTransfer(tempDatabaseFile, this.OutputPath, true, FileTransferType.Built); // note where this database needs to move in the future |
| 419 | { | 423 | fileTransfers.Add(transfer); |
| 420 | transfer.Built = true; | ||
| 421 | fileTransfers.Add(transfer); | ||
| 422 | } | ||
| 423 | 424 | ||
| 424 | // Stop processing if an error previously occurred. | 425 | // Stop processing if an error previously occurred. |
| 425 | if (this.Messaging.EncounteredError) | 426 | if (this.Messaging.EncounteredError) |
| @@ -491,7 +492,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 491 | // Process uncompressed files. | 492 | // Process uncompressed files. |
| 492 | if (!this.Messaging.EncounteredError && !this.SuppressLayout && uncompressedFiles.Any()) | 493 | if (!this.Messaging.EncounteredError && !this.SuppressLayout && uncompressedFiles.Any()) |
| 493 | { | 494 | { |
| 494 | var command = new ProcessUncompressedFilesCommand(section); | 495 | var command = new ProcessUncompressedFilesCommand(section, this.BackendHelper); |
| 495 | command.Compressed = compressed; | 496 | command.Compressed = compressed; |
| 496 | command.FileFacades = uncompressedFiles; | 497 | command.FileFacades = uncompressedFiles; |
| 497 | command.LayoutDirectory = layoutDirectory; | 498 | command.LayoutDirectory = layoutDirectory; |
