Fix path error

This commit is contained in:
HolographicHat
2022-09-25 21:04:18 +08:00
parent faa583587a
commit 7b3e22c84f

View File

@@ -21,11 +21,12 @@ public static class AppConfig {
latestLogPath = osLogPath; latestLogPath = osLogPath;
} else { } else {
var cnLastWriteTime = File.GetLastWriteTime(cnLogPath); var cnLastWriteTime = File.GetLastWriteTime(cnLogPath);
var osLastWriteTime = File.GetLastWriteTime(cnLogPath); var osLastWriteTime = File.GetLastWriteTime(osLogPath);
latestLogPath = cnLastWriteTime > osLastWriteTime ? cnLogPath : osLogPath; latestLogPath = cnLastWriteTime > osLastWriteTime ? cnLogPath : osLogPath;
} }
var content = File.ReadAllText(latestLogPath); var content = File.ReadAllText(latestLogPath);
var matchResult = Regex.Match(content, @"(?m).:/.+(GenshinImpact_Data|YuanShen_Data)"); 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}/../");
} }
} }