fix(updater): 避免因 Updater 配置不完整导致应用启动中止\n\n- Updater 插件注册改为容错(失败仅告警,不影响应用启动)

This commit is contained in:
Jason
2025-09-09 10:28:34 +08:00
parent 9ff7516c51
commit a3582f54e9
2 changed files with 11 additions and 6 deletions

View File

@@ -225,8 +225,15 @@ pub fn run() {
.setup(|app| {
// 注册 Updater 插件(桌面端)
#[cfg(desktop)]
app.handle()
.plugin(tauri_plugin_updater::Builder::new().build())?;
{
if let Err(e) = app
.handle()
.plugin(tauri_plugin_updater::Builder::new().build())
{
// 若配置不完整(如缺少 pubkey跳过 Updater 而不中断应用
log::warn!("初始化 Updater 插件失败,已跳过:{}", e);
}
}
#[cfg(target_os = "macos")]
{
// 设置 macOS 标题栏背景色为主界面蓝色