From cdfe45b3a2989d8bb5723a6728f8587eafc0002a Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Thu, 19 Feb 2026 21:41:44 +0800 Subject: [PATCH] fix: stabilize silent updater and release 0.1.22 --- backend/server.js | 2 +- desktop-client/package.json | 2 +- desktop-client/src-tauri/Cargo.lock | 2 +- desktop-client/src-tauri/Cargo.toml | 2 +- desktop-client/src-tauri/src/lib.rs | 15 +++++++++++---- desktop-client/src-tauri/tauri.conf.json | 2 +- desktop-client/src/App.vue | 2 +- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/backend/server.js b/backend/server.js index fdfcfb3..abeae9b 100644 --- a/backend/server.js +++ b/backend/server.js @@ -112,7 +112,7 @@ const DOWNLOAD_SIGNED_URL_EXPIRES_SECONDS = Math.max( 10, Math.min(3600, Number(process.env.DOWNLOAD_SIGNED_URL_EXPIRES_SECONDS || 30)) ); -const DEFAULT_DESKTOP_VERSION = process.env.DESKTOP_LATEST_VERSION || '0.1.21'; +const DEFAULT_DESKTOP_VERSION = process.env.DESKTOP_LATEST_VERSION || '0.1.22'; const DEFAULT_DESKTOP_INSTALLER_URL = process.env.DESKTOP_INSTALLER_URL || ''; const DEFAULT_DESKTOP_RELEASE_NOTES = process.env.DESKTOP_RELEASE_NOTES || ''; const DESKTOP_INSTALLERS_DIR = path.resolve(__dirname, '../frontend/downloads'); diff --git a/desktop-client/package.json b/desktop-client/package.json index 64eb9ee..9b0695d 100644 --- a/desktop-client/package.json +++ b/desktop-client/package.json @@ -1,7 +1,7 @@ { "name": "desktop-client", "private": true, - "version": "0.1.21", + "version": "0.1.22", "type": "module", "scripts": { "dev": "vite", diff --git a/desktop-client/src-tauri/Cargo.lock b/desktop-client/src-tauri/Cargo.lock index 56361d9..e4fe544 100644 --- a/desktop-client/src-tauri/Cargo.lock +++ b/desktop-client/src-tauri/Cargo.lock @@ -693,7 +693,7 @@ dependencies = [ [[package]] name = "desktop-client" -version = "0.1.21" +version = "0.1.22" dependencies = [ "reqwest 0.12.28", "rusqlite", diff --git a/desktop-client/src-tauri/Cargo.toml b/desktop-client/src-tauri/Cargo.toml index 577197a..ff58d88 100644 --- a/desktop-client/src-tauri/Cargo.toml +++ b/desktop-client/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "desktop-client" -version = "0.1.21" +version = "0.1.22" description = "A Tauri App" authors = ["you"] edition = "2021" diff --git a/desktop-client/src-tauri/src/lib.rs b/desktop-client/src-tauri/src/lib.rs index 2fdf89d..0ee0602 100644 --- a/desktop-client/src-tauri/src/lib.rs +++ b/desktop-client/src-tauri/src/lib.rs @@ -1115,6 +1115,7 @@ fn api_silent_install_and_restart(installer_path: String) -> Result Resultnul\r\n\ +timeout /t 1 /nobreak >nul\r\n\ +taskkill /PID %APP_PID% /T /F >nul 2>nul\r\n\ +timeout /t 1 /nobreak >nul\r\n\ start \"\" /wait \"%INSTALLER%\" /S\r\n\ +timeout /t 1 /nobreak >nul\r\n\ if exist \"%APP_EXE%\" start \"\" \"%APP_EXE%\"\r\n\ del \"%~f0\" >nul 2>nul\r\n", installer = installer_text, - app_exe = app_text + app_exe = app_text, + app_pid = current_pid ); fs::write(&script_path, script_content).map_err(|err| format!("写入更新脚本失败: {}", err))?; - let script_arg = format!("\"{}\"", script_path.to_string_lossy().replace('\"', "\"\"")); let mut updater_cmd = Command::new("cmd"); updater_cmd - .args(["/D", "/C", &script_arg]) + .arg("/D") + .arg("/C") + .arg(&script_path) .current_dir(&temp_dir) .creation_flags(CREATE_NO_WINDOW) .spawn() diff --git a/desktop-client/src-tauri/tauri.conf.json b/desktop-client/src-tauri/tauri.conf.json index c56066f..9df7f78 100644 --- a/desktop-client/src-tauri/tauri.conf.json +++ b/desktop-client/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "玩玩云", - "version": "0.1.21", + "version": "0.1.22", "identifier": "cn.workyai.wanwancloud.desktop", "build": { "beforeDevCommand": "npm run dev", diff --git a/desktop-client/src/App.vue b/desktop-client/src/App.vue index 613b0d9..2e0c9f0 100644 --- a/desktop-client/src/App.vue +++ b/desktop-client/src/App.vue @@ -153,7 +153,7 @@ const syncState = reactive({ nextRunAt: "", }); const updateState = reactive({ - currentVersion: "0.1.21", + currentVersion: "0.1.22", latestVersion: "", available: false, mandatory: false,