Added error handling when launching external apps

This commit is contained in:
Michael J. Seiferling
2019-02-27 18:37:12 -06:00
parent dec4c3d0b8
commit b7eaec2dca
4 changed files with 45 additions and 13 deletions
+18 -10
View File
@@ -541,11 +541,15 @@ Public Class frmGameManager
sFileName = BackupFolder & CurrentBackupItem.FileName
If File.Exists(sFileName) Then
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sFileName
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Try
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sFileName
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
Else
mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation)
End If
@@ -649,11 +653,15 @@ Public Class frmGameManager
End If
If Directory.Exists(sPath) Then
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sPath
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Try
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sPath
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
Else
mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation)
End If
+15 -3
View File
@@ -1011,15 +1011,27 @@ Public Class frmMain
End Sub
Private Sub OpenWebSite()
Process.Start(App_URLWebsite)
Try
Process.Start(App_URLWebsite)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
End Sub
Private Sub OpenOnlineManual()
Process.Start(App_URLManual)
Try
Process.Start(App_URLManual)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
End Sub
Private Sub OpenCheckforUpdates()
Process.Start(App_URLUpdates)
Try
Process.Start(App_URLUpdates)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
End Sub
Private Sub CheckForNewBackups()