diff options
| author | Rob Mensching <rob@firegiant.com> | 2020-06-12 12:51:28 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2020-06-13 09:22:27 -0700 |
| commit | 167d26d002b1412e72d96ed2bbc0761fc0f1344b (patch) | |
| tree | 184212c1e347c6c876f629ca3b3e86445e877204 /src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |
| parent | 86b7ea7a411813e03a2b238ca5c24fcebc947209 (diff) | |
| download | wix-167d26d002b1412e72d96ed2bbc0761fc0f1344b.tar.gz wix-167d26d002b1412e72d96ed2bbc0761fc0f1344b.tar.bz2 wix-167d26d002b1412e72d96ed2bbc0761fc0f1344b.zip | |
Normalize commands to use constructors
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | 82 |
1 files changed, 38 insertions, 44 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index e0dd2b96..b3f81212 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |||
| @@ -277,11 +277,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 277 | 277 | ||
| 278 | // Gather information about files that do not come from merge modules. | 278 | // Gather information about files that do not come from merge modules. |
| 279 | { | 279 | { |
| 280 | var command = new UpdateFileFacadesCommand(this.Messaging, section); | 280 | var command = new UpdateFileFacadesCommand(this.Messaging, section, fileFacades, fileFacades.Where(f => !f.FromModule), variableCache, overwriteHash: true); |
| 281 | command.FileFacades = fileFacades; | ||
| 282 | command.UpdateFileFacades = fileFacades.Where(f => !f.FromModule); | ||
| 283 | command.OverwriteHash = true; | ||
| 284 | command.VariableCache = variableCache; | ||
| 285 | command.Execute(); | 281 | command.Execute(); |
| 286 | } | 282 | } |
| 287 | 283 | ||
| @@ -290,9 +286,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 290 | Dictionary<MediaTuple, IEnumerable<FileFacade>> filesByCabinetMedia; | 286 | Dictionary<MediaTuple, IEnumerable<FileFacade>> filesByCabinetMedia; |
| 291 | IEnumerable<FileFacade> uncompressedFiles; | 287 | IEnumerable<FileFacade> uncompressedFiles; |
| 292 | { | 288 | { |
| 293 | var command = new AssignMediaCommand(section, this.Messaging); | 289 | var command = new AssignMediaCommand(section, this.Messaging, fileFacades, compressed); |
| 294 | command.FileFacades = fileFacades; | ||
| 295 | command.FilesCompressed = compressed; | ||
| 296 | command.Execute(); | 290 | command.Execute(); |
| 297 | 291 | ||
| 298 | assignedMediaRows = command.MediaRows; | 292 | assignedMediaRows = command.MediaRows; |
| @@ -313,6 +307,42 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 313 | command.Execute(); | 307 | command.Execute(); |
| 314 | } | 308 | } |
| 315 | 309 | ||
| 310 | #if TODO_FINISH_UPDATE // use tuples instead of rows | ||
| 311 | // Extended binder extensions can be called now that fields are resolved. | ||
| 312 | { | ||
| 313 | Table updatedFiles = this.Output.EnsureTable(this.TableDefinitions["WixBindUpdatedFiles"]); | ||
| 314 | |||
| 315 | foreach (IBinderExtension extension in this.Extensions) | ||
| 316 | { | ||
| 317 | extension.AfterResolvedFields(this.Output); | ||
| 318 | } | ||
| 319 | |||
| 320 | List<FileFacade> updatedFileFacades = new List<FileFacade>(); | ||
| 321 | |||
| 322 | foreach (Row updatedFile in updatedFiles.Rows) | ||
| 323 | { | ||
| 324 | string updatedId = updatedFile.FieldAsString(0); | ||
| 325 | |||
| 326 | FileFacade updatedFacade = fileFacades.First(f => f.File.File.Equals(updatedId)); | ||
| 327 | |||
| 328 | updatedFileFacades.Add(updatedFacade); | ||
| 329 | } | ||
| 330 | |||
| 331 | if (updatedFileFacades.Any()) | ||
| 332 | { | ||
| 333 | UpdateFileFacadesCommand command = new UpdateFileFacadesCommand(this.Messaging, section, fileFacades, updateFileFacades, variableCache, overwriteHash: false); | ||
| 334 | //command.FileFacades = fileFacades; | ||
| 335 | //command.UpdateFileFacades = updatedFileFacades; | ||
| 336 | //command.ModularizationGuid = modularizationGuid; | ||
| 337 | //command.Output = this.Output; | ||
| 338 | //command.OverwriteHash = true; | ||
| 339 | //command.TableDefinitions = this.TableDefinitions; | ||
| 340 | //command.VariableCache = variableCache; | ||
| 341 | command.Execute(); | ||
| 342 | } | ||
| 343 | } | ||
| 344 | #endif | ||
| 345 | |||
| 316 | // Set generated component guids. | 346 | // Set generated component guids. |
| 317 | { | 347 | { |
| 318 | var command = new CalculateComponentGuids(this.Messaging, this.BackendHelper, this.PathResolver, section); | 348 | var command = new CalculateComponentGuids(this.Messaging, this.BackendHelper, this.PathResolver, section); |
| @@ -376,42 +406,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 376 | } | 406 | } |
| 377 | } | 407 | } |
| 378 | 408 | ||
| 379 | #if TODO_FINISH_UPDATE | ||
| 380 | // Extended binder extensions can be called now that fields are resolved. | ||
| 381 | { | ||
| 382 | Table updatedFiles = this.Output.EnsureTable(this.TableDefinitions["WixBindUpdatedFiles"]); | ||
| 383 | |||
| 384 | foreach (IBinderExtension extension in this.Extensions) | ||
| 385 | { | ||
| 386 | extension.AfterResolvedFields(this.Output); | ||
| 387 | } | ||
| 388 | |||
| 389 | List<FileFacade> updatedFileFacades = new List<FileFacade>(); | ||
| 390 | |||
| 391 | foreach (Row updatedFile in updatedFiles.Rows) | ||
| 392 | { | ||
| 393 | string updatedId = updatedFile.FieldAsString(0); | ||
| 394 | |||
| 395 | FileFacade updatedFacade = fileFacades.First(f => f.File.File.Equals(updatedId)); | ||
| 396 | |||
| 397 | updatedFileFacades.Add(updatedFacade); | ||
| 398 | } | ||
| 399 | |||
| 400 | if (updatedFileFacades.Any()) | ||
| 401 | { | ||
| 402 | UpdateFileFacadesCommand command = new UpdateFileFacadesCommand(); | ||
| 403 | command.FileFacades = fileFacades; | ||
| 404 | command.UpdateFileFacades = updatedFileFacades; | ||
| 405 | command.ModularizationGuid = modularizationGuid; | ||
| 406 | command.Output = this.Output; | ||
| 407 | command.OverwriteHash = true; | ||
| 408 | command.TableDefinitions = this.TableDefinitions; | ||
| 409 | command.VariableCache = variableCache; | ||
| 410 | command.Execute(); | ||
| 411 | } | ||
| 412 | } | ||
| 413 | #endif | ||
| 414 | |||
| 415 | // Stop processing if an error previously occurred. | 409 | // Stop processing if an error previously occurred. |
| 416 | if (this.Messaging.EncounteredError) | 410 | if (this.Messaging.EncounteredError) |
| 417 | { | 411 | { |
