**Data matters, please review** This is a rework of #2891 #2890 and #2882 . This will also fix #2724 and fix #2900 , close #2779 **Introduction** I add a function called `unlink_persist_data($dir)`, which recursively unlink all junction/hard link in the given directory. This affects some sub-commands which have interaction with junction/hard link: - `scoop-install`: the persisting logic has been improved as follow: 1. if there are data in the `persist` folder, also in app(`source`) folder, rename that one located in app folder (e.g. app's default setting files) with a `original` suffix, then create link from `persist` to app 2. if there are data in the `persist` folder, but no in app(`source`) folder, just create link from `persist` to app 3. if there is no data in the `persist` folder (e.g. fresh install), but there are data in app(`source`) folder (e.g. app's default setting files), we will just use that default setting files as the first-time persisting. So move that files from app folder to `persist` folder, then create link from `persist` to app 4. But what if if there is neither data in the `persist` folder (e.g. fresh install), nor in the app(`source`) folder (e.g. setting files will be created after first startup, like `Everthing.db`). We need to create empty persisting target in the `persist` folder. But by default we can't know if a persisting target is a file or a directory (e.g. `conf.d`). So we create a directory by default, and to avoid this, manifest maintainers should use `pre_install` to manually create the source file before persisting. - `scoop-reset`: `reset` command uses the logic of `install`, but there is a problem: before re-persisting data, there have been `junction/hard link` in the app(`source`) folder. It will throw an exception of file exists #2724 . To fix this, we should unlink all old link before re-persisting, using `unlink_persist_data`. - `scoop-uninstall`: `Remove-Item` can not remove `NTFS junction`, we need to unlink all persistting data, before uninstalling/deleting an app, but keeping persisting data. - `scoop-cleanup`: like `uninstall`, `Remove-Item` can not remove `NTFS junction`, we need to unlink all persistting data, before deleting old versions of an app. Before PR #2882 , it use `fsutil.exe` to unlink junction, which is not friendly to restricted users (#2832 and #2881 ). Beyond the logic improvement, there is a new feature now: it supports sub-folder data persisting, like: ```json { "homepage": "https://scoop.sh", "description": "A dummy manifest for scoop tests.", "license": "Freeware", "version": "1.1.0", "url": "https://get.scoop.sh", "pre_install": [ "if (!(test-path \"$dir\\dummy.txt\")) { new-item -force \"$dir\\dummy.txt\" -itemtype file | out-null }", "if (!(test-path \"$dir\\dummydir\")) { new-item \"$dir\\dummydir\" -itemtype directory | out-null }", "if (!(test-path \"$dir\\subdir\")) { new-item \"$dir\\subdir\" -itemtype directory | out-null }", "if (!(test-path \"$dir\\subdir\\subdummydir\")) { new-item \"$dir\\subdir\\subdummydir\" -itemtype directory | out-null }", "if (!(test-path \"$dir\\subdir\\subdummy.txt\")) { new-item -force \"$dir\\subdir\\subdummy.txt\" -itemtype file | out-null }", ], "persist": [ "dummy.txt", "dummydir", "subdir\\subdummydir", "subdir\\subdummy.txt" ] } ``` So no need to strip directories of source for target anymore. To participate in the code review and tests, go visit https://github.com/h404bi/scoop-persist-test for test cases.
Scoop

Scoop is a command-line installer for Windows.
Requirements
- Windows 7 SP1+ / Windows Server 2008+
- PowerShell 3 (or later) and .NET Framework 4.5+
- PowerShell must be enabled for your user account e.g.
set-executionpolicy remotesigned -s currentuser
Installation
Run this command from your PowerShell to install scoop to its default location (C:\Users\<user>\scoop)
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Once installed, run scoop help for instructions.
The default setup is configured so all user installed programs and Scoop itself live in C:\Users\<user>\scoop.
Globally installed programs (--global) live in C:\ProgramData\scoop.
These settings can be changed through environment variables.
Install Scoop to a Custom Directory
[environment]::setEnvironmentVariable('SCOOP','D:\Applications\Scoop','User')
$env:SCOOP='D:\Applications\Scoop'
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Configure Scoop to install global programs to a Custom Directory
[environment]::setEnvironmentVariable('SCOOP_GLOBAL','F:\GlobalScoopApps','Machine')
$env:SCOOP_GLOBAL='F:\GlobalScoopApps'
What does Scoop do?
Scoop installs programs from the command line with a minimal amount of friction. It tries to eliminate things like:
- Permission popup windows
- GUI wizard-style installers
- Path pollution from installing lots of programs
- Unexpected side-effects from installing and uninstalling programs
- The need to find and install dependencies
- The need to perform extra setup steps to get a working program
Scoop is very scriptable, so you can run repeatable setups to get your environment just the way you like, e.g.:
scoop install sudo
sudo scoop install 7zip git openssh --global
scoop install aria2 curl grep sed less touch
scoop install python ruby go perl
If you've built software that you'd like others to use, Scoop is an alternative to building an installer (e.g. MSI or InnoSetup)—you just need to zip your program and provide a JSON manifest that describes how to install it.
Documentation
Multi-connection downloads with aria2
Scoop can utilize aria2 to use multi-connection downloads. Simply install aria2 through Scoop and it will be used for all downloads afterward.
scoop install aria2
You can tweak the following aria2 settings with the scoop config command:
- aria2-enabled (default: true)
- aria2-retry-wait (default: 2)
- aria2-split (default: 5)
- aria2-max-connection-per-server (default: 5)
- aria2-min-split-size (default: 5M)
Inspiration
What sort of apps can Scoop install?
The apps that install best with Scoop are commonly called "portable" apps: i.e. compressed program files that run stand-alone when extracted and don't have side-effects like changing the registry or putting files outside the program directory.
Since installers are common, Scoop supports them too (and their uninstallers).
Scoop is also great at handling single-file programs and Powershell scripts. These don't even need to be compressed. See the runat package for an example: it's really just a GitHub gist.
Support this project
If you find Scoop useful and would like to support ongoing development and maintenance, here's how:
- PayPal (one-time donation)