add export

This commit is contained in:
HolographicHat
2022-08-21 12:06:50 +08:00
parent 2f1a5ad99e
commit 4c2cb28313
5 changed files with 45 additions and 20 deletions

View File

@@ -168,7 +168,7 @@ public static class Utils {
public static void CheckGenshinIsRunning() {
Process.EnterDebugMode();
foreach (var process in Process.GetProcesses()) {
if (process.ProcessName is "GenshinImpact" or "YuanShen") {
if (process.ProcessName is "GenshinImpact" or "YuanShen" && !process.HasExited) {
Console.WriteLine($"原神正在运行,请关闭后重试 ({process.Id})");
Environment.Exit(301);
}