diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-05-10 19:31:53 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-05-10 19:34:35 +1000 |
commit | 93d3a9e1f9cdc05456a612e238a83738cfd1750f (patch) | |
tree | a9a71f23effbf36f5f4b31266546c17d02eced4f /src | |
parent | a75639ceaffcf5f56fa33094037bca86331d9ac0 (diff) | |
download | wix-93d3a9e1f9cdc05456a612e238a83738cfd1750f.tar.gz wix-93d3a9e1f9cdc05456a612e238a83738cfd1750f.tar.bz2 wix-93d3a9e1f9cdc05456a612e238a83738cfd1750f.zip |
Track files in BindBundleCommand.
Diffstat (limited to 'src')
5 files changed, 52 insertions, 13 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index 733996c0..35c45fad 100644 --- a/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | |||
@@ -123,8 +123,10 @@ namespace WixToolset.Core.Burn | |||
123 | 123 | ||
124 | // Extract files that come from binary .wixlibs and WixExtensions (this does not extract files from merge modules). | 124 | // Extract files that come from binary .wixlibs and WixExtensions (this does not extract files from merge modules). |
125 | { | 125 | { |
126 | var command = new ExtractEmbeddedFilesCommand(this.ExpectedEmbeddedFiles); | 126 | var command = new ExtractEmbeddedFilesCommand(this.BackendHelper, this.ExpectedEmbeddedFiles); |
127 | command.Execute(); | 127 | command.Execute(); |
128 | |||
129 | trackedFiles.AddRange(command.TrackedFiles); | ||
128 | } | 130 | } |
129 | 131 | ||
130 | // Get the explicit payloads. | 132 | // Get the explicit payloads. |
@@ -164,6 +166,7 @@ namespace WixToolset.Core.Burn | |||
164 | command.Execute(); | 166 | command.Execute(); |
165 | 167 | ||
166 | fileTransfers.AddRange(command.FileTransfers); | 168 | fileTransfers.AddRange(command.FileTransfers); |
169 | trackedFiles.AddRange(command.TrackedFiles); | ||
167 | 170 | ||
168 | processedPayloads = new HashSet<string>(payloadTuples.Keys); | 171 | processedPayloads = new HashSet<string>(payloadTuples.Keys); |
169 | } | 172 | } |
@@ -245,6 +248,7 @@ namespace WixToolset.Core.Burn | |||
245 | command.Execute(); | 248 | command.Execute(); |
246 | 249 | ||
247 | fileTransfers.AddRange(command.FileTransfers); | 250 | fileTransfers.AddRange(command.FileTransfers); |
251 | trackedFiles.AddRange(command.TrackedFiles); | ||
248 | 252 | ||
249 | processedPayloads = null; | 253 | processedPayloads = null; |
250 | } | 254 | } |
@@ -379,6 +383,17 @@ namespace WixToolset.Core.Burn | |||
379 | // Update the bundle per-machine/per-user scope based on the chained packages. | 383 | // Update the bundle per-machine/per-user scope based on the chained packages. |
380 | this.ResolveBundleInstallScope(section, bundleTuple, orderedFacades); | 384 | this.ResolveBundleInstallScope(section, bundleTuple, orderedFacades); |
381 | 385 | ||
386 | // Give the extension one last hook before generating the output files. | ||
387 | foreach (var extension in this.BackendExtensions) | ||
388 | { | ||
389 | extension.BundleFinalize(); | ||
390 | } | ||
391 | |||
392 | if (this.Messaging.EncounteredError) | ||
393 | { | ||
394 | return; | ||
395 | } | ||
396 | |||
382 | // Generate the core-defined BA manifest tables... | 397 | // Generate the core-defined BA manifest tables... |
383 | string baManifestPath; | 398 | string baManifestPath; |
384 | { | 399 | { |
@@ -389,6 +404,8 @@ namespace WixToolset.Core.Burn | |||
389 | baManifestPath = command.OutputPath; | 404 | baManifestPath = command.OutputPath; |
390 | payloadTuples.Add(baManifestPayload.Id.Id, baManifestPayload); | 405 | payloadTuples.Add(baManifestPayload.Id.Id, baManifestPayload); |
391 | ++uxPayloadIndex; | 406 | ++uxPayloadIndex; |
407 | |||
408 | trackedFiles.Add(this.BackendHelper.TrackFile(baManifestPath, TrackedFileType.Temporary)); | ||
392 | } | 409 | } |
393 | 410 | ||
394 | // Generate the bundle extension manifest... | 411 | // Generate the bundle extension manifest... |
@@ -401,16 +418,8 @@ namespace WixToolset.Core.Burn | |||
401 | bextManifestPath = command.OutputPath; | 418 | bextManifestPath = command.OutputPath; |
402 | payloadTuples.Add(bextManifestPayload.Id.Id, bextManifestPayload); | 419 | payloadTuples.Add(bextManifestPayload.Id.Id, bextManifestPayload); |
403 | ++uxPayloadIndex; | 420 | ++uxPayloadIndex; |
404 | } | ||
405 | 421 | ||
406 | foreach (var extension in this.BackendExtensions) | 422 | trackedFiles.Add(this.BackendHelper.TrackFile(bextManifestPath, TrackedFileType.Temporary)); |
407 | { | ||
408 | extension.BundleFinalize(); | ||
409 | } | ||
410 | |||
411 | if (this.Messaging.EncounteredError) | ||
412 | { | ||
413 | return; | ||
414 | } | 423 | } |
415 | 424 | ||
416 | // Create all the containers except the UX container first so the manifest (that goes in the UX container) | 425 | // Create all the containers except the UX container first so the manifest (that goes in the UX container) |
@@ -423,6 +432,7 @@ namespace WixToolset.Core.Burn | |||
423 | command.Execute(); | 432 | command.Execute(); |
424 | 433 | ||
425 | fileTransfers.AddRange(command.FileTransfers); | 434 | fileTransfers.AddRange(command.FileTransfers); |
435 | trackedFiles.AddRange(command.TrackedFiles); | ||
426 | 436 | ||
427 | uxContainer = command.UXContainer; | 437 | uxContainer = command.UXContainer; |
428 | uxPayloads = command.UXContainerPayloads; | 438 | uxPayloads = command.UXContainerPayloads; |
@@ -438,6 +448,7 @@ namespace WixToolset.Core.Burn | |||
438 | command.Execute(); | 448 | command.Execute(); |
439 | 449 | ||
440 | manifestPath = command.OutputPath; | 450 | manifestPath = command.OutputPath; |
451 | trackedFiles.Add(this.BackendHelper.TrackFile(manifestPath, TrackedFileType.Temporary)); | ||
441 | } | 452 | } |
442 | 453 | ||
443 | // Create the UX container. | 454 | // Create the UX container. |
@@ -447,6 +458,8 @@ namespace WixToolset.Core.Burn | |||
447 | 458 | ||
448 | uxContainer.Hash = command.Hash; | 459 | uxContainer.Hash = command.Hash; |
449 | uxContainer.Size = command.Size; | 460 | uxContainer.Size = command.Size; |
461 | |||
462 | trackedFiles.Add(this.BackendHelper.TrackFile(uxContainer.WorkingPath, TrackedFileType.Temporary)); | ||
450 | } | 463 | } |
451 | 464 | ||
452 | { | 465 | { |
@@ -454,6 +467,7 @@ namespace WixToolset.Core.Burn | |||
454 | command.Execute(); | 467 | command.Execute(); |
455 | 468 | ||
456 | fileTransfers.Add(command.Transfer); | 469 | fileTransfers.Add(command.Transfer); |
470 | trackedFiles.Add(this.BackendHelper.TrackFile(this.OutputPath, TrackedFileType.Final)); | ||
457 | } | 471 | } |
458 | 472 | ||
459 | #if TODO // does this need to come back, or do they only need to be in TrackedFiles? | 473 | #if TODO // does this need to come back, or do they only need to be in TrackedFiles? |
diff --git a/src/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs b/src/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs index 34e601a7..babac5e2 100644 --- a/src/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs +++ b/src/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs | |||
@@ -27,6 +27,8 @@ namespace WixToolset.Core.Burn.Bundles | |||
27 | 27 | ||
28 | public IEnumerable<IFileTransfer> FileTransfers { get; private set; } | 28 | public IEnumerable<IFileTransfer> FileTransfers { get; private set; } |
29 | 29 | ||
30 | public IEnumerable<ITrackedFile> TrackedFiles { get; private set; } | ||
31 | |||
30 | public WixBundleContainerTuple UXContainer { get; set; } | 32 | public WixBundleContainerTuple UXContainer { get; set; } |
31 | 33 | ||
32 | public IEnumerable<WixBundlePayloadTuple> UXContainerPayloads { get; private set; } | 34 | public IEnumerable<WixBundlePayloadTuple> UXContainerPayloads { get; private set; } |
@@ -50,7 +52,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
50 | public void Execute() | 52 | public void Execute() |
51 | { | 53 | { |
52 | var fileTransfers = new List<IFileTransfer>(); | 54 | var fileTransfers = new List<IFileTransfer>(); |
53 | 55 | var trackedFiles = new List<ITrackedFile>(); | |
54 | var uxPayloadTuples = new List<WixBundlePayloadTuple>(); | 56 | var uxPayloadTuples = new List<WixBundlePayloadTuple>(); |
55 | 57 | ||
56 | var attachedContainerIndex = 1; // count starts at one because UX container is "0". | 58 | var attachedContainerIndex = 1; // count starts at one because UX container is "0". |
@@ -114,12 +116,14 @@ namespace WixToolset.Core.Burn.Bundles | |||
114 | } | 116 | } |
115 | 117 | ||
116 | this.CreateContainer(container, containerPayloads); | 118 | this.CreateContainer(container, containerPayloads); |
119 | trackedFiles.Add(this.BackendHelper.TrackFile(container.WorkingPath, TrackedFileType.Temporary, container.SourceLineNumbers)); | ||
117 | } | 120 | } |
118 | } | 121 | } |
119 | 122 | ||
120 | this.Containers = containerTuples; | 123 | this.Containers = containerTuples; |
121 | this.UXContainerPayloads = uxPayloadTuples; | 124 | this.UXContainerPayloads = uxPayloadTuples; |
122 | this.FileTransfers = fileTransfers; | 125 | this.FileTransfers = fileTransfers; |
126 | this.TrackedFiles = trackedFiles; | ||
123 | } | 127 | } |
124 | 128 | ||
125 | private void CreateContainer(WixBundleContainerTuple container, IEnumerable<WixBundlePayloadTuple> containerPayloads) | 129 | private void CreateContainer(WixBundleContainerTuple container, IEnumerable<WixBundlePayloadTuple> containerPayloads) |
diff --git a/src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs b/src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs index 42b1b5ab..7f3a2501 100644 --- a/src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs +++ b/src/WixToolset.Core.Burn/Bundles/ProcessPayloadsCommand.cs | |||
@@ -31,6 +31,8 @@ namespace WixToolset.Core.Burn.Bundles | |||
31 | 31 | ||
32 | public IEnumerable<IFileTransfer> FileTransfers { get; private set; } | 32 | public IEnumerable<IFileTransfer> FileTransfers { get; private set; } |
33 | 33 | ||
34 | public IEnumerable<ITrackedFile> TrackedFiles { get; private set; } | ||
35 | |||
34 | private IMessaging Messaging { get; } | 36 | private IMessaging Messaging { get; } |
35 | 37 | ||
36 | private IBackendHelper BackendHelper { get; } | 38 | private IBackendHelper BackendHelper { get; } |
@@ -44,6 +46,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
44 | public void Execute() | 46 | public void Execute() |
45 | { | 47 | { |
46 | var fileTransfers = new List<IFileTransfer>(); | 48 | var fileTransfers = new List<IFileTransfer>(); |
49 | var trackedFiles = new List<ITrackedFile>(); | ||
47 | 50 | ||
48 | foreach (var payload in this.Payloads) | 51 | foreach (var payload in this.Payloads) |
49 | { | 52 | { |
@@ -77,10 +80,16 @@ namespace WixToolset.Core.Burn.Bundles | |||
77 | var transfer = this.BackendHelper.CreateFileTransfer(sourceFile.Path, Path.Combine(this.LayoutDirectory, payload.Name), false, payload.SourceLineNumbers); | 80 | var transfer = this.BackendHelper.CreateFileTransfer(sourceFile.Path, Path.Combine(this.LayoutDirectory, payload.Name), false, payload.SourceLineNumbers); |
78 | fileTransfers.Add(transfer); | 81 | fileTransfers.Add(transfer); |
79 | } | 82 | } |
83 | |||
84 | if (payload.ContentFile) | ||
85 | { | ||
86 | trackedFiles.Add(this.BackendHelper.TrackFile(sourceFile.Path, TrackedFileType.Input, payload.SourceLineNumbers)); | ||
87 | } | ||
80 | } | 88 | } |
81 | } | 89 | } |
82 | 90 | ||
83 | this.FileTransfers = fileTransfers; | 91 | this.FileTransfers = fileTransfers; |
92 | this.TrackedFiles = trackedFiles; | ||
84 | } | 93 | } |
85 | 94 | ||
86 | private void UpdatePayloadPackagingType(WixBundlePayloadTuple payload) | 95 | private void UpdatePayloadPackagingType(WixBundlePayloadTuple payload) |
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index 5b401a0c..c9659287 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs | |||
@@ -232,8 +232,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
232 | 232 | ||
233 | // Extract files that come from binary .wixlibs and WixExtensions (this does not extract files from merge modules). | 233 | // Extract files that come from binary .wixlibs and WixExtensions (this does not extract files from merge modules). |
234 | { | 234 | { |
235 | var command = new ExtractEmbeddedFilesCommand(this.ExpectedEmbeddedFiles); | 235 | var command = new ExtractEmbeddedFilesCommand(this.BackendHelper, this.ExpectedEmbeddedFiles); |
236 | command.Execute(); | 236 | command.Execute(); |
237 | |||
238 | trackedFiles.AddRange(command.TrackedFiles); | ||
237 | } | 239 | } |
238 | 240 | ||
239 | // This must occur after all variables and source paths have been resolved. | 241 | // This must occur after all variables and source paths have been resolved. |
diff --git a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs index 683c3c50..bb9ab844 100644 --- a/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs +++ b/src/WixToolset.Core/Bind/ExtractEmbeddedFilesCommand.cs | |||
@@ -7,18 +7,25 @@ namespace WixToolset.Core.Bind | |||
7 | using System.Linq; | 7 | using System.Linq; |
8 | using WixToolset.Data; | 8 | using WixToolset.Data; |
9 | using WixToolset.Extensibility.Data; | 9 | using WixToolset.Extensibility.Data; |
10 | using WixToolset.Extensibility.Services; | ||
10 | 11 | ||
11 | public class ExtractEmbeddedFilesCommand | 12 | public class ExtractEmbeddedFilesCommand |
12 | { | 13 | { |
13 | public ExtractEmbeddedFilesCommand(IEnumerable<IExpectedExtractFile> embeddedFiles) | 14 | public ExtractEmbeddedFilesCommand(IBackendHelper backendHelper, IEnumerable<IExpectedExtractFile> embeddedFiles) |
14 | { | 15 | { |
16 | this.BackendHelper = backendHelper; | ||
15 | this.FilesWithEmbeddedFiles = embeddedFiles; | 17 | this.FilesWithEmbeddedFiles = embeddedFiles; |
16 | } | 18 | } |
17 | 19 | ||
20 | public IEnumerable<ITrackedFile> TrackedFiles { get; private set; } | ||
21 | |||
22 | private IBackendHelper BackendHelper { get; } | ||
23 | |||
18 | private IEnumerable<IExpectedExtractFile> FilesWithEmbeddedFiles { get; } | 24 | private IEnumerable<IExpectedExtractFile> FilesWithEmbeddedFiles { get; } |
19 | 25 | ||
20 | public void Execute() | 26 | public void Execute() |
21 | { | 27 | { |
28 | var trackedFiles = new List<ITrackedFile>(); | ||
22 | var group = this.FilesWithEmbeddedFiles.GroupBy(e => e.Uri); | 29 | var group = this.FilesWithEmbeddedFiles.GroupBy(e => e.Uri); |
23 | 30 | ||
24 | foreach (var expectedEmbeddedFileByUri in group) | 31 | foreach (var expectedEmbeddedFileByUri in group) |
@@ -34,10 +41,13 @@ namespace WixToolset.Core.Bind | |||
34 | if (uniqueIds.Add(embeddedFile.EmbeddedFileId)) | 41 | if (uniqueIds.Add(embeddedFile.EmbeddedFileId)) |
35 | { | 42 | { |
36 | wixout.ExtractEmbeddedFile(embeddedFile.EmbeddedFileId, embeddedFile.OutputPath); | 43 | wixout.ExtractEmbeddedFile(embeddedFile.EmbeddedFileId, embeddedFile.OutputPath); |
44 | trackedFiles.Add(this.BackendHelper.TrackFile(embeddedFile.OutputPath, TrackedFileType.Temporary)); | ||
37 | } | 45 | } |
38 | } | 46 | } |
39 | } | 47 | } |
40 | } | 48 | } |
49 | |||
50 | this.TrackedFiles = trackedFiles; | ||
41 | } | 51 | } |
42 | } | 52 | } |
43 | } | 53 | } |