From 3fb35051d1f83ee84c0f57e340854dc2e813b3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89=E9=B8=AD=E8=9B=8B?= Date: Sun, 5 Jan 2025 22:07:39 +0800 Subject: [PATCH 1/3] update UnityLogGameLocator --- .../Genshin/Paths/UnityLogGameLocator.cs | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/BetterGenshinImpact/Genshin/Paths/UnityLogGameLocator.cs b/BetterGenshinImpact/Genshin/Paths/UnityLogGameLocator.cs index 55939921..c8ba86c0 100644 --- a/BetterGenshinImpact/Genshin/Paths/UnityLogGameLocator.cs +++ b/BetterGenshinImpact/Genshin/Paths/UnityLogGameLocator.cs @@ -12,7 +12,7 @@ namespace BetterGenshinImpact.Genshin.Paths; /// public partial class UnityLogGameLocator { - [GeneratedRegex(@".:/.+(?:GenshinImpact|YuanShen)(?=_Data)", RegexOptions.IgnoreCase)] + [GeneratedRegex(@".:(?:\\|/).+(?:GenshinImpact|YuanShen)(?=_Data)", RegexOptions.IgnoreCase)] private static partial Regex WarmupFileLine(); public static async ValueTask LocateSingleGamePathAsync() @@ -23,28 +23,19 @@ public partial class UnityLogGameLocator string logFilePathOversea = Path.Combine(appDataPath, @"..\LocalLow\miHoYo\Genshin Impact\output_log.txt"); string logFilePathChinese = Path.Combine(appDataPath, @"..\LocalLow\miHoYo\鍘熺\output_log.txt"); - if (File.Exists(logFilePathChinese)) + var p1 = await LocateGamePathAsync(logFilePathChinese).ConfigureAwait(false); + if (p1 is not null) { - var p1 = await LocateGamePathAsync(logFilePathChinese).ConfigureAwait(false); - if (p1 is not null && File.Exists(p1)) - { - return p1; - } - } - - if (File.Exists(logFilePathOversea)) - { - var p2 = await LocateGamePathAsync(logFilePathOversea).ConfigureAwait(false); - if (p2 is not null && File.Exists(p2)) - { - return p2; - } + return p1; } + + return await LocateGamePathAsync(logFilePathOversea).ConfigureAwait(false); } catch (Exception e) { TaskControl.Logger.LogDebug(e, "Failed to locate game path."); } + return null; } @@ -73,8 +64,12 @@ public partial class UnityLogGameLocator return null; } - string entryName = $"{matchResult.Value}.exe"; - string fullPath = Path.GetFullPath(Path.Combine(matchResult.Value, "..", entryName)); + string fullPath = Path.GetFullPath($"{matchResult.Value}.exe"); + if (!File.Exists(fullPath)) + { + return null; + } + return fullPath; } } \ No newline at end of file From 48b51a60e187cedc25a5f6131b8fda79ccdec9a5 Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Tue, 7 Jan 2025 11:49:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(Setup):=20=E4=BF=AE=E5=A4=8DBGI?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=8C=85=E5=A4=9A=E4=B8=80=E5=B1=82=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Build/MicaSetup/Program.cs | 4 ++-- Build/MicaSetup/Program.un.cs | 4 ++-- Build/setup_build.cmd | 6 +++--- Build/setup_build_for_appveyor.cmd | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Build/MicaSetup/Program.cs b/Build/MicaSetup/Program.cs index c33fb21c..af39a022 100644 --- a/Build/MicaSetup/Program.cs +++ b/Build/MicaSetup/Program.cs @@ -47,10 +47,10 @@ internal class Program option.IsInstallCertificate = false; option.OverlayInstallRemoveExt = "exe,dll,pdb"; option.UnpackingPassword = null!; - option.ExeName = @"BetterGI\BetterGI.exe"; + option.ExeName = @"BetterGI.exe"; option.KeyName = "BetterGI"; option.DisplayName = "BetterGI"; - option.DisplayIcon = @"BetterGI\BetterGI.exe"; + option.DisplayIcon = @"BetterGI.exe"; option.DisplayVersion = "0.0.0.0"; option.Publisher = "babalae"; option.AppName = "BetterGI"; diff --git a/Build/MicaSetup/Program.un.cs b/Build/MicaSetup/Program.un.cs index abeed41f..00422e38 100644 --- a/Build/MicaSetup/Program.un.cs +++ b/Build/MicaSetup/Program.un.cs @@ -41,10 +41,10 @@ internal class Program option.IsAllowFirewall = true; option.IsRefreshExplorer = true; option.IsInstallCertificate = false; - option.ExeName = @"BetterGI\BetterGI.exe"; + option.ExeName = @"BetterGI.exe"; option.KeyName = "BetterGI"; option.DisplayName = "BetterGI"; - option.DisplayIcon = @"BetterGI\BetterGI.exe"; + option.DisplayIcon = @"BetterGI.exe"; option.DisplayVersion = "0.0.0.0"; option.Publisher = "babalae"; option.AppName = "BetterGI"; diff --git a/Build/setup_build.cmd b/Build/setup_build.cmd index 9788ed9e..5bd8871f 100644 --- a/Build/setup_build.cmd +++ b/Build/setup_build.cmd @@ -30,13 +30,13 @@ cd /d %~dp0 del /f /q %tmpfolder%\*.lib del /f /q %tmpfolder%\*ffmpeg*.dll -:: 添加一些配置文件开始(大文件不适合放在Github) +:: 娣诲姞涓浜涢厤缃枃浠跺紑濮嬶紙澶ф枃浠朵笉閫傚悎鏀惧湪Github锛 if exist "E:\HuiTask\BetterGIBuild\BetterGI" ( xcopy "E:\HuiTask\BetterGIBuild\BetterGI\*" "%tmpfolder%" /E /C /I /Y ) -:: 添加一些配置文件结束 +:: 娣诲姞涓浜涢厤缃枃浠剁粨鏉 -MicaSetup.Tools\7-Zip\7z a publish.7z %tmpfolder%\ -t7z -mx=5 -mf=BCJ2 -r -y +MicaSetup.Tools\7-Zip\7z a publish.7z %tmpfolder%\* -t7z -mx=5 -mf=BCJ2 -r -y copy /y publish.7z .\MicaSetup\Resources\Setups\publish.7z if exist "%zipFile%" ( del /f /q "%zipfile%" ) rename publish.7z %archiveFile% diff --git a/Build/setup_build_for_appveyor.cmd b/Build/setup_build_for_appveyor.cmd index b0f8e36e..9170c40f 100644 --- a/Build/setup_build_for_appveyor.cmd +++ b/Build/setup_build_for_appveyor.cmd @@ -29,7 +29,7 @@ xcopy * "%tmpfolder%" /E /C /I /Y cd /d %~dp0 del /f /q %tmpfolder%\*.lib del /f /q %tmpfolder%\*ffmpeg*.dll -MicaSetup.Tools\7-Zip\7z a publish.7z %tmpfolder%\ -t7z -mx=5 -mf=BCJ2 -r -y +MicaSetup.Tools\7-Zip\7z a publish.7z %tmpfolder%\* -t7z -mx=5 -mf=BCJ2 -r -y copy /y publish.7z .\MicaSetup\Resources\Setups\publish.7z if exist "%zipFile%" ( del /f /q "%zipfile%" ) rename publish.7z %archiveFile% From 887e812b283645a06ec0354cc6d1b3e3114612c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=AA=E7=B1=BD=E9=98=B3=E5=A4=96=E5=A9=86?= <2915414902@qq.com> Date: Tue, 7 Jan 2025 14:57:05 +0800 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d70a8ab..45254fb9 100644 --- a/README.md +++ b/README.md @@ -107,4 +107,4 @@ BetterGI 路 鏇村ソ鐨勫師绁烇紝 涓涓熀浜庤绠楁満瑙嗚鎶鏈紝鎰忓浘璁╁師 ## 闂鍙嶉 -鎻 [Issue](https://github.com/babalae/better-genshin-impact/issues) 鎴 QQ缇783846140](https://qm.qq.com/q/lVzxCCKEko) +鎻 [Issue](https://github.com/babalae/better-genshin-impact/issues) 鎴 QQ缇960900268](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=faj5hQWJwrWtl9PG8sSAlN2jlQMQfoU1&authKey=QXFi8LYERO4j8TBnO%2FuDtazKXJdMDZaO%2FV2fXmm3USsjpeU8dJgi7Bha9mdfdXy5&noverify=0&group_code=960900268)