aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
index df1c824a..6503ba65 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs
@@ -21,11 +21,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind
21 // As outlined in RFC 4122, this is our namespace for generating name-based (version 3) UUIDs. 21 // As outlined in RFC 4122, this is our namespace for generating name-based (version 3) UUIDs.
22 internal static readonly Guid WixComponentGuidNamespace = new Guid("{3064E5C6-FB63-4FE9-AC49-E446A792EFA5}"); 22 internal static readonly Guid WixComponentGuidNamespace = new Guid("{3064E5C6-FB63-4FE9-AC49-E446A792EFA5}");
23 23
24 public BindDatabaseCommand(IBindContext context, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtension, Validator validator) : this(context, backendExtension, null, validator) 24 public BindDatabaseCommand(IBindContext context, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtension, string cubeFile) : this(context, backendExtension, null, cubeFile)
25 { 25 {
26 } 26 }
27 27
28 public BindDatabaseCommand(IBindContext context, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtension, IEnumerable<SubStorage> subStorages, Validator validator) 28 public BindDatabaseCommand(IBindContext context, IEnumerable<IWindowsInstallerBackendBinderExtension> backendExtension, IEnumerable<SubStorage> subStorages, string cubeFile)
29 { 29 {
30 this.ServiceProvider = context.ServiceProvider; 30 this.ServiceProvider = context.ServiceProvider;
31 31
@@ -50,7 +50,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind
50 this.SuppressLayout = context.SuppressLayout; 50 this.SuppressLayout = context.SuppressLayout;
51 51
52 this.SubStorages = subStorages; 52 this.SubStorages = subStorages;
53 this.Validator = validator; 53
54 this.SuppressValidation = context.SuppressValidation;
55 this.Ices = context.Ices;
56 this.SuppressedIces = context.SuppressIces;
57 this.CubeFiles = String.IsNullOrEmpty(cubeFile) ? null : new[] { cubeFile };
54 58
55 this.BackendExtensions = backendExtension; 59 this.BackendExtensions = backendExtension;
56 } 60 }
@@ -97,7 +101,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind
97 101
98 private string IntermediateFolder { get; } 102 private string IntermediateFolder { get; }
99 103
100 private Validator Validator { get; } 104 private bool SuppressValidation { get; }
105
106 private IEnumerable<string> Ices { get; }
107
108 private IEnumerable<string> SuppressedIces { get; }
109
110 private IEnumerable<string> CubeFiles { get; }
101 111
102 public IBindResult Execute() 112 public IBindResult Execute()
103 { 113 {
@@ -522,34 +532,22 @@ namespace WixToolset.Core.WindowsInstaller.Bind
522 if (this.Messaging.EncounteredError) 532 if (this.Messaging.EncounteredError)
523 { 533 {
524 return null; 534 return null;
525 } 535 }
526 536
527#if TODO_FINISH_VALIDATION 537 // Validate the output if there are CUBe files and we're not explicitly suppressing validation.
528 // Validate the output if there is an MSI validator. 538 if (this.CubeFiles != null && !this.SuppressValidation)
529 if (null != this.Validator)
530 { 539 {
531 Stopwatch stopwatch = Stopwatch.StartNew(); 540 var command = new ValidateDatabaseCommand(this.Messaging, this.IntermediateFolder, data, this.OutputPath, this.CubeFiles, this.Ices, this.SuppressedIces);
532 541 command.Execute();
533 // set the output file for source line information 542 }
534 this.Validator.Output = this.Output;
535
536 Messaging.Instance.Write(WixVerboses.ValidatingDatabase());
537
538 this.Validator.Validate(this.OutputPath);
539
540 stopwatch.Stop();
541 Messaging.Instance.Write(WixVerboses.ValidatedDatabase(stopwatch.ElapsedMilliseconds));
542 543
543 // Stop processing if an error occurred. 544 if (this.Messaging.EncounteredError)
544 if (Messaging.Instance.EncounteredError) 545 {
545 { 546 return null;
546 return;
547 }
548 } 547 }
549#endif
550 548
551 // Process uncompressed files. 549 // Process uncompressed files.
552 if (!this.Messaging.EncounteredError && !this.SuppressLayout && uncompressedFiles.Any()) 550 if (!this.SuppressLayout && uncompressedFiles.Any())
553 { 551 {
554 var command = new ProcessUncompressedFilesCommand(section, this.WindowsInstallerBackendHelper, this.PathResolver); 552 var command = new ProcessUncompressedFilesCommand(section, this.WindowsInstallerBackendHelper, this.PathResolver);
555 command.Compressed = compressed; 553 command.Compressed = compressed;