diff --git a/CHANGELOG.md b/CHANGELOG.md index 356486b519..c9314563aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - **scoop-download|install|update:** Fallback to default downloader when aria2 fails ([#4292](https://github.com/ScoopInstaller/Scoop/issues/4292)) - **decompress**: `Expand-7zipArchive` only delete temp dir / `$extractDir` if it is empty ([#6092](https://github.com/ScoopInstaller/Scoop/issues/6092)) - **commands**: Handling broken aliases ([#6141](https://github.com/ScoopInstaller/Scoop/issues/6141)) +- **scoop-install**: Prevent installation of Scoop itself ([#6158](https://github.com/ScoopInstaller/Scoop/issues/6158)) ### Code Refactoring diff --git a/libexec/scoop-install.ps1 b/libexec/scoop-install.ps1 index 0fadcff09d..8cfb711182 100644 --- a/libexec/scoop-install.ps1 +++ b/libexec/scoop-install.ps1 @@ -59,6 +59,13 @@ try { if (!$apps) { error ' missing'; my_usage; exit 1 } +# Prevent installation of Scoop itself +foreach ($app in $apps) { + if (($app -eq 'scoop') -or ($app -match '.*/scoop$')) { + abort "ERROR: You cannot install Scoop via 'scoop install'" + } +} + if ($global -and !(is_admin)) { abort 'ERROR: you need admin rights to install global apps' }