Fix tracking of detached containers
Detached containers were being tracked as both a BuiltContentOutput and Temporary file. That caused the detached containers to be cleaned up and unavailable for the bundle after the build. Also removed the unused ITrackedFile.Clean property.
Rob Mensching committed
Oct 4, 2022 at 13:21 UTC
bec7063ae6bef19c4deb62afab7c529e739bbfa9
5 files changed
+5
-15
src/api/wix/WixToolset.Extensibility/Data/ITrackedFile.cs
-5
@@ -9,11 +9,6 @@ namespace WixToolset.Extensibility.Data
9
/// </summary>
10
public interface ITrackedFile
11
{
12
- /// <summary>
13
- /// Indicates whether the tracked file should be cleaned by the project.
14
- /// </summary>
15
- bool Clean { get; set; }
16
-
12
/// <summary>
13
/// Path to tracked file.
14
/// </summary>
src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
+1
-1
@@ -484,7 +484,7 @@ namespace WixToolset.Core.Burn
484
uxContainer.Hash = command.Hash;
485
uxContainer.Size = command.Size;
486
487
- trackedFiles.Add(this.BackendHelper.TrackFile(uxContainer.WorkingPath, TrackedFileType.Temporary));
487
+ trackedFiles.Add(this.BackendHelper.TrackFile(uxContainer.WorkingPath, TrackedFileType.Temporary, uxContainer.SourceLineNumbers));
488
}
489
490
{
src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs
+4
-3
@@ -78,8 +78,8 @@ namespace WixToolset.Core.Burn.Bundles
78
{
79
this.UXContainer = container;
80
81
- container.WorkingPath = Path.Combine(this.IntermediateFolder, container.Name);
81
container.AttachedContainerIndex = 0;
82
+ container.WorkingPath = Path.Combine(this.IntermediateFolder, container.Name);
83
84
// Gather the list of UX payloads but ensure the BootstrapperApplicationDll Payload is the first
85
// in the list since that is the Payload that Burn attempts to load.
@@ -101,9 +101,9 @@ namespace WixToolset.Core.Burn.Bundles
101
{
102
container.WorkingPath = Path.Combine(this.IntermediateFolder, container.Name);
103
104
- // Add detached containers to the list of file transfers.
104
if (ContainerType.Detached == container.Type)
105
{
106
+ // Add file transfer to move the detached containers from intermediate build location to the correct output location.
107
var outputPath = Path.Combine(this.LayoutFolder, container.Name);
108
var transfer = this.BackendHelper.CreateFileTransfer(container.WorkingPath, outputPath, true, container.SourceLineNumbers);
109
fileTransfers.Add(transfer);
@@ -116,6 +116,8 @@ namespace WixToolset.Core.Burn.Bundles
116
117
container.AttachedContainerIndex = attachedContainerIndex;
118
++attachedContainerIndex;
119
+
120
+ trackedFiles.Add(this.BackendHelper.TrackFile(container.WorkingPath, TrackedFileType.Temporary, container.SourceLineNumbers));
121
}
122
}
123
}
@@ -125,7 +127,6 @@ namespace WixToolset.Core.Burn.Bundles
127
foreach (var container in this.Containers.Where(c => !String.IsNullOrEmpty(c.WorkingPath) && c.Id.Id != BurnConstants.BurnUXContainerName))
128
{
129
this.CreateContainer(container, payloadsByContainer[container.Id.Id]);
128
- trackedFiles.Add(this.BackendHelper.TrackFile(container.WorkingPath, TrackedFileType.Temporary, container.SourceLineNumbers));
130
}
131
}
132
src/wix/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
-3
@@ -113,9 +113,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind
113
fileTransfers.Add(transfer);
114
115
var tracked = this.BackendHelper.TrackFile(transfer.Destination, TrackedFileType.CopiedOutput, facade.SourceLineNumber);
116
-
117
- tracked.Clean = !transfer.Redundant;
118
-
116
trackedFiles.Add(tracked);
117
}
118
}
src/wix/WixToolset.Core/ExtensibilityServices/TrackedFile.cs
-3
@@ -12,11 +12,8 @@ namespace WixToolset.Core.ExtensibilityServices
12
this.Path = path;
13
this.Type = type;
14
this.SourceLineNumbers = sourceLineNumbers;
15
- this.Clean = (type == TrackedFileType.Intermediate || type == TrackedFileType.BuiltContentOutput || type == TrackedFileType.BuiltTargetOutput || type == TrackedFileType.BuiltPdbOutput || type == TrackedFileType.CopiedOutput);
15
}
16
18
- public bool Clean { get; set; }
19
-
17
public string Path { get; set; }
18
19
public SourceLineNumber SourceLineNumbers { get; set; }