ScoopInstaller / Install

📥 Next-generation Scoop (un)installer
https://get.scoop.sh
The Unlicense
742 stars 94 forks source link

Can't do side-by-side installations? #37

Closed milnak closed 1 year ago

milnak commented 1 year ago

Description

Trying to do side by side installation.

I installed scoop using the default instructions.

Now I'm trying to do a local scoop install (just for the games bucket) using:

mkdir scoop-games

cd scoop-games

Invoke-RestMethod get.scoop.sh -OutFile 'install.ps1'

$cd = (Get-Location).Path

.\install.ps1 -ScoopDir "$cd\.scoop" -ScoopGlobalDir "$cd\.scoop-global"

but it fails with Scoop is already installed.

Installation Logs

VERBOSE: -------- PSBoundParameters --------
VERBOSE: [ScoopDir, D:\scoop-games\.scoop]
VERBOSE: [ScoopGlobalDir, D:\scoop-games\.scoop-global]
VERBOSE: -------- Environment Variables --------
VERBOSE: $env:USERPROFILE: C:\Users\jeffm
VERBOSE: $env:ProgramData: C:\ProgramData
VERBOSE: $env:SCOOP:
VERBOSE: $env:SCOOP_CACHE:
VERBOSE: $env:SCOOP_GLOBAL:
VERBOSE: -------- Selected Variables --------
VERBOSE: SCOOP_DIR: D:\scoop-games\.scoop
VERBOSE: SCOOP_CACHE_DIR: D:\scoop-games\.scoop\cache
VERBOSE: SCOOP_GLOBAL_DIR: D:\scoop-games\.scoop-global
VERBOSE: SCOOP_CONFIG_HOME: C:\Users\jeffm\.config
Initializing...
Scoop is already installed. Run 'scoop update' to get the latest version.    
PowerShell Context
Name                           Value
----                           -----
PSVersion                      7.3.1
PSEdition                      Core
GitCommitId                    7.3.1
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Possible Solution

Allow side by side installs?

rashil2000 commented 1 year ago

Scoop checks for the availability of the scoop command before installing. You can remove the ~\scoop\shims directory from your PATH variable so that it is not found.

milnak commented 1 year ago

wont that end up changing $env:PATH to have the local folder though? I don't want that -- I want this folder to work independently.

One thing I was thinking would be that scoop would check for a .scoop folder in the current directory (or any parent directory), and if it exists, it would use that folder (rather than ~/scoop) for all of its configuration and data.

This way one could have a repo like:

c:\my_project
  \.git
  \.scoop
  \src

and within c:\my_project\src run scoop install git (or whatever else) and get a git installed solely for the c:\my_project subfolder.

rashil2000 commented 1 year ago

You can put the Scoop folder you want above the existing one in env:PATH's priority