Skip to content

Commit 2579eb5

Browse files
committed
ModApi.Updater: use zip from MemoryStream instead of extracting
1 parent 3561dbd commit 2579eb5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

Updater/ModApi.Updater/MainWindow.xaml.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,7 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e)
4040
{
4141
using (MemoryStream unmStream = new MemoryStream(ModApi.Updater.Properties.Resources.ModApiUpdate))
4242
{
43-
string unm = Environment.ExpandEnvironmentVariables(@"%appdata%\ModAPITemp.zip");
44-
if (File.Exists(unm))
45-
File.Delete(unm);
46-
47-
using (var file = File.Create(unm))
48-
{
49-
unmStream.Seek(0, SeekOrigin.Begin);
50-
unmStream.CopyTo(file);
51-
}
52-
53-
using (ZipArchive archive = ZipFile.Open(unm, ZipArchiveMode.Update))
43+
using (ZipArchive archive = new ZipArchive(unmStream, ZipArchiveMode.Read))
5444
{
5545
InstallProgressBar.Maximum = archive.Entries.Count;
5646

0 commit comments

Comments
 (0)