Update the updater check codes.

This commit is contained in:
jianmingyong 2017-02-15 22:02:27 +08:00
parent ad222e642d
commit 30ede3956c
2 changed files with 16 additions and 9 deletions

View File

@ -1,5 +1,6 @@
Imports System.Net
Imports System.Net.Cache
Imports System.Threading.Tasks
Public Class MainMenuScreen
@ -82,20 +83,26 @@ Public Class MainMenuScreen
GameJolt.Emblem.ClearOnlineSpriteCache()
Screen.Level.World.Initialize(Screen.Level.EnvironmentType, Screen.Level.WeatherType)
UpdateCheck()
End Sub
Private Sub UpdateCheck()
Try
If Not GameController.UpdateChecked Then
Logger.Debug("---Check Version---")
Dim Updater As New Process()
Updater.StartInfo = New ProcessStartInfo("Updater.exe")
Updater.Start()
Updater.WaitForExit()
Task.Factory.StartNew(Sub()
Dim Updater As New Process()
Updater.StartInfo = New ProcessStartInfo("Updater.exe")
Updater.Start()
Updater.WaitForExit()
If Updater.ExitCode = 1 Then
Environment.Exit(0)
Else
GameController.UpdateChecked = True
End If
If Updater.ExitCode = 1 Then
Core.GameInstance.Exit()
Else
GameController.UpdateChecked = True
End If
End Sub)
End If
Catch ex As Exception
End Try

Binary file not shown.