Added error handling when launching external apps
This commit is contained in:
@@ -541,11 +541,15 @@ Public Class frmGameManager
|
|||||||
sFileName = BackupFolder & CurrentBackupItem.FileName
|
sFileName = BackupFolder & CurrentBackupItem.FileName
|
||||||
|
|
||||||
If File.Exists(sFileName) Then
|
If File.Exists(sFileName) Then
|
||||||
|
Try
|
||||||
oProcessStartInfo = New ProcessStartInfo
|
oProcessStartInfo = New ProcessStartInfo
|
||||||
oProcessStartInfo.FileName = sFileName
|
oProcessStartInfo.FileName = sFileName
|
||||||
oProcessStartInfo.UseShellExecute = True
|
oProcessStartInfo.UseShellExecute = True
|
||||||
oProcessStartInfo.Verb = "open"
|
oProcessStartInfo.Verb = "open"
|
||||||
Process.Start(oProcessStartInfo)
|
Process.Start(oProcessStartInfo)
|
||||||
|
Catch ex As Exception
|
||||||
|
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
|
||||||
|
End Try
|
||||||
Else
|
Else
|
||||||
mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation)
|
mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation)
|
||||||
End If
|
End If
|
||||||
@@ -649,11 +653,15 @@ Public Class frmGameManager
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If Directory.Exists(sPath) Then
|
If Directory.Exists(sPath) Then
|
||||||
|
Try
|
||||||
oProcessStartInfo = New ProcessStartInfo
|
oProcessStartInfo = New ProcessStartInfo
|
||||||
oProcessStartInfo.FileName = sPath
|
oProcessStartInfo.FileName = sPath
|
||||||
oProcessStartInfo.UseShellExecute = True
|
oProcessStartInfo.UseShellExecute = True
|
||||||
oProcessStartInfo.Verb = "open"
|
oProcessStartInfo.Verb = "open"
|
||||||
Process.Start(oProcessStartInfo)
|
Process.Start(oProcessStartInfo)
|
||||||
|
Catch ex As Exception
|
||||||
|
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
|
||||||
|
End Try
|
||||||
Else
|
Else
|
||||||
mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation)
|
mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -1011,15 +1011,27 @@ Public Class frmMain
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OpenWebSite()
|
Private Sub OpenWebSite()
|
||||||
|
Try
|
||||||
Process.Start(App_URLWebsite)
|
Process.Start(App_URLWebsite)
|
||||||
|
Catch ex As Exception
|
||||||
|
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OpenOnlineManual()
|
Private Sub OpenOnlineManual()
|
||||||
|
Try
|
||||||
Process.Start(App_URLManual)
|
Process.Start(App_URLManual)
|
||||||
|
Catch ex As Exception
|
||||||
|
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OpenCheckforUpdates()
|
Private Sub OpenCheckforUpdates()
|
||||||
|
Try
|
||||||
Process.Start(App_URLUpdates)
|
Process.Start(App_URLUpdates)
|
||||||
|
Catch ex As Exception
|
||||||
|
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CheckForNewBackups()
|
Private Sub CheckForNewBackups()
|
||||||
|
|||||||
Generated
+9
@@ -96,6 +96,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to An error occured attempting to launch the application:[BR][BR][PARAM].
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property App_ErrorLaunchExternal() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("App_ErrorLaunchExternal", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to This function is currently not available on a Unix based operating system..
|
''' Looks up a localized string similar to This function is currently not available on a Unix based operating system..
|
||||||
'''</summary>
|
'''</summary>
|
||||||
|
|||||||
@@ -2332,4 +2332,7 @@
|
|||||||
<data name="frmWineConfiguration_WarningSingle" xml:space="preserve">
|
<data name="frmWineConfiguration_WarningSingle" xml:space="preserve">
|
||||||
<value>Game Backup Monitor automatically updates the Wine configuration for a game each time it is detected. Modifying any of these fields manually is not recommended in most cases.[BR][BR]This warning will only be displayed once.</value>
|
<value>Game Backup Monitor automatically updates the Wine configuration for a game each time it is detected. Modifying any of these fields manually is not recommended in most cases.[BR][BR]This warning will only be displayed once.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="App_ErrorLaunchExternal" xml:space="preserve">
|
||||||
|
<value>An error occured attempting to launch the application:[BR][BR][PARAM]</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Reference in New Issue
Block a user