From 7b3e22c84f125158e8af5b7bc3ee8b27a4821797 Mon Sep 17 00:00:00 2001 From: HolographicHat Date: Sun, 25 Sep 2022 21:04:18 +0800 Subject: [PATCH] Fix path error --- src/AppConfig.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AppConfig.cs b/src/AppConfig.cs index 683334f..06b7b88 100644 --- a/src/AppConfig.cs +++ b/src/AppConfig.cs @@ -21,11 +21,12 @@ public static class AppConfig { latestLogPath = osLogPath; } else { var cnLastWriteTime = File.GetLastWriteTime(cnLogPath); - var osLastWriteTime = File.GetLastWriteTime(cnLogPath); + var osLastWriteTime = File.GetLastWriteTime(osLogPath); latestLogPath = cnLastWriteTime > osLastWriteTime ? cnLogPath : osLogPath; } var content = File.ReadAllText(latestLogPath); var matchResult = Regex.Match(content, @"(?m).:/.+(GenshinImpact_Data|YuanShen_Data)"); - GamePath = matchResult.Value; + var entryName = $"{matchResult.Groups["1"].Value.Replace("_Data", null)}.exe"; + GamePath = Path.GetFullPath(entryName, $"{matchResult.Value}/../"); } }