diff options
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 | } |
