# Review: Scoop

Simple, clean, and handy command line installer for Windows, built with PowerShell and git.

I have always been a forgiving person when it comes to pop-ups, thanks to the four ad blockers installed on each and every one of my web browsers. However, ad blockers are restricted to web browsing, they are powerless against the pop-ups from the operating system. Of course, being a forgiving person that I am, closing them quietly without complain would be an expected reaction.

But perhaps the sheer number of programs installed, used, and maintained is too great in the modern digital world, or perhaps the rate of updates too frequent (I’m looking at you Adobe Flash Player), it has became a time-consuming chore just to deal with them every day. Not to mention that the pop-ups will break your focus, your workflow, your gaming experience, often at the worst time possible…

Anyway, I spent some time thinking through this problem two days ago. I had a vague recollection of a software called Chocolatey on Windows that claims to provide a solution to managing multiple applications. I even had it installed. So let’s trying using Chocolatey!

But since this post isn’t about Chocolatey, I’ll skip the battle and on to the results.

Chocolatey installs programs to C:\Program Files\. And I hate to pollute Program Files folder, because doing anything within it requires a Run As Administrator pop-up. Installing else where IS a built-in solution, but, unfortunately, a premium one.

So I uninstalled Chocolatey. Hey, I’m not a corporate client they are targeting at.

The other reason I uninstalled chocolatey is that while searching for the said solution, I came across a similar package manager called Scoop.

It’s free.
It doesn’t display any pop-up.
It doesn’t pollute Program Files.
It doesn’t pollute Path in environment variables.

That sounds exactly like what I was looking for!

## What is Scoop#

This is a scoop.

In all seriousness, this is probably what that Scoop is named after, but I digress.

Scoop is a package manager.

A package manager is basically a centralized command line installer. Rather than using a GUI installer provided by the software developer, which takes time to find, to click through the matrices of “Yes” and “Next”, package manager allows us to install packages, another name for programs, automatically from various developers by typing commands in the Terminal, Command prompt, or PowerShell prompt.

Those that use the Unix system are probably using one of them on a daily basis. Think apt-get of Debian, yum of Fedora, or pacman of Arch Linux.

Don’t worry, even if you are not familiar with the command line, I will try to provide an installation and usage walkthrough as thoroughly as possible.

## Sounds Great, Where Do I Start#

Open PowerShell prompt on windows by:

1. Press Win+R on keyboard
2. Type powershell
3. Press Enter

Then make sure you have PowerShell 5.0 or higher by inputting the following command, then press Enter:

$psversiontable.psversion.major  If the returned Version number is lower than 5 (likely on Windows 7), you will have to install it manually from here: Download Windows PowerShell 5.1 With PowerShell 5.0+, first allow PowerShell to execute local scripts: set-executionpolicy remotesigned -scope currentuser  Input y when given options. Then install Scoop. The default installation location of Scoop is at C:\Users\{{Username}}\scoop. If you wish to install it somewhere else, run the following commands after replacing the string {{ScoopPath}} at the end of the first line with the path location you wish to install at (for example C:\scoop): $env:SCOOP='{{ScoopPath}}'
[environment]::setEnvironmentVariable('SCOOP_GLOBAL',$env:SCOOP_GLOBAL,'Machine')  Again, change the {{GlobalAppsPath}} to your desired folder path, such as C:\apps. Feel free to explore the other options as well, but I have yet to find a situation to use them. Use the scoop help install command to see full list of options available. Oh, did I mention that most programs installed by scoop are portable? Meaning that programs have all settings residing inside the program folder, rather than the windows registry. So you can copy the entire program folder to another windows machine, and it will still open without problems. Thus called portable. ### Scoop Bucket# There are something Scoop does not have, for everything else, there’s M@sterCard the Scoop bucket! A bucket, in Scoop’s term, is basically a repository consisting of multiple app manifests. I guess it’s called a bucket because we are dealing with scoop. Not all programs are enlisted in the default main bucket, a list of Scoop buckets can be found in the scoop-directory. The most common one is the scoop-extras, so add that to our Scoop using the following command. scoop bucket add extras  Wait for a while since this bucket contains more than a thousand apps. Now we can install REAPER with Scoop :). ### Scoop List# This command lists all installed apps, displaying their version info, whether they are global installation, and the bucket they were installed from. Since we only have two programs installed, our list is short and clear. As the size grows, displaying the whole list might no longer be helpful in order to find specific packages. In that case, we can give it a query word. For example list all apps with the string ‘zip’ using scoop list zip and it will display 7zip but not git. This command allows us to search installable app(s), optionally by a query word. In essence, scoop search is like scoop list, but including uninstalled apps as well. It lists all available apps (thousands), grouped by the bucket they came from. Here’s an example of scoop search with a query word of zip, listing all available apps that contains the queried string. ### Scoop Uninstall# Quick and easy way to uninstall an app. But do note that anything installed globally has to be removed globally with -g option just like in scoop install. The other option is -p as in purge. This will remove all files that persists between updates. Plus! Scoop can be uninstalled by Scoop itself! Which is many times more convenient than Chocolatey. Compare this simple one-liner from Scoop: scoop uninstall scoop  with this blob from chocolatey if (!$env:ChocolateyInstall) {
Write-Warning "The ChocolateyInstall environment variable was not found. n Chocolatey is not detected as installed. Nothing to do"
return
}
if (!(Test-Path "$env:ChocolateyInstall")) { Write-Warning "Chocolatey installation not detected at '$env:ChocolateyInstall'. n Nothing to do."
return
}

