From 3e55a70971c5ff0d035daa54ca5dfab95dfaaa1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F?= Date: Mon, 2 Sep 2019 19:38:30 +0800 Subject: [PATCH 1/2] docs(readme): Improve installation instructions (#3600) --- README.md | 18 +++++++++++------- bin/install.ps1 | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7bdc53a2fd..2e965f4a58 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,13 @@ If you've built software that you'd like others to use, Scoop is an alternative ## Installation -Run this command from your PowerShell to install scoop to its default location (`C:\Users\\scoop`) +Run the following command from your PowerShell to install scoop to its default location (`C:\Users\\scoop`) ```powershell -iex (new-object net.webclient).downloadstring('https://get.scoop.sh') +Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') + +# or shorter +iwr -useb get.scoop.sh | iex ``` Once installed, run `scoop help` for instructions. @@ -76,19 +79,20 @@ The default setup is configured so all user installed programs and Scoop itself Globally installed programs (`--global`) live in `C:\ProgramData\scoop`. These settings can be changed through environment variables. -### Install Scoop to a Custom Directory +### Install Scoop to a Custom Directory by changing `SCOOP` ```powershell $env:SCOOP='D:\Applications\Scoop' [Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User') -iex (new-object net.webclient).downloadstring('https://get.scoop.sh') +# run the installer ``` -### Configure Scoop to install global programs to a Custom Directory +### Configure Scoop to install global programs to a Custom Directory by changing `SCOOP_GLOBAL` ```powershell $env:SCOOP_GLOBAL='F:\GlobalScoopApps' [Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine') +# run the installer ``` ## [Documentation](https://github.com/lukesampson/scoop/wiki) @@ -146,11 +150,11 @@ The following buckets are known to scoop: The main bucket is installed by default. To add any of the other buckets, type: ``` -> scoop bucket add bucketname +scoop bucket add bucketname ``` For example, to add the extras bucket, type: ``` -> scoop bucket add extras +scoop bucket add extras ``` ## Other application buckets diff --git a/bin/install.ps1 b/bin/install.ps1 index 51fa4549b6..781ba03a40 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -1,7 +1,7 @@ #Requires -Version 5 # remote install: -# iex (new-object net.webclient).downloadstring('https://get.scoop.sh') +# Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') $old_erroractionpreference = $erroractionpreference $erroractionpreference = 'stop' # quit if anything goes wrong From 85d0961191508627c49b7ffde9fdc5665298797e Mon Sep 17 00:00:00 2001 From: Richard Kuhnt Date: Fri, 18 Oct 2019 13:20:58 +0200 Subject: [PATCH 2/2] fix(install): Allow installing specific version if latest is installed --- libexec/scoop-install.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/scoop-install.ps1 b/libexec/scoop-install.ps1 index a4ab77362e..70441506ed 100644 --- a/libexec/scoop-install.ps1 +++ b/libexec/scoop-install.ps1 @@ -72,8 +72,8 @@ if (is_scoop_outdated) { } if ($apps.length -eq 1) { - $app, $null, $null = parse_app $apps - if (is_installed $app $global) { + $app, $null, $version = parse_app $apps + if ($null -eq $version -and (is_installed $app $global)) { return } }