feat(v1.8.0): 祝贺闪屏动画替代 MsgBox + cmd 黑窗
安装成功后的体验: - 移除: MsgBox "安装成功" 弹窗 + cmd.exe /k claude 黑窗口 - 新增: 品牌闪屏 (深色底 + 蓝紫装饰条 + 绿色大勾) - 淡入动画 (300ms) → 停留 2.5s → 淡出 (250ms) - 显示: 版本号 + Skills/Hooks 数量 + "善读者,必善造" - 底部提示 "双击桌面 Bookworm 图标即可启动" - 不再自动弹出 cmd 窗口 (用户通过桌面快捷方式启动) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
23d4577743
commit
38b2a2d022
103
auto-setup.ps1
103
auto-setup.ps1
@ -16,7 +16,7 @@ param(
|
|||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
# ─── 版本号 (每次更新递增, build.ps1 自动读取) ──────
|
# ─── 版本号 (每次更新递增, build.ps1 自动读取) ──────
|
||||||
$BWVersion = "1.7.1"
|
$BWVersion = "1.8.0"
|
||||||
|
|
||||||
# ─── B4: 单实例保护 (防止双击两次导致竞态) ─────────
|
# ─── B4: 单实例保护 (防止双击两次导致竞态) ─────────
|
||||||
$mutexCreated = $false
|
$mutexCreated = $false
|
||||||
@ -1308,7 +1308,7 @@ try {
|
|||||||
}
|
}
|
||||||
} catch { Bw-Log "WARN" "7c 冲突修复失败: $_" }
|
} catch { Bw-Log "WARN" "7c 冲突修复失败: $_" }
|
||||||
|
|
||||||
# 关闭 GUI 进度窗口 (后续由 Show-MsgBox 显示成功/失败)
|
# 关闭进度窗口
|
||||||
Close-ProgressForm
|
Close-ProgressForm
|
||||||
|
|
||||||
# 创建桌面快捷方式
|
# 创建桌面快捷方式
|
||||||
@ -1316,12 +1316,103 @@ New-DesktopShortcuts
|
|||||||
|
|
||||||
if ($allOK -and $env:ANTHROPIC_API_KEY) {
|
if ($allOK -and $env:ANTHROPIC_API_KEY) {
|
||||||
Bw-Log "DONE" "v$BWVersion 安装成功 ($skillCount Skills / $hookCount Hooks)"
|
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) {
|
# ═══ 祝贺闪屏 (2.5 秒自动消失) ═══
|
||||||
# 启动 Claude Code: 用户的 Claude Code 由 cmd 窗口启动 (PS2EXE -NoConsole 下会创建新窗口)
|
$splash = New-Object System.Windows.Forms.Form
|
||||||
Start-Process -FilePath "cmd.exe" -ArgumentList "/k", "claude --dangerously-skip-permissions"
|
$splash.FormBorderStyle = "None"
|
||||||
|
$splash.StartPosition = "CenterScreen"
|
||||||
|
$splash.Size = New-Object System.Drawing.Size(480, 300)
|
||||||
|
$splash.BackColor = [System.Drawing.Color]::FromArgb(24, 25, 38)
|
||||||
|
$splash.TopMost = $true
|
||||||
|
$splash.ShowInTaskbar = $false
|
||||||
|
$splash.Opacity = 0.0
|
||||||
|
|
||||||
|
# 品牌蓝紫装饰条
|
||||||
|
$topBar = New-Object System.Windows.Forms.Panel
|
||||||
|
$topBar.Location = New-Object System.Drawing.Point(0, 0)
|
||||||
|
$topBar.Size = New-Object System.Drawing.Size(480, 4)
|
||||||
|
$topBar.BackColor = [System.Drawing.Color]::FromArgb(88, 101, 242)
|
||||||
|
$splash.Controls.Add($topBar)
|
||||||
|
|
||||||
|
# 大勾图标
|
||||||
|
$checkLabel = New-Object System.Windows.Forms.Label
|
||||||
|
$checkLabel.Location = New-Object System.Drawing.Point(0, 35)
|
||||||
|
$checkLabel.Size = New-Object System.Drawing.Size(480, 55)
|
||||||
|
$checkLabel.Text = [char]0x2714
|
||||||
|
$checkLabel.Font = New-Object System.Drawing.Font("Segoe UI", 36)
|
||||||
|
$checkLabel.ForeColor = [System.Drawing.Color]::FromArgb(46, 160, 67)
|
||||||
|
$checkLabel.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
|
||||||
|
$splash.Controls.Add($checkLabel)
|
||||||
|
|
||||||
|
# 主标题
|
||||||
|
$mainTitle = New-Object System.Windows.Forms.Label
|
||||||
|
$mainTitle.Location = New-Object System.Drawing.Point(0, 95)
|
||||||
|
$mainTitle.Size = New-Object System.Drawing.Size(480, 38)
|
||||||
|
$mainTitle.Text = "Bookworm v$BWVersion 安装成功"
|
||||||
|
$mainTitle.Font = New-Object System.Drawing.Font("Segoe UI", 18, [System.Drawing.FontStyle]::Bold)
|
||||||
|
$mainTitle.ForeColor = [System.Drawing.Color]::White
|
||||||
|
$mainTitle.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
|
||||||
|
$splash.Controls.Add($mainTitle)
|
||||||
|
|
||||||
|
# 副标题
|
||||||
|
$subTitle = New-Object System.Windows.Forms.Label
|
||||||
|
$subTitle.Location = New-Object System.Drawing.Point(0, 140)
|
||||||
|
$subTitle.Size = New-Object System.Drawing.Size(480, 28)
|
||||||
|
$subTitle.Text = "$skillCount Skills / $hookCount Hooks / 全部就绪"
|
||||||
|
$subTitle.Font = New-Object System.Drawing.Font("Segoe UI", 11)
|
||||||
|
$subTitle.ForeColor = [System.Drawing.Color]::FromArgb(160, 170, 200)
|
||||||
|
$subTitle.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
|
||||||
|
$splash.Controls.Add($subTitle)
|
||||||
|
|
||||||
|
# 祝福语
|
||||||
|
$wish = New-Object System.Windows.Forms.Label
|
||||||
|
$wish.Location = New-Object System.Drawing.Point(0, 190)
|
||||||
|
$wish.Size = New-Object System.Drawing.Size(480, 30)
|
||||||
|
$wish.Text = "善读者,必善造。使用愉快!"
|
||||||
|
$wish.Font = New-Object System.Drawing.Font("Segoe UI", 12)
|
||||||
|
$wish.ForeColor = [System.Drawing.Color]::FromArgb(88, 101, 242)
|
||||||
|
$wish.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
|
||||||
|
$splash.Controls.Add($wish)
|
||||||
|
|
||||||
|
# 底部提示
|
||||||
|
$hint = New-Object System.Windows.Forms.Label
|
||||||
|
$hint.Location = New-Object System.Drawing.Point(0, 250)
|
||||||
|
$hint.Size = New-Object System.Drawing.Size(480, 22)
|
||||||
|
$hint.Text = "双击桌面 Bookworm 图标即可随时启动"
|
||||||
|
$hint.Font = New-Object System.Drawing.Font("Segoe UI", 9)
|
||||||
|
$hint.ForeColor = [System.Drawing.Color]::FromArgb(100, 110, 130)
|
||||||
|
$hint.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
|
||||||
|
$splash.Controls.Add($hint)
|
||||||
|
|
||||||
|
# 底部装饰条
|
||||||
|
$bottomBar = New-Object System.Windows.Forms.Panel
|
||||||
|
$bottomBar.Location = New-Object System.Drawing.Point(0, 296)
|
||||||
|
$bottomBar.Size = New-Object System.Drawing.Size(480, 4)
|
||||||
|
$bottomBar.BackColor = [System.Drawing.Color]::FromArgb(88, 101, 242)
|
||||||
|
$splash.Controls.Add($bottomBar)
|
||||||
|
|
||||||
|
# 淡入动画 + 定时关闭
|
||||||
|
$splash.Show()
|
||||||
|
for ($i = 0; $i -le 10; $i++) {
|
||||||
|
$splash.Opacity = $i / 10.0
|
||||||
|
$splash.Refresh()
|
||||||
|
Start-Sleep -Milliseconds 30
|
||||||
}
|
}
|
||||||
|
# 停留 2.5 秒
|
||||||
|
$sw = [System.Diagnostics.Stopwatch]::StartNew()
|
||||||
|
while ($sw.ElapsedMilliseconds -lt 2500) {
|
||||||
|
[System.Windows.Forms.Application]::DoEvents()
|
||||||
|
Start-Sleep -Milliseconds 50
|
||||||
|
}
|
||||||
|
# 淡出
|
||||||
|
for ($i = 10; $i -ge 0; $i--) {
|
||||||
|
$splash.Opacity = $i / 10.0
|
||||||
|
$splash.Refresh()
|
||||||
|
Start-Sleep -Milliseconds 25
|
||||||
|
}
|
||||||
|
$splash.Close()
|
||||||
|
$splash.Dispose()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Bw-Log "DONE" "安装完成但部分受限 allOK=$allOK hasKey=$($env:ANTHROPIC_API_KEY -ne $null)"
|
Bw-Log "DONE" "安装完成但部分受限 allOK=$allOK hasKey=$($env:ANTHROPIC_API_KEY -ne $null)"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user