🐛 修复msi版本dll调用异常,捕获dll异常

This commit is contained in:
BTMuli
2026-01-22 01:21:51 +08:00
parent 3cb0c423a5
commit 68c2d1cfcb
3 changed files with 15 additions and 7 deletions

View File

@@ -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",

6
pnpm-lock.yaml generated
View File

@@ -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

View File

@@ -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<String>,
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");