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