Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
Use the credentials of the current user for the proxy server that is specified by the -Proxy parameter.
.PARAMETER RunAsAdmin
Force to run the installer as administrator.
.PARAMETER SkipRobocopy
Do not check existence of robocopy.exe in windows PATH.
Useful for nanocore installations.
.LINK
https://scoop.sh
.LINK
Expand All @@ -60,7 +63,8 @@ param(
[Uri] $Proxy,
[System.Management.Automation.PSCredential] $ProxyCredential,
[Switch] $ProxyUseDefaultCredentials,
[Switch] $RunAsAdmin
[Switch] $RunAsAdmin,
[Switch] $SkipRobocopy
)

# Disable StrictMode in this script
Expand Down Expand Up @@ -129,8 +133,10 @@ function Test-Prerequisite {
}

# Ensure Robocopy.exe is accessible
if (!([bool](Get-Command -Name 'robocopy' -ErrorAction 'SilentlyContinue'))) {
Deny-Install 'Scoop requires ''C:\Windows\System32\Robocopy.exe'' to work. Please make sure ''C:\Windows\System32'' is in your PATH.'
if (!$SkipRobocopy) {
if (!([bool](Get-Command -Name 'robocopy' -ErrorAction 'SilentlyContinue'))) {
Deny-Install 'Scoop requires ''C:\Windows\System32\Robocopy.exe'' to work. Please make sure ''C:\Windows\System32'' is in your PATH.'
}
}

# Detect if RunAsAdministrator, there is no need to run as administrator when installing Scoop.
Expand Down Expand Up @@ -439,6 +445,9 @@ function Add-DefaultConfig {

# save current datatime to lastUpdate
Add-Config -Name 'lastUpdate' -Value ([System.DateTime]::Now.ToString('o')) | Out-Null
if ($SkipRobocopy) {
Add-Config -Name 'core.preferMoveItem' -Value $true | Out-Null
}
}

function Get-AllRequiredFile {
Expand Down