From 7114f4e7a8f2f185c71d03a191bae2b3bd431cdb Mon Sep 17 00:00:00 2001 From: bookworm Date: Fri, 10 Apr 2026 11:11:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=89=88=E6=9C=AC=E5=8F=B7=20v1.6.0,?= =?UTF-8?q?=20=E6=A0=87=E9=A2=98=E6=A0=8F/=E5=BC=B9=E7=AA=97/EXE=20?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=BB=9F=E4=B8=80=E6=98=BE=E7=A4=BA,=20build?= =?UTF-8?q?.ps1=20=E8=87=AA=E5=8A=A8=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto-setup.ps1 | 9 ++++++--- build.ps1 | 17 +++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/auto-setup.ps1 b/auto-setup.ps1 index 232d118..18155a6 100644 --- a/auto-setup.ps1 +++ b/auto-setup.ps1 @@ -15,6 +15,9 @@ param( $ErrorActionPreference = "Stop" +# ─── 版本号 (每次更新递增, build.ps1 自动读取) ────── +$BWVersion = "1.6.0" + # ─── B4: 单实例保护 (防止双击两次导致竞态) ───────── $mutexCreated = $false $global:BWMutex = [System.Threading.Mutex]::new($true, "Global\BookwormPortableSetup", [ref]$mutexCreated) @@ -76,7 +79,7 @@ function Show-ProgressForm { $uiFont = "Segoe UI" $global:BWProgressForm = New-Object System.Windows.Forms.Form - $global:BWProgressForm.Text = "Bookworm Portable Setup v1.5.1" + $global:BWProgressForm.Text = "Bookworm Portable Setup v$BWVersion" $global:BWProgressForm.Size = New-Object System.Drawing.Size(520, 230) $global:BWProgressForm.StartPosition = "CenterScreen" $global:BWProgressForm.FormBorderStyle = "FixedDialog" @@ -1259,8 +1262,8 @@ Close-ProgressForm New-DesktopShortcuts if ($allOK -and $env:ANTHROPIC_API_KEY) { - Bw-Log "DONE" "安装成功 ($skillCount Skills / $hookCount Hooks)" - Show-MsgBox "Bookworm Portable 安装成功!`n`n$skillCount Skills / $hookCount Hooks 全部就绪`n`n点击确定后将自动启动 Claude Code。`n`n日志: $BWLogFile" "安装成功" "OK" "Information" | Out-Null + Bw-Log "DONE" "v$BWVersion 安装成功 ($skillCount Skills / $hookCount Hooks)" + Show-MsgBox "Bookworm Portable v$BWVersion 安装成功!`n`n$skillCount Skills / $hookCount Hooks 全部就绪`n`n点击确定后将自动启动 Claude Code。`n`n日志: $BWLogFile" "安装成功 v$BWVersion" "OK" "Information" | Out-Null if (-not $SkipLaunch) { # 启动 Claude Code: 用户的 Claude Code 由 cmd 窗口启动 (PS2EXE -NoConsole 下会创建新窗口) diff --git a/build.ps1 b/build.ps1 index d46f64d..9208e98 100644 --- a/build.ps1 +++ b/build.ps1 @@ -65,7 +65,12 @@ if ($buildSetup) { Write-Host " 输入: $inputPs1" -ForegroundColor Gray Write-Host " 输出: $outputExe" -ForegroundColor Gray - # 优先用桌面专用 B 圆图标 (高对比度, 小尺寸清晰), 回退到 galaxy + # 从 auto-setup.ps1 读取版本号 + $versionLine = Select-String -Path $inputPs1 -Pattern '^\$BWVersion\s*=\s*"([^"]+)"' | Select-Object -First 1 + $bwVer = if ($versionLine) { $versionLine.Matches[0].Groups[1].Value } else { "0.0.0" } + Write-Host " 版本: $bwVer" -ForegroundColor Gray + + # 优先用桌面专用 B 圆图标, 回退到 galaxy $iconFile = Join-Path $ScriptDir "bookworm-desktop.ico" if (-not (Test-Path $iconFile)) { $iconFile = Join-Path $ScriptDir "bookworm.ico" @@ -73,13 +78,13 @@ if ($buildSetup) { $ps2exeArgs = @{ InputFile = $inputPs1 OutputFile = $outputExe - Title = "Bookworm Portable Setup" - Description = "Bookworm Smart Assistant 安装向导" + Title = "Bookworm Portable Setup v$bwVer" + Description = "Bookworm Smart Assistant 安装向导 v$bwVer" Company = "Bookworm" - Version = "1.5.1.0" + Version = "$bwVer.0" NoConsole = $true - NoOutput = $true # 抑制所有 Write-Host 弹窗化, 只保留 Show-MsgBox / GUI dialog - NoError = $true # 抑制 stderr 弹窗化, 异常仍走 try-catch + NoOutput = $true + NoError = $true } if (Test-Path $iconFile) { $ps2exeArgs.IconFile = $iconFile