diff --git a/VMM/VMM.vbproj b/VMM/VMM.vbproj
index 62d9b8e..1c4e6bd 100644
--- a/VMM/VMM.vbproj
+++ b/VMM/VMM.vbproj
@@ -213,6 +213,7 @@
Form
+
diff --git a/VMM/forms/About.Designer.vb b/VMM/forms/About.Designer.vb
index 83e77b3..a4d4af6 100644
--- a/VMM/forms/About.Designer.vb
+++ b/VMM/forms/About.Designer.vb
@@ -29,6 +29,8 @@ Partial Class About
Me.lbl_version = New System.Windows.Forms.Label()
Me.lbl_made_by = New System.Windows.Forms.Label()
Me.pb_image = New System.Windows.Forms.PictureBox()
+ Me.lbl_update = New System.Windows.Forms.Label()
+ Me.btn_update = New System.Windows.Forms.Button()
CType(Me.pb_image, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
@@ -71,11 +73,37 @@ Partial Class About
Me.pb_image.TabIndex = 0
Me.pb_image.TabStop = False
'
+ 'lbl_update
+ '
+ Me.lbl_update.AutoSize = True
+ Me.lbl_update.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
+ Me.lbl_update.Location = New System.Drawing.Point(230, 110)
+ Me.lbl_update.Name = "lbl_update"
+ Me.lbl_update.Size = New System.Drawing.Size(156, 18)
+ Me.lbl_update.TabIndex = 4
+ Me.lbl_update.Text = "New Version available."
+ Me.lbl_update.Visible = False
+ '
+ 'btn_update
+ '
+ Me.btn_update.Image = Global.VMM.My.Resources.Resources.launch_24
+ Me.btn_update.ImageAlign = System.Drawing.ContentAlignment.MiddleRight
+ Me.btn_update.Location = New System.Drawing.Point(233, 131)
+ Me.btn_update.Name = "btn_update"
+ Me.btn_update.Size = New System.Drawing.Size(98, 30)
+ Me.btn_update.TabIndex = 5
+ Me.btn_update.Text = "Update"
+ Me.btn_update.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
+ Me.btn_update.UseVisualStyleBackColor = True
+ Me.btn_update.Visible = False
+ '
'About
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(572, 250)
+ Me.Controls.Add(Me.btn_update)
+ Me.Controls.Add(Me.lbl_update)
Me.Controls.Add(Me.lbl_made_by)
Me.Controls.Add(Me.lbl_version)
Me.Controls.Add(Me.lbl_name)
@@ -97,4 +125,6 @@ Partial Class About
Friend WithEvents lbl_name As Label
Friend WithEvents lbl_version As Label
Friend WithEvents lbl_made_by As Label
+ Friend WithEvents lbl_update As Label
+ Friend WithEvents btn_update As Button
End Class
diff --git a/VMM/forms/About.vb b/VMM/forms/About.vb
index 660cdbe..13bfada 100644
--- a/VMM/forms/About.vb
+++ b/VMM/forms/About.vb
@@ -1,7 +1,22 @@
-Public Class About
+Imports VMM
+
+Public Class About
+
+ Private WithEvents _update_check As New ModManagerUpdateCheck
+
+ Private Sub _update_check_UpdateAvailable(File As ModuleModBrowser.file_info) Handles _update_check.UpdateAvailable
+ lbl_update.Visible = True
+ lbl_update.Text = String.Format("Update {0} is available.", File.Version)
+ btn_update.Visible = True
+ End Sub
Private Sub About_Load(sender As Object, e As EventArgs) Handles MyBase.Load
lbl_version.Text = Version.Current
End Sub
+ Private Sub About_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
+ lbl_update.Visible = False
+ btn_update.Visible = False
+ _update_check.CheckForUpdate()
+ End Sub
End Class
\ No newline at end of file
diff --git a/VMM/function/Objects/ModManagerUpdateCheck.vb b/VMM/function/Objects/ModManagerUpdateCheck.vb
new file mode 100644
index 0000000..c3dede1
--- /dev/null
+++ b/VMM/function/Objects/ModManagerUpdateCheck.vb
@@ -0,0 +1,35 @@
+Imports System.ComponentModel
+Imports System.Net
+Imports Newtonsoft.Json
+
+Public Class ModManagerUpdateCheck
+
+ Private WithEvents _check_update As New BackgroundWorker
+
+ Public Event UpdateAvailable(File As ModuleModBrowser.file_info)
+
+ Public Sub CheckForUpdate()
+ If Not _check_update.IsBusy Then _check_update.RunWorkerAsync()
+ End Sub
+
+ Private Sub _check_update_RunWorkerCompleted(sender As Object, e As RunWorkerCompletedEventArgs) Handles _check_update.RunWorkerCompleted
+ Dim file As ModuleModBrowser.file_info = e.Result
+ RaiseEvent UpdateAvailable(file)
+ End Sub
+
+ Private Sub _check_update_DoWork(sender As Object, e As DoWorkEventArgs) Handles _check_update.DoWork
+ Try
+ Dim client As New WebClient
+ Dim json As String = client.DownloadString("http://www.vmf.heliohost.org/file_list.php?mode=manager")
+ Dim files As List(Of ModuleModBrowser.file_info) = JsonConvert.DeserializeObject(Of List(Of ModuleModBrowser.file_info))(json)
+ Dim file As ModuleModBrowser.file_info = files(files.Count - 1)
+ If Compare(file.Version, Current) Then
+ Debug.Print("New version available.")
+ e.Result = file
+ End If
+ Catch ex As Exception
+ Debug.Print(ex.Message)
+ End Try
+ End Sub
+
+End Class