aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2018-08-11 01:06:40 -0700
committerRob Mensching <rob@firegiant.com>2018-08-11 01:06:40 -0700
commit2a27f9032aa115bc2f88d9be695d9b049db1a894 (patch)
tree7882bd4c94da118a6fc655a3c22e1dd0cf3b60e1 /src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
parentb54516035b4ebbfbd8899b26de501bfa13f53e8b (diff)
downloadwix-2a27f9032aa115bc2f88d9be695d9b049db1a894.tar.gz
wix-2a27f9032aa115bc2f88d9be695d9b049db1a894.tar.bz2
wix-2a27f9032aa115bc2f88d9be695d9b049db1a894.zip
Track files to enable clean builds in MSBuild
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
index b09f92bb..3ad74fd1 100644
--- a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
+++ b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs
@@ -43,10 +43,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind
43 43
44 public IEnumerable<IFileTransfer> FileTransfers { get; private set; } 44 public IEnumerable<IFileTransfer> FileTransfers { get; private set; }
45 45
46 public IEnumerable<ITrackedFile> TrackedFiles { get; private set; }
47
46 public void Execute() 48 public void Execute()
47 { 49 {
48 var fileTransfers = new List<IFileTransfer>(); 50 var fileTransfers = new List<IFileTransfer>();
49 51
52 var trackedFiles = new List<ITrackedFile>();
53
50 var directories = new Dictionary<string, ResolvedDirectory>(); 54 var directories = new Dictionary<string, ResolvedDirectory>();
51 55
52 var mediaRows = this.Section.Tuples.OfType<MediaTuple>().ToDictionary(t => t.DiskId); 56 var mediaRows = this.Section.Tuples.OfType<MediaTuple>().ToDictionary(t => t.DiskId);
@@ -108,14 +112,26 @@ namespace WixToolset.Core.WindowsInstaller.Bind
108 112
109 // finally put together the base media layout path and the relative file layout path 113 // finally put together the base media layout path and the relative file layout path
110 var fileLayoutPath = Path.Combine(mediaLayoutDirectory, relativeFileLayoutPath); 114 var fileLayoutPath = Path.Combine(mediaLayoutDirectory, relativeFileLayoutPath);
111 var transfer = this.BackendHelper.CreateFileTransfer(facade.WixFile.Source.Path, fileLayoutPath, false, FileTransferType.Content, facade.File.SourceLineNumbers); 115
116 var transfer = this.BackendHelper.CreateFileTransfer(facade.WixFile.Source.Path, fileLayoutPath, false, facade.File.SourceLineNumbers);
112 fileTransfers.Add(transfer); 117 fileTransfers.Add(transfer);
118
119 // Track the location where the cabinet will be placed. If the transfer is
120 // redundant then then the file should not be cleaned. This is important
121 // because if the source and destination of the transfer is the same, we
122 // don't want to clean the file because we'd be deleting the original
123 // (and that would be bad).
124 var tracked = this.BackendHelper.TrackFile(transfer.Destination, TrackedFileType.Final, facade.File.SourceLineNumbers);
125 tracked.Clean = !transfer.Redundant;
126
127 trackedFiles.Add(tracked);
113 } 128 }
114 } 129 }
115 } 130 }
116 } 131 }
117 132
118 this.FileTransfers = fileTransfers; 133 this.FileTransfers = fileTransfers;
134 this.TrackedFiles = trackedFiles;
119 } 135 }
120 } 136 }
121} 137}