Hey here is my script:
Private Sub UpdateThread()
Dim AppDir As String = Application.StartupPath()
My.Computer.Network.DownloadFile(MyUpdate.UpdateFetchURL, UpdateClass.WebUpdateZIP, True, True)
MyUpdate.ExtractArchive(UpdateClass.WebUpdateZIP, AppDir)
File.Delete(UpdateClass.WebUpdateZIP)
End Sub
How i call it:
Private Sub FetchUpdateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FetchUpdateButton.Click
FetchUpdateButton.Enabled = False
Dim trd As New Thread(AddressOf UpdateThread)
trd.IsBackground = True
trd.Start()
Do
ProgressBar1.Increment(5)
ProgressBar1.Increment(2)
Loop
End Sub
It does perfectly the UpdateThread task, but program just hangs. That’s it. Thanks.
You’re starting a loop with no condition to ever exit that loop.