I am creating an installer/updater for the mods on my Minecraft server. I have it set it up so that there are two files, one mod per line, and the code compares the two and downloads the latest mod if they don't match. Currently I have the downloads setup like this:
For x = 2 To latestModCount - 1
If currentModList(x) <> latestModList(x) Then
IO.File.Delete(applicationLocation & "multimc\instances\Dan's Server\minecraft\mods\" & currentModList(x))
My.Computer.Network.DownloadFile(OnlineFiles & "mods/" & latestModList(x), _
applicationLocation & "multimc\instances\Dan's Server\minecraft\mods\" & latestModList(x))
End If
'Updates currentModList to = latestModList
objWriter.Write(latestModList(x))
Next
With this method the form completely freezes while the files are downloading.
What I want is to have a progress bar move along as each one downloads, resetting to zero each time a new one is complete. I know that using this method I can get one file to download and the progress bar will move along nicely. The problem with this though, is that because it uses an asynchronous download, any code below the above code is executed before the downloads have finished, which becomes a problem when trying to unzip a zip file that doesn't exist.
If someone has a solution, please provide code examples as I this is actually my first program in any language, other than tutorial ones.