Update will have it's own timeout check for safety reasons

This commit is contained in:
Aragas 2017-02-16 18:05:54 +03:00
parent 5c03804407
commit 17c9a37a4d

View File

@ -92,23 +92,28 @@ Public Class MainMenuScreen
Logger.Debug("---Check Version---") Logger.Debug("---Check Version---")
If Not Core.GameOptions.UpdateDisabled AndAlso My.Computer.Network.IsAvailable Then If Not Core.GameOptions.UpdateDisabled AndAlso My.Computer.Network.IsAvailable Then
Task.Factory.StartNew(Sub() WaitForUpdaterAsync()
Dim Updater As New Process()
Updater.StartInfo = New ProcessStartInfo("Updater.exe")
Updater.Start()
Updater.WaitForExit()
If Updater.ExitCode = 1 Then
Core.GameInstance.Exit()
Else
GameController.UpdateChecked = True
End If
End Sub)
End If End If
End If End If
Catch ex As Exception Catch ex As Exception
End Try End Try
End Sub End Sub
Private Async Function WaitForUpdaterAsync() As Task
Dim updater As New Process()
updater.StartInfo = New ProcessStartInfo("Updater.exe")
updater.Start()
Await Task.Delay(5000)
If Not updater.HasExited Then
updater.Kill()
End If
If updater.ExitCode = 1 Then
Core.GameInstance.Exit()
Else
GameController.UpdateChecked = True
End If
End Function
Private Sub GetPacks(Optional ByVal reload As Boolean = False) Private Sub GetPacks(Optional ByVal reload As Boolean = False)
PackNames.Clear() PackNames.Clear()