diff options
| author | Bob Arnson <bob@firegiant.com> | 2020-05-21 18:42:42 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2020-05-21 18:44:17 -0400 |
| commit | e25b29f5ded38e281f3a686bc5ce7cbe1d872d3b (patch) | |
| tree | a1300301c786613eaec20b4dbb477cb84c70190b /src/WixToolset.Data | |
| parent | c3c1d46cd8d833bc7d59ee52a5daf6210679ac05 (diff) | |
| download | wix-e25b29f5ded38e281f3a686bc5ce7cbe1d872d3b.tar.gz wix-e25b29f5ded38e281f3a686bc5ce7cbe1d872d3b.tar.bz2 wix-e25b29f5ded38e281f3a686bc5ce7cbe1d872d3b.zip | |
Handle updating entries in a WixOutput.
Diffstat (limited to 'src/WixToolset.Data')
| -rw-r--r-- | src/WixToolset.Data/WixOutput.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/WixToolset.Data/WixOutput.cs b/src/WixToolset.Data/WixOutput.cs index 27e7827a..bb546821 100644 --- a/src/WixToolset.Data/WixOutput.cs +++ b/src/WixToolset.Data/WixOutput.cs | |||
| @@ -183,6 +183,8 @@ namespace WixToolset.Data | |||
| 183 | /// <returns>Stream to the data of the file.</returns> | 183 | /// <returns>Stream to the data of the file.</returns> |
| 184 | public Stream CreateDataStream(string name) | 184 | public Stream CreateDataStream(string name) |
| 185 | { | 185 | { |
| 186 | this.DeleteExistingEntry(name); | ||
| 187 | |||
| 186 | var entry = this.archive.CreateEntry(name); | 188 | var entry = this.archive.CreateEntry(name); |
| 187 | 189 | ||
| 188 | return entry.Open(); | 190 | return entry.Open(); |
| @@ -195,6 +197,8 @@ namespace WixToolset.Data | |||
| 195 | /// <param name="path">Path to file on disk to include in the output.</param> | 197 | /// <param name="path">Path to file on disk to include in the output.</param> |
| 196 | public void ImportDataStream(string name, string path) | 198 | public void ImportDataStream(string name, string path) |
| 197 | { | 199 | { |
| 200 | this.DeleteExistingEntry(name); | ||
| 201 | |||
| 198 | this.archive.CreateEntryFromFile(path, name, System.IO.Compression.CompressionLevel.Optimal); | 202 | this.archive.CreateEntryFromFile(path, name, System.IO.Compression.CompressionLevel.Optimal); |
| 199 | } | 203 | } |
| 200 | 204 | ||
| @@ -256,5 +260,14 @@ namespace WixToolset.Data | |||
| 256 | 260 | ||
| 257 | this.disposed = true; | 261 | this.disposed = true; |
| 258 | } | 262 | } |
| 263 | |||
| 264 | private void DeleteExistingEntry(string name) | ||
| 265 | { | ||
| 266 | var entry = this.archive.GetEntry(name); | ||
| 267 | if (entry != null) | ||
| 268 | { | ||
| 269 | entry.Delete(); | ||
| 270 | } | ||
| 271 | } | ||
| 259 | } | 272 | } |
| 260 | } | 273 | } |
