diff --git a/Bookworm-Setup.exe b/Bookworm-Setup.exe index 7e88ccf..57cc926 100644 Binary files a/Bookworm-Setup.exe and b/Bookworm-Setup.exe differ diff --git a/auto-setup.ps1 b/auto-setup.ps1 index c99ac6b..20752cd 100644 --- a/auto-setup.ps1 +++ b/auto-setup.ps1 @@ -810,7 +810,8 @@ $sentinelEnd try { if (-not (Test-Path $t.Dir)) { New-Item -ItemType Directory -Path $t.Dir -Force -EA Stop | Out-Null } $psProfilePath = Join-Path $t.Dir $t.File - $existing = if (Test-Path $psProfilePath) { Get-Content $psProfilePath -Raw -Encoding UTF8 } else { "" } + $existing = if (Test-Path $psProfilePath) { (Get-Content $psProfilePath -Raw -Encoding UTF8 -EA SilentlyContinue) } else { $null } + if (-not $existing) { $existing = "" } # 同时清理 v3.0.11 旧 sentinel (BW_CRED_START v3.0.11 ...) $oldPattern = "# BW_CRED_START v3\.0\.\d+[\s\S]*?# BW_CRED_END" $existing = [regex]::Replace($existing, $oldPattern, "")