From d8cd7fd514d24f723695c15e1d8fa71ad5fe8037 Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Fri, 20 Feb 2026 23:53:02 +0800 Subject: [PATCH] fix: improve app relaunch after update and release 0.1.28 --- 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 | 20 ++++++++++++++++++-- desktop-client/src-tauri/tauri.conf.json | 2 +- desktop-client/src/App.vue | 2 +- 7 files changed, 24 insertions(+), 8 deletions(-) diff --git a/backend/server.js b/backend/server.js index 9136e16..7c5cf2c 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.27'; +const DEFAULT_DESKTOP_VERSION = process.env.DESKTOP_LATEST_VERSION || '0.1.28'; const DEFAULT_DESKTOP_INSTALLER_URL = process.env.DESKTOP_INSTALLER_URL || ''; const DEFAULT_DESKTOP_INSTALLER_SHA256 = String(process.env.DESKTOP_INSTALLER_SHA256 || '').trim().toLowerCase(); const DEFAULT_DESKTOP_INSTALLER_SIZE = Math.max(0, Number(process.env.DESKTOP_INSTALLER_SIZE || 0)); diff --git a/desktop-client/package.json b/desktop-client/package.json index f414664..a53d8e7 100644 --- a/desktop-client/package.json +++ b/desktop-client/package.json @@ -1,7 +1,7 @@ { "name": "desktop-client", "private": true, - "version": "0.1.27", + "version": "0.1.28", "type": "module", "scripts": { "dev": "vite", diff --git a/desktop-client/src-tauri/Cargo.lock b/desktop-client/src-tauri/Cargo.lock index 849c184..d8f5352 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.27" +version = "0.1.28" dependencies = [ "reqwest 0.12.28", "rusqlite", diff --git a/desktop-client/src-tauri/Cargo.toml b/desktop-client/src-tauri/Cargo.toml index ee07a61..1d78442 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.27" +version = "0.1.28" 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 3ee1981..f2626b8 100644 --- a/desktop-client/src-tauri/src/lib.rs +++ b/desktop-client/src-tauri/src/lib.rs @@ -1479,9 +1479,25 @@ timeout /t 1 /nobreak >nul\r\n\ start \"\" /wait \"%INSTALLER%\" /S\r\n\ set \"INSTALL_EXIT=%ERRORLEVEL%\"\r\n\ echo [%%date%% %%time%%] installer exit code: %INSTALL_EXIT% >> \"%LOG_FILE%\"\r\n\ -if not \"%INSTALL_EXIT%\"==\"0\" exit /b %INSTALL_EXIT%\r\n\ +set \"RETRY_COUNT=0\"\r\n\ +:wait_for_app\r\n\ +if exist \"%APP_EXE%\" goto launch_app\r\n\ +if exist \"%LOCALAPPDATA%\\玩玩云\\desktop-client.exe\" (\r\n\ + set \"APP_EXE=%LOCALAPPDATA%\\玩玩云\\desktop-client.exe\"\r\n\ + goto launch_app\r\n\ +)\r\n\ +if %RETRY_COUNT% GEQ 25 goto app_missing\r\n\ +set /a RETRY_COUNT+=1\r\n\ timeout /t 1 /nobreak >nul\r\n\ -if exist \"%APP_EXE%\" start \"\" \"%APP_EXE%\"\r\n\ +goto wait_for_app\r\n\ +:launch_app\r\n\ +start \"\" \"%APP_EXE%\"\r\n\ +set \"START_EXIT=%ERRORLEVEL%\"\r\n\ +echo [%%date%% %%time%%] launch app exit code: %START_EXIT% path=%APP_EXE% >> \"%LOG_FILE%\"\r\n\ +goto cleanup\r\n\ +:app_missing\r\n\ +echo [%%date%% %%time%%] app exe not found after install >> \"%LOG_FILE%\"\r\n\ +:cleanup\r\n\ del \"%~f0\" >nul 2>nul\r\n", installer = installer_text, app_exe = app_text, diff --git a/desktop-client/src-tauri/tauri.conf.json b/desktop-client/src-tauri/tauri.conf.json index 0611245..50c2c9e 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.27", + "version": "0.1.28", "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 5efb72d..c001171 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.27", + currentVersion: "0.1.28", latestVersion: "", available: false, mandatory: false,