feat(update): 在线升级 —— 界面一键检查版本、自动覆盖安装并重启
老板要求:软件里点「在线升级」校验版本号,直接在线覆盖安装、重启; 升级服务放在 https://md.wangjinding.com。 一、服务端(md.wangjinding.com) · 升级清单 GET /update/latest.json(nginx 单独 location,强制 no-store,带 CORS) { version, notes, pub_date, platforms.windows-x86_64: { signature, url, size, sha256 } } · 安装包走现有 /download/;另加稳定别名 latest-setup.exe / latest-portable.exe —— 官网页固定链到别名,以后发版不用改 HTML · tools/release/publish.py:一条命令完成「拷安装包 → 写清单 → 更新别名 → 打校验值」 · 官网页的版本号改成从 latest.json 拉(data-ver),发版后自动跟随 二、客户端(Tauri updater 官方插件,不是自己下 exe 硬跑) · 新增 tauri-plugin-updater + tauri-plugin-process · 命令 check_update() → { available, current, version, notes, date } install_update() → 下载 + 校验签名 + 静默覆盖安装 + restart · 签名用 minisign:私钥 /root/.tauri/xiaoyin-md-updater.key(600,**不在仓库里**), 公钥写进 tauri.conf.json;安装包被篡改会被客户端直接拒装 · 工具条新增升级按钮(仅 Tauri 版显示);点击 → 查版本 → 有新版弹窗(带更新说明) → 「立即升级」显示下载进度条 → 装完自动重启 · 版本号 2.6.1 → 2.6.2 三、已验证 · 构建出 XiaoyinMarkdown_2.6.2_x64-setup.exe(2.21 MB)+ .sig(448B) · 用 cryptography 按 minisign 规则**真验了一遍签名**:Ed25519 + BLAKE2b 预哈希 → 通过 · /update/latest.json 200 / application/json / no-store;sha256 与清单一致 · latest-setup.exe / latest-portable.exe 均 200 注意:2.6.1 是**没有升级器**的版本,老用户要手动装一次 2.6.2; 从 2.6.2 起才能在软件里一键升级。
This commit is contained in:
1 parent
f53abeb0c8
commit
44335d02f2
10 files changed
+893
-27
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "XiaoyinMarkdown",
|
||||
"version": "2.6.1",
|
||||
"version": "2.6.2",
|
||||
"identifier": "com.xiaoyin.markdown",
|
||||
"build": {
|
||||
"frontendDist": "../src/renderer"
|
||||
@@ -67,6 +67,18 @@
|
||||
"uninstallerIcon": "icons/icon.ico",
|
||||
"installerHooks": "installer-hooks.nsh"
|
||||
}
|
||||
},
|
||||
"createUpdaterArtifacts": true
|
||||
},
|
||||
"plugins": {
|
||||
"updater": {
|
||||
"endpoints": [
|
||||
"https://md.wangjinding.com/update/latest.json"
|
||||
],
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEVFMjMxQjcwNzlFMDhCNTgKUldSWWkrQjVjQnNqN3Ewazg0U1VTN2VHSmE5amRROEIzN2UrK2w4dlJ5R05rcGhTY0FuNUk3NUwK",
|
||||
"windows": {
|
||||
"installMode": "passive"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user