diff --git a/package.json b/package.json index bfd5dc60..bda59f01 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "@mdi/font": "7.4.47", "@sentry/vite-plugin": "^4.7.0", "@sentry/vue": "^10.35.0", + "@sentry/core": "^10.35.0", "@skipperndt/plugin-machine-uid": "^0.1.3", "@tauri-apps/api": "^2.9.1", "@tauri-apps/plugin-cli": "^2.4.1", @@ -115,7 +116,6 @@ "@eslint/eslintrc": "^3.3.3", "@eslint/js": "^9.39.2", "@microsoft/tsdoc": "^0.16.0", - "@sentry/core": "^10.35.0", "@tauri-apps/cli": "2.9.6", "@types/fs-extra": "^11.0.4", "@types/js-md5": "^0.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 777c8b7b..0a5befe8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@mdi/font': specifier: 7.4.47 version: 7.4.47 + '@sentry/core': + specifier: ^10.35.0 + version: 10.35.0 '@sentry/vite-plugin': specifier: ^4.7.0 version: 4.7.0 @@ -138,9 +141,6 @@ importers: '@microsoft/tsdoc': specifier: ^0.16.0 version: 0.16.0 - '@sentry/core': - specifier: ^10.35.0 - version: 10.35.0 '@tauri-apps/cli': specifier: 2.9.6 version: 2.9.6 diff --git a/src-tauri/src/yae/mod.rs b/src-tauri/src/yae/mod.rs index 1e269e89..e185d52e 100644 --- a/src-tauri/src/yae/mod.rs +++ b/src-tauri/src/yae/mod.rs @@ -1,5 +1,5 @@ //! Yae 相关处理 -//! @since Beta v0.9.2 +//! @since Beta v0.9.4 #![cfg(target_os = "windows")] pub mod inject; @@ -75,11 +75,19 @@ pub fn call_yae_dll( ticket: Option, is_msix: bool, ) -> Result<(), String> { - let mut dll_path = app_handle.path().app_config_dir().unwrap().join("YaeAchievementLib.dll"); + let mut dll_path = + app_handle.path().resource_dir().unwrap().join("resources\\YaeAchievementLib.dll"); if is_msix { dll_path = app_handle.path().document_dir().unwrap().join("TeyvatGuide\\YaeAchievementLib.dll"); } - dbg!(&dll_path); + log::info!("Resolved DLL path: {}", dll_path.display()); + + // 检测 dll 存在 + if !dll_path.exists() { + let msg = format!("未检测到 DLL,路径: {}", dll_path.display()); + return Err(msg); + } + // 0. 创建 YaeAchievementPipe 的 命名管道,获取句柄 dbg!("开始启动 YaeAchievementPipe 命名管道"); let _pipe_handle = create_named_pipe("YaeAchievementPipe");