ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
20.95k stars 1.39k forks source link

Current state of installing specific versions? #3045

Closed janpio closed 1 year ago

janpio commented 5 years ago

I am just getting started with using scoop and I think I am in love ❤️

One thing that I found missing was a way to install specific versions of programs.

There is a documented "workaround" with another bucket that works for ruby and python: https://github.com/lukesampson/scoop/wiki/Switching-Ruby-and-Python-Versions But this is also only for major versions and only works for these two special cases.

Then I found https://github.com/lukesampson/scoop/pull/1332 which seems to implement parts of what I was looking for - but closes with "Lets leave this as a bit of a hidden feature for a while. I'll write some docs for it soon enough" (in 2017). There are other issues that mention this syntax, its possible problems and its missing documentation: https://github.com/lukesampson/scoop/issues/2254 ScoopInstaller/Scoop#1780 And here even is an open issue to document this behavior: ScoopInstaller/Scoop#2141

janpio commented 5 years ago

Ok, one "problem" (feature?) seems to be that you generally can not install an older version over a newer version:

PS C:\Users\Jan> scoop install ruby@2.5.1-2
WARN  'ruby' (2.6.0-1) is already installed.
Use 'scoop update ruby' to install a new version.
janpio commented 5 years ago

Another problem seems to be when the current manifest config does not match the path of older download URLs as it was recently changed: https://github.com/lukesampson/scoop/commit/91d9723b08e86a2db4f94e6164b7fa598f42d49c

PS C:\Users\Jan> scoop install ruby@2.5.3-1
WARN  Given version (2.5.3-1) does not match manifest (2.6.0-1)
WARN  Attempting to generate manifest for 'ruby' (2.5.3-1)
Autoupdating ruby
Downloading rubyinstaller-2.5.3-1-x86.7z to compute hashes!
The request was aborted: The connection was closed unexpectedly.
URL https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.3-1/rubyinstaller-2.5.3-1-x86.7z is not valid
Could not find hash!
Could not install ruby@2.5.3-1

New generated path is https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.3-1/rubyinstaller-2.5.3-1-x86.7z, correct one would have been https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.3-1/rubyinstaller-2.5.3-1-x86.7z

