arc.unzip - Can not get Progressdialog to show and it takes very long to stop.

jdiperla

Member
Licensed User
Longtime User
I am trying to make it so that when I unzip a file, that it would show a ProgressDialog. But its not showing up when I try it. Also, it seems that when I run the code, all the files are unzipped, but the process is taking a long time to complete and it just freezes my program for a few minutes. Anyway, I can improve this code:

Code: Copy
Try

    m = arc.ListZipEntries(File.DirRootExternal & "file.zip")
    For i = 0 To m.Size - 1
    arc.UnZip(File.DirRootExternal, "file.zip" , File.DirRootExternal & "/file/", "")
    Next
Catch
    Log(LastException.Message)
   Msgbox("There was a problem unzipping the file", "Installation failure")
End Try

Any idea's?
 
You do not need to loop through the files. The following line is sufficient by itself to unzip all the files in the zip file:
Code: Copy
arc.UnZip(File.DirRootExternal, "file.zip" , File.DirRootExternal & "/file/", "")
 
Upvote 0
Awesome! That did the trick. Where can I start up the Progress Show Dialog? It doesn't seem to show up at at all no matter where I put it.
 
Upvote 0
From what I see, this library has also an asynchronous unzipping mechanism, which I find great for big files. Thus, I suppose you can use it, and set the eventName with the '_unzipdone' at its end. This way you can first show the progressdialog (not from inside a service) and hide it inside the arc_zipDone event.
For e.g., following Mahares' code, here's what we can do (un-tested):
Code: Copy
progressdialogshow("extracting")
arc.aSyncUnZip(File.DirRootExternal, "file.zip" , File.DirRootExternal & "/file/", "arc")
sub arc_unzipDone(completedWithoutError as boolean,nbOfFiles as int)
progressdialoghide
if completedWithoutError then
    msgbox("extraction completed successfully","")
else
   msgbox("extraction failed","")
end if
end sub
 
Upvote 0
Thank you so much. It some what works. The good news is that the progress dialog shows up. The bad news is that it wont go away. lol. Any thoughts on how I can get it to go away when the extraction is done?
 
Upvote 0
Back
Top