$userPath = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey('Environment').GetValue('PATH', '', [Microsoft.Win32.RegistryValueOptions]::DoNotExpandEnvironmentNames).ToString()$machinePath = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey('SYSTEM\CurrentControlSet\Control\Session Manager\Environment\').GetValue('PATH', '', [Microsoft.Win32.RegistryValueOptions]::DoNotExpandEnvironmentNames).ToString()

@"
User PATH:
$userPath Machine PATH:$machinePath
"@ | Out-File "C:\PATH_backups_ChocolateyUninstall.txt" -Encoding UTF8 -Force

if ($userPath -like "*$env:ChocolateyInstall*") {
Write-Output "Chocolatey Install location found in User Path. Removing..."
# WARNING: This could cause issues after reboot where nothing is
# found if something goes wrong. In that case, look at the backed up
# files for PATH.
[System.Text.RegularExpressions.Regex]::Replace($userPath, [System.Text.RegularExpressions.Regex]::Escape("$env:ChocolateyInstall\bin") + '(?>;)?', '', [System.Text.RegularExpressions.RegexOptions]::IgnoreCase) | %{[System.Environment]::SetEnvironmentVariable('PATH', $_.Replace(";;",";"), 'User')} } if ($machinePath -like "*$env:ChocolateyInstall*") { Write-Output "Chocolatey Install location found in Machine Path. Removing..." # WARNING: This could cause issues after reboot where nothing is # found if something goes wrong. In that case, look at the backed up # files for PATH. [System.Text.RegularExpressions.Regex]::Replace($machinePath, [System.Text.RegularExpressions.Regex]::Escape("$env:ChocolateyInstall\bin") + '(?>;)?', '', [System.Text.RegularExpressions.RegexOptions]::IgnoreCase) | %{[System.Environment]::SetEnvironmentVariable('PATH',$_.Replace(";;",";"), 'Machine')}
}

# Adapt for any services running in subfolders of ChocolateyInstall
$agentService = Get-Service -Name chocolatey-agent -ErrorAction SilentlyContinue if ($agentService -and $agentService.Status -eq 'Running') {$agentService.Stop() }
# TODO: add other services here

# delete the contents (remove -WhatIf to actually remove)
Remove-Item -Recurse -Force "$env:ChocolateyInstall" -WhatIf [System.Environment]::SetEnvironmentVariable("ChocolateyInstall",$null, 'User')
[System.Environment]::SetEnvironmentVariable("ChocolateyInstall", $null, 'Machine') [System.Environment]::SetEnvironmentVariable("ChocolateyLastPathUpdate",$null, 'User')
[System.Environment]::SetEnvironmentVariable("ChocolateyLastPathUpdate", \$null, 'Machine')


You get the picture.

### Scoop Update#

This will update an app, including scoop itself.

By default, as in using scoop update without argument, scoop will update itself with git, and displays all new commit logs that was pushed since the last update. Scoop also updates automatically anytime we install or update an app, along with the buckets that has been added.

We can specify which app(s) to update by adding their names as arguments: scoop update 7zip git. We can also tell scoop to update everything by using the asterisk scoop update *.

Again, globally installed apps must use the -g option in the update command.

## What’s Next#

Now that we are familiar with the basics of Scoop, we can install apps to our heart’s content.

We can replace all those programs installed in C:\Program Files with the ones from Scoop so we can update them all at once at a convenient time, without being bothered by their own notifications.

We can clear the downloaded compressed installer to save hard-drive space by using scoop cache rm <app>, and clearing all cache using the asterisk.

We can remove older versions of installed apps by using scoop cleanup <app>, with global option -g or remove cache option -k mentioned above. Asterisk works for this command as well.

We can prevent app(s) from updating by using scoop hold <apps>, and reverting that using scoop unhold <apps>.

And, of course, what’s a package manager without the ability to automate on multiple systems? Scoop has a command to export apps list to a text file, but I’ve yet to find the way to import from it.

Fortunately, there is an app called scoop-backup that allows simple backup by saving apps list as a .ps1 or a compressed .bat file, and running that file will restore the entire Scoop installation.

One more thing…

Have fun.