feat: 版本号 v1.6.0, 标题栏/弹窗/EXE 属性统一显示, build.ps1 自动读取

This commit is contained in:
bookworm 2026-04-10 11:11:13 +08:00
parent d20d9d91a7
commit 7114f4e7a8
2 changed files with 17 additions and 9 deletions

View File

@ -15,6 +15,9 @@ param(
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
# ─── 版本号 (每次更新递增, build.ps1 自动读取) ──────
$BWVersion = "1.6.0"
# ─── B4: 单实例保护 (防止双击两次导致竞态) ───────── # ─── B4: 单实例保护 (防止双击两次导致竞态) ─────────
$mutexCreated = $false $mutexCreated = $false
$global:BWMutex = [System.Threading.Mutex]::new($true, "Global\BookwormPortableSetup", [ref]$mutexCreated) $global:BWMutex = [System.Threading.Mutex]::new($true, "Global\BookwormPortableSetup", [ref]$mutexCreated)
@ -76,7 +79,7 @@ function Show-ProgressForm {
$uiFont = "Segoe UI" $uiFont = "Segoe UI"
$global:BWProgressForm = New-Object System.Windows.Forms.Form $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.Size = New-Object System.Drawing.Size(520, 230)
$global:BWProgressForm.StartPosition = "CenterScreen" $global:BWProgressForm.StartPosition = "CenterScreen"
$global:BWProgressForm.FormBorderStyle = "FixedDialog" $global:BWProgressForm.FormBorderStyle = "FixedDialog"
@ -1259,8 +1262,8 @@ Close-ProgressForm
New-DesktopShortcuts New-DesktopShortcuts
if ($allOK -and $env:ANTHROPIC_API_KEY) { if ($allOK -and $env:ANTHROPIC_API_KEY) {
Bw-Log "DONE" "安装成功 ($skillCount Skills / $hookCount Hooks)" Bw-Log "DONE" "v$BWVersion 安装成功 ($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 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) { if (-not $SkipLaunch) {
# 启动 Claude Code: 用户的 Claude Code 由 cmd 窗口启动 (PS2EXE -NoConsole 下会创建新窗口) # 启动 Claude Code: 用户的 Claude Code 由 cmd 窗口启动 (PS2EXE -NoConsole 下会创建新窗口)

View File

@ -65,7 +65,12 @@ if ($buildSetup) {
Write-Host " 输入: $inputPs1" -ForegroundColor Gray Write-Host " 输入: $inputPs1" -ForegroundColor Gray
Write-Host " 输出: $outputExe" -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" $iconFile = Join-Path $ScriptDir "bookworm-desktop.ico"
if (-not (Test-Path $iconFile)) { if (-not (Test-Path $iconFile)) {
$iconFile = Join-Path $ScriptDir "bookworm.ico" $iconFile = Join-Path $ScriptDir "bookworm.ico"
@ -73,13 +78,13 @@ if ($buildSetup) {
$ps2exeArgs = @{ $ps2exeArgs = @{
InputFile = $inputPs1 InputFile = $inputPs1
OutputFile = $outputExe OutputFile = $outputExe
Title = "Bookworm Portable Setup" Title = "Bookworm Portable Setup v$bwVer"
Description = "Bookworm Smart Assistant 安装向导" Description = "Bookworm Smart Assistant 安装向导 v$bwVer"
Company = "Bookworm" Company = "Bookworm"
Version = "1.5.1.0" Version = "$bwVer.0"
NoConsole = $true NoConsole = $true
NoOutput = $true # 抑制所有 Write-Host 弹窗化, 只保留 Show-MsgBox / GUI dialog NoOutput = $true
NoError = $true # 抑制 stderr 弹窗化, 异常仍走 try-catch NoError = $true
} }
if (Test-Path $iconFile) { if (Test-Path $iconFile) {
$ps2exeArgs.IconFile = $iconFile $ps2exeArgs.IconFile = $iconFile