File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
ModApi.InterimSetup/ModApi.InterimSetup Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -71,20 +71,10 @@ private void UnzipLauncherKit(string path)
7171 {
7272 using ( MemoryStream unmStream = new MemoryStream ( ModApi . InterimSetup . Properties . Resources . ModApiUpdate ) )
7373 {
74- string unm = Environment . ExpandEnvironmentVariables ( @"%appdata%\ModAPITemp.zip" ) ;
75- if ( File . Exists ( unm ) )
76- File . Delete ( unm ) ;
77-
78- using ( var file = File . Create ( unm ) )
79- {
80- unmStream . Seek ( 0 , SeekOrigin . Begin ) ;
81- unmStream . CopyTo ( file ) ;
82- }
83-
84-
85- using ( ZipArchive archive = ZipFile . Open ( unm , ZipArchiveMode . Update ) )
74+ using ( ZipArchive archive = new ZipArchive ( unmStream , ZipArchiveMode . Read ) )
8675 {
87- Dispatcher . BeginInvoke ( new Action ( ( ) => InstallProgressBar . Maximum = archive . Entries . Count ) ) ;
76+ int archiveEntryCount = archive . Entries . Count ;
77+ Dispatcher . BeginInvoke ( new Action ( ( ) => InstallProgressBar . Maximum = archiveEntryCount ) ) ;
8878
8979 foreach ( var s in archive . Entries )
9080 {
You can’t perform that action at this time.
0 commit comments