-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to install list of app through scoop . #2289
Comments
You could do this:
and then:
where listOfApps.json is:
|
I am new bi of this scoop things. so please don't mind my question. scoop install https://gist.githubusercontent.com/rasa/b9e8127833004d2afd312cc5fddfa7b5/raw/listOfApp.json can we give some alias name for this app " https://gist.githubusercontent.com/rasa/b9e8127833004d2afd312cc5fddfa7b5/raw/listOfApp.json " like listOfApp. it will be more readable. so we can directly use the command like scoop install listOfApp. and in url section of the listOfApp.json what is noop.cmd ? how can we put some other abc.cmd file on this location. how can we put here user defined url like "url": "https://xyz.com/hareramcse/abc.cmd", i want to make user defined url here. please help me. Thanks |
You can do:
then:
|
after doing all the mentioned steps i am getting error. once i execute this command scoop install listOfApp.json i get this error Couldn't find manifest for 'listOfApp.json' please help me. |
Why not just write a bulk install script using |
Or simply create a @echo off
scoop bucket add extras
scoop bucket add java
scoop install extras/eclipse-sdk maven java/oraclejdk Edit: changed to batch script |
it will be lengthy to write all the app name each and every time whenever we need to install it. it will be fine to write if there are 2 or 3 app but suppose if we need to install more than 10 or 20 app for a particular role then we need to write all the app each and every time. that's why i wanted to sort it in one line. so that we can add all the app name in one list and we can directly install that list and it will install all the app associated with it. i tried above mentioned way but i get error. Couldn't find manifest for 'listOfApp.json'. |
Make a small |
could you guys provide a simple working example for this type of requirement. would appreciate the help. |
Perhaps we should allow:
or perhaps we should remove the requirement that a manifest have a version/url, if it has a Or both. |
@r15ch13 i just tested my example and it installed the 3 apps from the 3 buckets |
Only if they where added beforehand 😛 |
Sorry, I don’t follow. I have never installed any of the 3 apps on this box. |
@rasa when you try to install a meta package (like your listOfApp.json example) on a new machine (like @hareramcse is probably trying to use scoop) then it will not work because the buckets are not added. So you have to write a script to add the buckets anyway. This diminishes the use of meta package. The batch from my #2289 (comment) above should do the trick. |
@r15ch13 Of course, you’re right. But we might want |
There should be a batch install support. When I work on a new machine, I run |
You can use this in source system:
And then, in target:
And also, for "unknown" buckets: https://gist.github.com/nuno-andre/77f2b1adf42f29005045c04f0ed8d059 |
Thanks, it worked. |
Posting a fix to @nuno-andre 's code, as it missed some buckets and applications I had (which contained dashes in their name). scoop export | select-string '\) \[(.+)\]$' |% { $_.matches.groups[1].value } | select -unique > buckets.txt
scoop export | select-string '^(.+)\W\(v:' |% { $_.matches.groups[1].value } > apps.txt However, I would preferred the output of scoop export to not be string based, but object based, since this is PowerShell. EDIT (Nov 4th 2019): Code UPDATED, read comments belowSo I rolled my own version (which is now part of my FreshInstall.ps1 script: # add a scoop alias, to create a collection of objects:
scoop alias add 'export-ps' 'param([string[]]$filter,[switch]$WithPath)
scoop export | sls ''^(.+)\W\(v:(.+)\)( \*global\*)? \[(.+)\]$'' |% {
$local:p=$_.matches.groups;
if($filter -and $p[1].value -notin $filter){return};
$local:r = [ordered]@{
AppName=$p[1].value;
Version=$p[2].value;
Scope=if($p[3].value){"Global"}else{"Local"};
Bucket=$p[4].value
};
if($WithPath){
$r.AppPath=$(($local:tmp = scoop info $p[1].value) | sls "Installed:" | % { Join-Path (Split-Path -Parent (($tmp[$_.LineNumber].Replace(" *global*","")).Trim())) "current" })
};
[PSCustomObject]($r)
}' To grab relevant data from it, like in the examples posted before me $appList = scoop export-ps
$appList | Select-Object -Unique -ExpandProperty Bucket
$appList.AppName The object list can be saved into any format, for example json or clixml: scoop export-ps | ConvertTo-Json | Out-File scoop-export.json
# or
scoop export-ps | Export-Clixml scoop-export.clixml Which is easily imported back into an object: $appList = Get-Content scoop-export.json | ConvertFrom-Json
# or
$appList = Import-Clixml scoop-export.clixml After importing the object back, instructing scoop to install everything would be very similar to the example by @nuno-andre : $appList | Select-Object -Unique -ExpandProperty Bucket | % { scoop bucket add $_ }
$appList.AppName | % { scoop install $_ } Anyway - scoop is an amazing tool regardless of my wishes. |
Oops, dashes. Good catch! I don't really care too much about versions because I always install latest version, but indeed your fixes add robustness and reproducibility. It would be a better format for exports than the current one. |
I've updated the code in my alias command above just now. I've also added 2 parameters to the Aliases,
Example invocation: $appList = scoop export-ps -Filter processhacker,sysinternals -WithPath An example output for
* I set my This allows me to create easier automation around scoop based installations. |
I wrote a script to export scoop installed buckets and softwares to an installing script. $buckets = (scoop bucket list)
$knownBuckets = (scoop bucket known)
Push-Location
$output = $buckets | ForEach-Object {
$outputBucket = $_
if ($_ -notin $knownBuckets) {
Set-Location $env:SCOOP\buckets\$_
$outputBucket += ' ' + (git config --get remote.origin.url)
}
$outputBucket = 'scoop bucket add ' + $outputBucket
$outputBucket
}
Pop-Location
$sofwares = (scoop export)
$output += 'scoop install ' + ($sofwares | ForEach-Object { $_.split(' ')[0] })
$output | Out-File -FilePath 'install-scoop-softwares.ps1' -Encoding utf8
Write-Output $output |
When trying to import the buckets, I get following error for every "unknown" bucket. (used dodorz’ bucket in example)
The entries in the file are all in the format When trying to import manually it works. Does PowerShell have issues to read the url or is it a user error? |
see ScoopInstaller/Scoop#2289 (comment) for full details
I have a requirement where I have to install bunch of app for a particular role.
As an example for developer i need to install eclipse, maven, jdk……… so i want to pack all the related app for a particular role in one list and would like to install this list like bellow.
Scoop install listOfApp.
If I execute above command in powershell it should install all the app which I have added in the list.
How can I do this ??
Help is much appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: