diff --git a/Bookworm-Setup.exe b/Bookworm-Setup.exe index 0846c45..c8cf5cf 100644 Binary files a/Bookworm-Setup.exe and b/Bookworm-Setup.exe differ diff --git a/auto-setup.ps1 b/auto-setup.ps1 index 105bf6d..19b30e9 100644 --- a/auto-setup.ps1 +++ b/auto-setup.ps1 @@ -2750,30 +2750,7 @@ if ($allOK -and $env:ANTHROPIC_API_KEY) { $splash.Close() $splash.Dispose() - # v3.0.1: Bun crash 预检 (Claude Code 2.1.x 内置 Bun, 部分 Win10/CPU 触发 Illegal instruction) - # 先静默跑 `claude --version` 测试 3 秒, 若 crash 自动降到 2.0.1 纯 Node 版 - $claudeVerOK = $false - try { - # 加超时: Bun crash 可能导致 claude --version 挂起不退出, -Wait 会卡死 - $proc = Start-Process -FilePath "claude" -ArgumentList "--version" -NoNewWindow -PassThru -RedirectStandardOutput "$env:TEMP\bw-claude-ver.txt" -RedirectStandardError "$env:TEMP\bw-claude-err.txt" -WindowStyle Hidden - $exited = $proc.WaitForExit(8000) # 8 秒硬超时 - if (-not $exited) { - try { $proc.Kill() } catch {} - Log-Warn "Claude Code --version 超过 8 秒无响应 (疑似 Bun 卡死)" - } elseif ($proc.ExitCode -eq 0) { - $out = Get-Content "$env:TEMP\bw-claude-ver.txt" -Raw -ErrorAction SilentlyContinue - if ($out -match "\d+\.\d+\.\d+") { $claudeVerOK = $true; Log-OK "Claude Code 自检: $($Matches[0])" } - } else { - Log-Warn "Claude Code 自检退出码非 0: $($proc.ExitCode) (可能 Bun Illegal instruction)" - } - Remove-Item "$env:TEMP\bw-claude-ver.txt","$env:TEMP\bw-claude-err.txt" -EA SilentlyContinue - } catch {} - if (-not $claudeVerOK) { - Log-Warn "Claude Code 2.1.x Bun 自检失败 (可能 Illegal instruction), 自动降级到 2.0.1 纯 Node 版..." - Run-CmdWithUI "npm" @("uninstall", "-g", "@anthropic-ai/claude-code") "卸载现版" 120000 | Out-Null - $r = Run-CmdWithUI "npm" @("install", "-g", "@anthropic-ai/claude-code@2.0.1") "安装 2.0.1 纯 Node 版" 180000 - if ($r.OK) { Log-OK "Claude Code 降级到 2.0.1 (Bun crash 规避)" } else { Log-Warn "降级失败, 仍尝试原版启动" } - } + # v3.2.0: Bun crash 降级逻辑已移除 (Claude Code 2.1.x+ 不再使用 Bun, 无需降级到 2.0.1) # v3.0.1: 启动 Bookworm — 彻底绕开 .bat + claude.cmd shim # 直接调 claude.ps1 (npm 全局装时生成, PS 原生, 不会经 cmd.exe)