老板要求:软件里点「在线升级」校验版本号,直接在线覆盖安装、重启; 升级服务放在 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 起才能在软件里一键升级。
62 lines
1.6 KiB
JSON
62 lines
1.6 KiB
JSON
{
|
|
"name": "xiaoyin-markdown-editor",
|
|
"productName": "XiaoyinMarkdown",
|
|
"version": "2.6.2",
|
|
"description": "轻量本地 Markdown 编辑器:实时预览、多标签/多窗口、查找高亮、右键复制全文/打开目录、常用快捷键",
|
|
"main": "src/main.js",
|
|
"author": "小银",
|
|
"license": "MIT",
|
|
"scripts": {
|
|
"start": "electron .",
|
|
"pack": "electron-packager . XiaoyinMarkdown --platform=win32 --arch=x64 --out=dist --overwrite --asar --app-version=1.0.0",
|
|
"installer": "electron-builder --win nsis --x64"
|
|
},
|
|
"devDependencies": {
|
|
"@electron/packager": "^20.3.0",
|
|
"@tauri-apps/cli": "^2.12.6",
|
|
"electron": "45.4.1",
|
|
"windows-shortcuts": "^0.1.6"
|
|
},
|
|
"dependencies": {
|
|
"koffi": "^3.3.8"
|
|
},
|
|
"build": {
|
|
"appId": "com.xiaoyin.markdown",
|
|
"productName": "XiaoyinMarkdown",
|
|
"electronDist": "node_modules/electron/dist",
|
|
"directories": {
|
|
"output": "release"
|
|
},
|
|
"files": [
|
|
"src/**/*",
|
|
"package.json",
|
|
"!tools/**",
|
|
"!build/**",
|
|
"!release/**",
|
|
"!dist/**",
|
|
"!.cache/**",
|
|
"!.workbuddy/**",
|
|
"!shot-*.png",
|
|
"!README.md"
|
|
],
|
|
"asarUnpack": [
|
|
"**/node_modules/koffi/**"
|
|
],
|
|
"win": {
|
|
"target": [
|
|
"nsis"
|
|
],
|
|
"icon": "build/icon.ico"
|
|
},
|
|
"nsis": {
|
|
"oneClick": false,
|
|
"perMachine": false,
|
|
"allowToChangeInstallationDirectory": true,
|
|
"artifactName": "XiaoyinMarkdown-Setup-${version}.exe",
|
|
"shortcutName": "小银 Markdown",
|
|
"createDesktopShortcut": true,
|
|
"createStartMenuShortcut": true,
|
|
"uninstallDisplayName": "小银 Markdown"
|
|
}
|
|
}
|
|
} |