feat: 添加 Tauri 自动更新器插件支持 (updater plugin)

- 添加 tauri-plugin-updater / tauri-plugin-process Rust 依赖
- 注册 updater 和 process 插件到 Tauri 构建器
- 配置 tauri.conf.json 更新器端点与公钥占位
- 添加 @tauri-apps/plugin-updater / plugin-process npm 依赖
- 创建 useUpdater composable(静默检查、手动检查、下载进度、安装重启)
- 在 AppLayout 标题栏集成更新交互 UI(下载按钮、进度条、安装状态)
- 添加 .pnpm-store 到 .gitignore
This commit is contained in:
Joe Allen
2026-08-20 15:16:23 +08:00
parent 77724e13a1
commit f5a702fab1
9 changed files with 346 additions and 5 deletions
+2
View File
@@ -23,6 +23,8 @@ tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-opener = "2"
tauri-plugin-process = "2"
tauri-plugin-updater = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
rumqttc-v5-next = "0.34"
+2
View File
@@ -944,6 +944,8 @@ pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.manage(AppState {
clients: RwLock::new(HashMap::new()),
log_writer,
+13 -2
View File
@@ -23,6 +23,16 @@
"csp": null
}
},
"plugins": {
"updater": {
"active": true,
"dialog": true,
"endpoints": [
"https://releases.mqttx.app/update/{{target}}-{{arch}}/{{current_version}}"
],
"pubkey": "请替换为你的公钥——使用 `tauri signer generate` 生成签名密钥对后,将公钥粘贴至此"
}
},
"bundle": {
"active": true,
"targets": "all",
@@ -35,11 +45,12 @@
],
"windows": {
"nsis": {
"language": ["SimpChinese", "English"]
"languages": ["SimpChinese", "English"],
"displayLanguageSelector": true
},
"wix": {
"language": ["zh-CN", "en-US"]
}
}
}
}
}