Revert "fix:issue #110"

This reverts commit f8e4732dcd.
This commit is contained in:
2025-07-29 02:33:19 +08:00
parent 506ba52502
commit 7182f3554a
3 changed files with 11 additions and 16 deletions
+3 -3
View File
@@ -423,7 +423,7 @@ namespace Ink_Canvas
try try
{ {
string exePath = Process.GetCurrentProcess().MainModule.FileName; string exePath = Process.GetCurrentProcess().MainModule.FileName;
Process.Start(exePath, "-m"); Process.Start(exePath);
} }
catch { } catch { }
Environment.Exit(1); Environment.Exit(1);
@@ -654,7 +654,7 @@ namespace Ink_Canvas
try try
{ {
string exePath = Process.GetCurrentProcess().MainModule.FileName; string exePath = Process.GetCurrentProcess().MainModule.FileName;
Process.Start(exePath, "-m"); Process.Start(exePath);
} }
catch { } catch { }
Environment.Exit(1); Environment.Exit(1);
@@ -714,7 +714,7 @@ namespace Ink_Canvas
Environment.Exit(1); Environment.Exit(1);
} }
string exePath = Process.GetCurrentProcess().MainModule.FileName; string exePath = Process.GetCurrentProcess().MainModule.FileName;
Process.Start(exePath, "-m"); Process.Start(exePath);
} }
// CrashActionType.NoAction 时不重启,直接退出 // CrashActionType.NoAction 时不重启,直接退出
} }
@@ -1654,14 +1654,10 @@ namespace Ink_Canvas {
} }
public void BtnRestart_Click(object sender, RoutedEventArgs e) { public void BtnRestart_Click(object sender, RoutedEventArgs e) {
try {
Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m"); Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m");
App.IsAppExitByUser = true; App.IsAppExitByUser = true;
CloseIsFromButton = true; CloseIsFromButton = true;
Application.Current.Shutdown(); Application.Current.Shutdown();
} catch (Exception ex) {
LogHelper.NewLog($"重启程序时出错: {ex.Message}");
}
} }
private void SettingsOverlayClick(object sender, MouseButtonEventArgs e) { private void SettingsOverlayClick(object sender, MouseButtonEventArgs e) {
+1 -2
View File
@@ -64,11 +64,10 @@ namespace Ink_Canvas
IsAppExitByUser = true; IsAppExitByUser = true;
try { try {
// 启动新实例,添加 -m 参数允许多实例启动 // 启动新实例
string exePath = Process.GetCurrentProcess().MainModule.FileName; string exePath = Process.GetCurrentProcess().MainModule.FileName;
ProcessStartInfo startInfo = new ProcessStartInfo(); ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = exePath; startInfo.FileName = exePath;
startInfo.Arguments = "-m";
startInfo.UseShellExecute = true; startInfo.UseShellExecute = true;
// 启动进程但不等待 // 启动进程但不等待