From 31147976acc6ced5f261341f7b10fc4dc528111b Mon Sep 17 00:00:00 2001 From: HUMORCE Date: Sat, 28 Sep 2024 11:31:14 +0000 Subject: [PATCH 1/2] fix(scoop-install): Prevent installation of Scoop itself --- libexec/scoop-install.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) 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' } From 388ddfef5169cd28418c0478b49ef9e8b9b0ba82 Mon Sep 17 00:00:00 2001 From: HUMORCE Date: Sat, 28 Sep 2024 11:35:40 +0000 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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