From bec7063ae6bef19c4deb62afab7c529e739bbfa9 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 4 Oct 2022 13:21:14 -0700 Subject: 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. --- src/api/wix/WixToolset.Extensibility/Data/ITrackedFile.cs | 5 ----- src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | 2 +- src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs | 7 ++++--- .../Bind/ProcessUncompressedFilesCommand.cs | 3 --- src/wix/WixToolset.Core/ExtensibilityServices/TrackedFile.cs | 3 --- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/api/wix/WixToolset.Extensibility/Data/ITrackedFile.cs b/src/api/wix/WixToolset.Extensibility/Data/ITrackedFile.cs index df36bd2b..771531e8 100644 --- a/src/api/wix/WixToolset.Extensibility/Data/ITrackedFile.cs +++ b/src/api/wix/WixToolset.Extensibility/Data/ITrackedFile.cs @@ -9,11 +9,6 @@ namespace WixToolset.Extensibility.Data /// public interface ITrackedFile { - /// - /// Indicates whether the tracked file should be cleaned by the project. - /// - bool Clean { get; set; } - /// /// Path to tracked file. /// diff --git a/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index 6ae3520f..621be346 100644 --- a/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs @@ -484,7 +484,7 @@ namespace WixToolset.Core.Burn uxContainer.Hash = command.Hash; uxContainer.Size = command.Size; - trackedFiles.Add(this.BackendHelper.TrackFile(uxContainer.WorkingPath, TrackedFileType.Temporary)); + trackedFiles.Add(this.BackendHelper.TrackFile(uxContainer.WorkingPath, TrackedFileType.Temporary, uxContainer.SourceLineNumbers)); } { diff --git a/src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs b/src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs index 2df07dd6..8e83408a 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/CreateNonUXContainers.cs @@ -78,8 +78,8 @@ namespace WixToolset.Core.Burn.Bundles { this.UXContainer = container; - container.WorkingPath = Path.Combine(this.IntermediateFolder, container.Name); container.AttachedContainerIndex = 0; + container.WorkingPath = Path.Combine(this.IntermediateFolder, container.Name); // Gather the list of UX payloads but ensure the BootstrapperApplicationDll Payload is the first // in the list since that is the Payload that Burn attempts to load. @@ -101,9 +101,9 @@ namespace WixToolset.Core.Burn.Bundles { container.WorkingPath = Path.Combine(this.IntermediateFolder, container.Name); - // Add detached containers to the list of file transfers. if (ContainerType.Detached == container.Type) { + // Add file transfer to move the detached containers from intermediate build location to the correct output location. var outputPath = Path.Combine(this.LayoutFolder, container.Name); var transfer = this.BackendHelper.CreateFileTransfer(container.WorkingPath, outputPath, true, container.SourceLineNumbers); fileTransfers.Add(transfer); @@ -116,6 +116,8 @@ namespace WixToolset.Core.Burn.Bundles container.AttachedContainerIndex = attachedContainerIndex; ++attachedContainerIndex; + + trackedFiles.Add(this.BackendHelper.TrackFile(container.WorkingPath, TrackedFileType.Temporary, container.SourceLineNumbers)); } } } @@ -125,7 +127,6 @@ namespace WixToolset.Core.Burn.Bundles foreach (var container in this.Containers.Where(c => !String.IsNullOrEmpty(c.WorkingPath) && c.Id.Id != BurnConstants.BurnUXContainerName)) { this.CreateContainer(container, payloadsByContainer[container.Id.Id]); - trackedFiles.Add(this.BackendHelper.TrackFile(container.WorkingPath, TrackedFileType.Temporary, container.SourceLineNumbers)); } } diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs b/src/wix/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs index 26b69afb..c5f198f8 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs @@ -113,9 +113,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind fileTransfers.Add(transfer); var tracked = this.BackendHelper.TrackFile(transfer.Destination, TrackedFileType.CopiedOutput, facade.SourceLineNumber); - - tracked.Clean = !transfer.Redundant; - trackedFiles.Add(tracked); } } diff --git a/src/wix/WixToolset.Core/ExtensibilityServices/TrackedFile.cs b/src/wix/WixToolset.Core/ExtensibilityServices/TrackedFile.cs index c9966bce..542410e4 100644 --- a/src/wix/WixToolset.Core/ExtensibilityServices/TrackedFile.cs +++ b/src/wix/WixToolset.Core/ExtensibilityServices/TrackedFile.cs @@ -12,11 +12,8 @@ namespace WixToolset.Core.ExtensibilityServices this.Path = path; this.Type = type; this.SourceLineNumbers = sourceLineNumbers; - this.Clean = (type == TrackedFileType.Intermediate || type == TrackedFileType.BuiltContentOutput || type == TrackedFileType.BuiltTargetOutput || type == TrackedFileType.BuiltPdbOutput || type == TrackedFileType.CopiedOutput); } - public bool Clean { get; set; } - public string Path { get; set; } public SourceLineNumber SourceLineNumbers { get; set; } -- cgit v1.2.3-55-g6feb