fix(ShellOnly):只为可能出错的部分弹出提示
This commit is contained in:
@@ -2333,14 +2333,11 @@ NextElement:
|
|||||||
Public Sub ShellOnly(FileName As String, Optional Arguments As String = "")
|
Public Sub ShellOnly(FileName As String, Optional Arguments As String = "")
|
||||||
FileName = ShortenPath(FileName)
|
FileName = ShortenPath(FileName)
|
||||||
Using Program As New Process
|
Using Program As New Process
|
||||||
Try
|
|
||||||
Program.StartInfo.Arguments = Arguments
|
Program.StartInfo.Arguments = Arguments
|
||||||
Program.StartInfo.FileName = FileName
|
Program.StartInfo.FileName = FileName
|
||||||
Log("[System] 执行外部命令:" & FileName & " " & Arguments)
|
Log("[System] 执行外部命令:" & FileName & " " & Arguments)
|
||||||
Program.Start()
|
Program.Start()
|
||||||
Catch ex As Exception
|
|
||||||
Log(ex, "执行外部命令失败", LogLevel.Msgbox)
|
|
||||||
End Try
|
|
||||||
End Using
|
End Using
|
||||||
End Sub
|
End Sub
|
||||||
''' <summary>
|
''' <summary>
|
||||||
|
|||||||
@@ -857,6 +857,7 @@ NextStack:
|
|||||||
"确定", If(IsHandAnalyze OrElse DirectFile Is Nothing, "", "查看日志"), If(IsHandAnalyze, "", "导出错误报告"),
|
"确定", If(IsHandAnalyze OrElse DirectFile Is Nothing, "", "查看日志"), If(IsHandAnalyze, "", "导出错误报告"),
|
||||||
Button2Action:=If(IsHandAnalyze OrElse DirectFile Is Nothing, Nothing,
|
Button2Action:=If(IsHandAnalyze OrElse DirectFile Is Nothing, Nothing,
|
||||||
Sub()
|
Sub()
|
||||||
|
Try
|
||||||
'弹窗选择:查看日志
|
'弹窗选择:查看日志
|
||||||
If File.Exists(DirectFile.Value.Key) Then
|
If File.Exists(DirectFile.Value.Key) Then
|
||||||
ShellOnly(DirectFile.Value.Key)
|
ShellOnly(DirectFile.Value.Key)
|
||||||
@@ -865,6 +866,9 @@ NextStack:
|
|||||||
WriteFile(FilePath, Join(DirectFile.Value.Value, vbCrLf))
|
WriteFile(FilePath, Join(DirectFile.Value.Value, vbCrLf))
|
||||||
ShellOnly(FilePath)
|
ShellOnly(FilePath)
|
||||||
End If
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
Log(ex,"尝试打开文件失败",LogLevel.Hint)
|
||||||
|
End Try
|
||||||
End Sub))
|
End Sub))
|
||||||
Case 3
|
Case 3
|
||||||
'弹窗选择:导出错误报告
|
'弹窗选择:导出错误报告
|
||||||
|
|||||||
@@ -828,7 +828,13 @@ Retry:
|
|||||||
Log("[Modpack] 找到压缩包中附带的启动器:" & Launcher)
|
Log("[Modpack] 找到压缩包中附带的启动器:" & Launcher)
|
||||||
If MyMsgBox($"整合包里似乎自带了启动器,是否换用它继续安装?{vbCrLf}即将打开:{Launcher}", "换用整合包启动器?", "换用", "不换用") = 1 Then
|
If MyMsgBox($"整合包里似乎自带了启动器,是否换用它继续安装?{vbCrLf}即将打开:{Launcher}", "换用整合包启动器?", "换用", "不换用") = 1 Then
|
||||||
OpenExplorer(TargetFolder)
|
OpenExplorer(TargetFolder)
|
||||||
|
Try
|
||||||
ShellOnly(Launcher, "--wait") '要求等待已有的 PCL 退出
|
ShellOnly(Launcher, "--wait") '要求等待已有的 PCL 退出
|
||||||
|
Catch ex As Exception
|
||||||
|
Log(ex,"打开文件失败",LogLevel.MsgBox)
|
||||||
|
Finally
|
||||||
|
Return
|
||||||
|
End Try
|
||||||
Log("[Modpack] 为换用整合包中的启动器启动,强制结束程序")
|
Log("[Modpack] 为换用整合包中的启动器启动,强制结束程序")
|
||||||
FrmMain.EndProgram(False)
|
FrmMain.EndProgram(False)
|
||||||
Return
|
Return
|
||||||
|
|||||||
Reference in New Issue
Block a user