How can I show progress of ExtractAll in Windows application

Aug 20, 2008 at 9:01 AM
Hello,
I have used this little gem in my windows application and it works really well. I can create a zip file and use the SaveProgress event to show a progressbar to the user. This works great, and I was expectiing something the same for the extract method, but there is only the StatusMessageTextWriter. How can I show a progress bar for the extract or at least which file is extracted in a label control?
Coordinator
Aug 20, 2008 at 4:21 PM

Ahh, a hole in the function of the library.  I'd need to add the progress event to the ExtractAll method.

Shouldn't be too hard to do.

Coordinator
Aug 21, 2008 at 7:37 AM

I added this; it is in the current v1.6 preview release.

 

Aug 21, 2008 at 8:46 AM
Wow! Thanks..I'm impressed!
Coordinator
Aug 21, 2008 at 1:56 PM
did it work?
Aug 21, 2008 at 10:33 PM
Yes, it works! Unfortunately I am working with password protected zip files and the extractall method, as far as I know, does not support a password. So I now loop through the EntryFileNames, retrieve the zipentry and do an extractwithpassword.
Coordinator
Aug 23, 2008 at 4:59 PM

Hmmm, that's no good. Seems like another hole in the library.
I am fixing this now.

It seems to me that it would be intuitive if the Library behaved this way: if you set the password on the ZipFile instance, then subsequently call ExtractAll(), the extraction should use the supplied password for all entries.  The same thing should happen for subsequent Extract() calls on the ZipFile itself. 

For example...

  using (ZipFile z1 = new ZipFile(ZipToExtract))
  {
      z1.Password = "Albatr0s";
      z1.ExtractProgress = ExtractProgress;
      z1.ExtractAll(); 
  }

I am testing this out right now.

Coordinator
Aug 23, 2008 at 9:24 PM

Ok, this change - ExtractAll() and Extract() methods on ZipFile implicitly use the Password set on the ZipFile - is now added to the library, as of change set 22534.

In a few minutes it will be available in the v1.6 preview release.

This change will also be in the v1.6 final release.

 

Aug 24, 2008 at 7:43 PM
Excellent! This works very intuitive. Sharpziplib eat your heart out ;-) Thank you Cheeso.