(Workaround (?) here was to clone the old manifest, and publish it as a gist that I can use to install: https://gist.github.com/janpio/40e014d0ae31215b4bab2b5bbe5a69e8/3500373c9484ca8c3c89aac4998cda333451a555 + https://gist.githubusercontent.com/janpio/40e014d0ae31215b4bab2b5bbe5a69e8/raw/3500373c9484ca8c3c89aac4998cda333451a555/scoop_ruby_20_to_25.json)

r15ch13 commented 5 years ago

There is also another issue. Every manifest that uses custom capture groups will not work. (Like $matchVersion, $matchHead, $matchMyAwesomeCaptureGroup`) See aria2.json or brotli.json

573 commented 5 years ago

With chrome getting:

current $ scoop install chrome@73.0.3683.68 WARN Given version (73.0.3683.68) does not match manifest (74.0.3729.131) WARN Attempting to generate manifest for 'chrome' (73.0.3683.68) Autoupdating chrome DEBUG[1557912977] $substitutions (hashtable) -> C:\Users\me\scoop\apps\scoop\current\lib\autoupdate.ps1:149:5 DEBUG[1557912977] $substitutions.$buildVersion 68 DEBUG[1557912977] $substitutions.$baseurl https://redirector.gvt1.com/edgedl/release2/chrome/$match32_73.0.3683.68 DEBUG[1557912977] $substitutions.$dashVersion 73-0-3683-68 DEBUG[1557912977] $substitutions.$url https://redirector.gvt1.com/edgedl/release2/chrome/$match32_73.0.3683.68/73.0.3683.68_ch… DEBUG[1557912977] $substitutions.$matchHead 73.0.3683 DEBUG[1557912977] $substitutions.$preReleaseVersion 73.0.3683.68 DEBUG[1557912977] $substitutions.$majorVersion 73 DEBUG[1557912977] $substitutions.$basename 73.0.3683.68_chrome_installer.exe DEBUG[1557912977] $substitutions.$patchVersion 3683 DEBUG[1557912977] $substitutions.$cleanVersion 730368368 DEBUG[1557912977] $substitutions.$minorVersion 0 DEBUG[1557912977] $substitutions.$version 73.0.3683.68 DEBUG[1557912977] $substitutions.$underscoreVersion 73_0_3683_68 DEBUG[1557912977] $substitutions.$matchTail .68 DEBUG[1557912977] $hashfile_url = $null -> C:\Users\me\scoop\apps\scoop\current\lib\autoupdate.ps1:152:5 Downloading 73.0.3683.68_chrome_installer.exe to compute hashes! The remote server returned an error: (404) Not Found. URL https://redirector.gvt1.com/edgedl/release2/chrome/$match32_73.0.3683.68/73.0.3683.68_chrome_installer.exe#/cosi.7z is not valid Could not find hash! Could not install chrome@73.0.3683.68

573 commented 5 years ago

@janpio, it seems just like the checksum ($match32 part) is missing there as well as @r15ch13 pointed out already. Does it make sense as a workaround to factor these out from the manifest? Must confess I am a noobie here.

573 commented 5 years ago

I have a workaround described here until the match-issue is sorted out. Applies to chrome only.

rashil2000 commented 2 years ago

Tracked in ScoopInstaller/Main#3292

ClassicDarkChocolate commented 2 years ago

Current:

> scoop install opentrack@2022.1.1
WARN  Given version (2022.1.1) does not match manifest (2022.2.0)
WARN  Attempting to generate manifest for 'opentrack' (2022.1.1)
Autoupdating opentrack
Downloading opentrack-2022.1.1-portable.7z to compute hashes!
The remote server returned an error: (404) Not Found.
URL https://github.com/opentrack/opentrack/releases/download/opentrack-2022.1.1/opentrack-2022.1.1-portable.7z is not valid
Could not install opentrack@2022.1.1
Select-CurrentVersion: C:\Users\User\scoop\apps\scoop\current\lib\core.ps1:228
Line |
 228 |      return $null -ne (Select-CurrentVersion -AppName $app -Global:$gl …
     |                                                       ~~~~
     | Cannot bind argument to parameter 'AppName' because it is an empty string.

WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
WARN  To disable this warning, run 'scoop config aria2-warning-enabled false'.
Couldn't find manifest for ''.

My workaround through git: https://gist.github.com/ClassicDarkChocolate/4f10ad43e5de4fb103fa2ac5a1727005

Install-ScoopPackage opentrack -Version "2022.1.1"
WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
WARN  To disable this warning, run 'scoop config aria2-warning-enabled false'.
Installing 'opentrack' (2022.1.1) [64bit]
Starting download with aria2 ...
Download: Download Results:
Download: gid   |stat|avg speed  |path/URI
Download: ======+====+===========+=======================================================
Download: 7a3a84|OK  |   4.6MiB/s|C:/Users/User/scoop/cache/opentrack#2022.1.1#https_github.com_opentrack_opentrack_releases_download_opentrack-2022.1.1_opentrack-2022.1.1-win32-portable.7z
Download: Status Legend:
Download: (OK):download completed.
Checking hash of opentrack-2022.1.1-win32-portable.7z ... ok.
Extracting opentrack-2022.1.1-win32-portable.7z ... done.
Linking ~\scoop\apps\opentrack\current => ~\scoop\apps\opentrack\2022.1.1
Creating shim for 'opentrack'.
Creating shortcut for Opentrack (opentrack.exe)
Persisting ini
Running post-install script...
INFO  [Portable Mode] Adding Portable Mode File...
'opentrack' (2022.1.1) was installed successfully!
Get-ScoopPackageVersions opentrack -IncludeDescription
Hash                                     Version  Description
----                                     -------  -----------
6e1c9cba00efb8aa116535ad179619ee8732f89a 2022.2.0 opentrack: Update to version 2022.2.0 (#8475)
9a2b4839fcff6e067b809e0d64e716d16a1aab97 2022.1.1 opentrack: Update to version 2022.1.1
75c10dd2870347a858c4c515300bbf6e870a2891 2022.1.0 opentrack: Use portable configuration (#7764)
8d0caface45481b219cf7f6ac503c2055eb86c66 2022.1.0 opentrack: Update to version 2022.1.0 (#7760)
29e791f7199cac2c338389905f1f218f75882eeb 2021.2.0 opentrack: Update to version 2021.2.0
64152b36fd2ec720b801a8c2afcca175910c935a 2021.1.3 opentrack: Update to version 2021.1.3
f3ed480f34a61388195e61d28d3b9d75234828f2 2021.1.2 opentrack: Update to version 2021.1.2
f53ef196da93e1358494e6713b64cd85f2f53c2f 2021.1.1 opentrack: Update to version 2021.1.1
17350aacc60360dfd91fd442ff7e6cc5802edb6e 2021.1.0 opentrack: Update to version 2021.1.0
b64503227229e2ec2ba7122e8a2db8f4c480d14f 2.3.13   opentrack: Update to version 2.3.13
9e0dd92c4cd7e7590a4cbf4717f4e2c9e02660a8 2.3.12   opentrack: Update to version 2.3.12
1cbce5781679731251eb46ff77d6467b82d78bd0 2.3.11   opentrack: Update to version 2.3.11
85905703f10c691a32a8514e2989dafb2b8c4d2b 2.3.10   Add multiple missing manifest descriptions (#2497)
ff7c24db0945c3e315b74c648d2d4ad51b2820b5 2.3.10   Move all manifest files to bucket subdirectory
Invoke-ScoopPackageCommand info opentrack -CommandArgs "--verbose" -Version "2.3.10"
Name        : opentrack
Description : An application dedicated to tracking user's head movements and relaying the information to games and flight simulation software.
Version     : 2.3.10
Bucket      : extras
Website     : https://github.com/opentrack/opentrack
License     : ISC (https://spdx.org/licenses/ISC.html)
Updated at  : 5/16/2022 19:05:35
Updated by  : tech189
Manifest    : C:\Users\Zack\scoop\buckets\extras\bucket\opentrack.json
Binaries    : opentrack.exe
Shortcuts   : Opentrack
rashil2000 commented 1 year ago

There is also another issue. Every manifest that uses custom capture groups will not work. (Like $matchVersion, $matchHead, $matchMyAwesomeCaptureGroup`) See aria2.json or brotli.json

I don't think there's a meaningful way to solve this problem. The captured variables are populated from the checkver.url, and that URL, at any given time, will only have the latest 'values'.

Using git history is a good workaround to this - https://github.com/ScoopInstaller/Scoop/issues/3894