mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-19 20:04:46 +02:00
Final commit on fixing the Updater behaviour.
This commit is contained in:
parent
b99ff2d2d5
commit
f0ee07c20f
@ -98,19 +98,33 @@ Public Class MainMenuScreen
|
|||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Async Function WaitForUpdaterAsync() As Task
|
Private Async Function WaitForUpdaterAsync() As Task
|
||||||
Dim updater As New Process()
|
Dim Updater As New Process
|
||||||
updater.StartInfo = New ProcessStartInfo("Updater.exe")
|
Updater.EnableRaisingEvents = True
|
||||||
updater.Start()
|
Updater.StartInfo = New ProcessStartInfo("Updater.exe")
|
||||||
|
Updater.Start()
|
||||||
|
|
||||||
Await Task.Delay(5000)
|
AddHandler Updater.Exited, Sub()
|
||||||
If Not updater.HasExited Then
|
Select Case Updater.ExitCode
|
||||||
updater.Kill()
|
Case 0
|
||||||
End If
|
GameController.UpdateChecked = True
|
||||||
|
Case 1
|
||||||
If updater.ExitCode = 1 Then
|
Core.GameOptions.UpdateDisabled = True
|
||||||
|
Core.GameOptions.SaveOptions()
|
||||||
|
GameController.UpdateChecked = True
|
||||||
|
Case 2
|
||||||
Core.GameInstance.Exit()
|
Core.GameInstance.Exit()
|
||||||
Else
|
Case 3
|
||||||
|
Core.GameOptions.UpdateDisabled = True
|
||||||
|
Core.GameOptions.SaveOptions()
|
||||||
|
Core.GameInstance.Exit()
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Await Task.Delay(20000)
|
||||||
|
If Not Updater.HasExited Then
|
||||||
|
Updater.Kill()
|
||||||
GameController.UpdateChecked = True
|
GameController.UpdateChecked = True
|
||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user