mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-25 23:05:24 +02:00
Update will have it's own timeout check for safety reasons
This commit is contained in:
parent
5c03804407
commit
17c9a37a4d
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user