From 51f19f3b72fedcd5eaa62bf441b8ba78fb6c267f Mon Sep 17 00:00:00 2001 From: kdletters Date: Tue, 1 Sep 2026 18:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B5=81=E7=A8=8B=E4=B8=8E=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补充安装完成后的客户端自动重启 修正关于页检查更新按钮被裁切 同步更新提权安装流程文档 --- .../src-tauri/src/main.rs | 26 ++++++++----------- apps/ai-game-creator-shell/src/styles.css | 9 ++++--- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/main.rs b/apps/ai-game-creator-shell/src-tauri/src/main.rs index 8cccbcefd..79de25e22 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/main.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/main.rs @@ -58,14 +58,15 @@ struct AgcUpdateDownloadProgress { } #[cfg(windows)] -fn launch_agc_installer(path: &Path) -> Result<(), String> { +fn launch_agc_installer(path: &Path, relaunch_path: &Path) -> Result<(), String> { use std::os::windows::process::CommandExt; let executable = path.to_string_lossy().replace('\'', "''"); + let relaunch_executable = relaunch_path.to_string_lossy().replace('\'', "''"); let script = format!( - "$ErrorActionPreference = 'Stop'; Start-Process -Verb RunAs -FilePath '{executable}' -ArgumentList @('/S')" + "$ErrorActionPreference = 'Stop'; $installer = Start-Process -Verb RunAs -Wait -PassThru -FilePath '{executable}' -ArgumentList @('/S'); if ($installer.ExitCode -eq 0 -and (Test-Path -LiteralPath '{relaunch_executable}')) {{ Start-Process -FilePath '{relaunch_executable}' }}; exit $installer.ExitCode" ); - let status = Command::new("powershell.exe") + Command::new("powershell.exe") .args([ "-NoProfile", "-NonInteractive", @@ -75,20 +76,13 @@ fn launch_agc_installer(path: &Path) -> Result<(), String> { script.as_str(), ]) .creation_flags(0x0800_0000) - .status() - .map_err(|error| format!("无法启动更新安装程序:{error}"))?; - if status.success() { - Ok(()) - } else { - Err(format!( - "无法启动更新安装程序(exit code {:?})", - status.code() - )) - } + .spawn() + .map(|_| ()) + .map_err(|error| format!("无法启动更新安装程序:{error}")) } #[cfg(not(windows))] -fn launch_agc_installer(path: &Path) -> Result<(), String> { +fn launch_agc_installer(path: &Path, _relaunch_path: &Path) -> Result<(), String> { Command::new(path) .arg("/S") .spawn() @@ -221,7 +215,9 @@ async fn download_agc_update( let _ = fs::remove_file(&temporary); return Err(format!("提交更新文件失败:{error}")); } - launch_agc_installer(&target)?; + let relaunch_path = std::env::current_exe() + .map_err(|error| format!("无法定位客户端程序:{error}"))?; + launch_agc_installer(&target, &relaunch_path)?; app.exit(0); Ok(target.to_string_lossy().into_owned()) } diff --git a/apps/ai-game-creator-shell/src/styles.css b/apps/ai-game-creator-shell/src/styles.css index f618f5e2b..6ca5b5623 100644 --- a/apps/ai-game-creator-shell/src/styles.css +++ b/apps/ai-game-creator-shell/src/styles.css @@ -3508,8 +3508,8 @@ h2 { grid-template-rows: auto minmax(0, 1fr) auto; gap: 0; width: min(1080px, 100%); - height: min(760px, calc(100dvh - 48px)); - max-height: calc(100dvh - 48px); + height: min(760px, calc(100dvh - var(--window-chrome-height) - 48px)); + max-height: calc(100dvh - var(--window-chrome-height) - 48px); padding: 0; overflow: hidden; border-color: var(--platform-modal-border); @@ -4619,6 +4619,7 @@ iframe.preview-frame { @media (max-width: 760px) { .settings-overlay { padding: 0; + overflow: auto; } .runtime-settings-toast { @@ -4630,8 +4631,8 @@ iframe.preview-frame { .runtime-settings-panel { width: 100%; - height: 100dvh; - max-height: 100dvh; + height: calc(100dvh - var(--window-chrome-height)); + max-height: calc(100dvh - var(--window-chrome-height)); border: 0; border-radius: 0; }