Imports System.Net
Imports System.IO
Imports System.Threading
Private WithEvents _Downloader As WebFileDownloader
Public Sub Update()
Dim prodVersion As String = System.Text.Encoding.ASCII.GetString((webclient.DownloadData("https://www.arenagamerz.com/downloads/launcher/versionNumber.txt")))
Dim updatelink As String = "https://www.arenagamerz.com/downloads/launcher/arenagamerzLauncher.exe"
Dim UpdateLocation As String = My.Computer.FileSystem.CurrentDirectory
'Updater
If Me.ProductVersion() = prodVersion Then
Else
MsgBox("New Update available. Downloading")
Try
Try
_Downloader = New WebFileDownloader
_Downloader.DownloadFileWithProgress(updatelink, UpdateLocation & GetFileNameFromURL(updatelink))
Catch ex As Exception
MessageBox.Show("Error: " & ex.Message)
End Try
Catch ex As Exception
End Try
End If
End Sub
Private Function GetFileNameFromURL(ByVal URL As String) As String
If URL.IndexOf("/"c) = -1 Then Return String.Empty
Return "\" & URL.Substring(URL.LastIndexOf("/"c) + 1)
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Start a new thread for the update Sub
Dim updateApp As Thread
updateApp = New Thread(AddressOf Me.Update)
updateApp.Start()
Copyright © 2024, NextGenUpdate.
All Rights Reserved.