Compare commits

...

1 Commits

Author SHA1 Message Date
Claude Bot
e80a304119 fix(windows): move -ExecutionPolicy Bypass before -c in uninstall command
The -ExecutionPolicy Bypass flag was placed after the -c argument in the
registry UninstallString, causing PowerShell to treat it as part of the
command text rather than as a PowerShell option. This made uninstalling
Bun fail on Windows systems with Restricted or AllSigned execution
policies. Also adds the flag to the documented uninstall command.

Closes #27399

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-24 06:41:14 +00:00
2 changed files with 2 additions and 2 deletions

View File

@@ -344,7 +344,7 @@ To remove Bun from your system:
<Tab title="Windows">
```powershell PowerShell icon="windows"
powershell -c ~\.bun\uninstall.ps1
powershell -ExecutionPolicy Bypass -c ~\.bun\uninstall.ps1
```
</Tab>

View File

@@ -287,7 +287,7 @@ function Install-Bun {
New-ItemProperty -Path $RegistryKey -Name "DisplayName" -Value "Bun" -PropertyType String -Force | Out-Null
New-ItemProperty -Path $RegistryKey -Name "InstallLocation" -Value "${BunRoot}" -PropertyType String -Force | Out-Null
New-ItemProperty -Path $RegistryKey -Name "DisplayIcon" -Value $BunBin\bun.exe -PropertyType String -Force | Out-Null
New-ItemProperty -Path $RegistryKey -Name "UninstallString" -Value "powershell -c `"& `'$BunRoot\uninstall.ps1`' -PauseOnError`" -ExecutionPolicy Bypass" -PropertyType String -Force | Out-Null
New-ItemProperty -Path $RegistryKey -Name "UninstallString" -Value "powershell -ExecutionPolicy Bypass -c `"& `'$BunRoot\uninstall.ps1`' -PauseOnError`"" -PropertyType String -Force | Out-Null
} catch {
if ($rootKey -ne $null) {
Remove-Item -Path $RegistryKey -Force