Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

[Enhancement] Install multiple packages with single command line #191

Closed
Redsandro opened this issue Nov 6, 2012 · 17 comments
Closed

[Enhancement] Install multiple packages with single command line #191

Redsandro opened this issue Nov 6, 2012 · 17 comments

Comments

@Redsandro
Copy link
Contributor

I come from an Ubuntu environment, and found Chocolately by googling apt-get for windows.

On the introduction page it sais: "Chocolatey is like apt-get, but built with Windows in mind".

However, the FIRST thing that anyone used to apt-get does is make it install multiple packages like so:
cinst app1 app2 app3 (...) app20
Which doesn't work. You have to hack together some XML file called packages.conf to install multiple packages.

Which brings me to the second issue: On error, Chocolately just stops!
You have to remove the finished packages from the XML, including the failed one, and try again. I think Chocolately should just continue going, and mention the failed packages after everything is done.

Otherwise you can never leave your computer unattended and move on to the next one, knowing at least everything that doesn't fail will be installed once you get back.

Perhaps that last annoyance is what is talked about in issue #154, but I am not sure.

@ferventcoder
Copy link
Contributor

@Redsandro Hey thanks for the kudos!
I'm going to clarify the wording for chocolatey - Chocolatey is _like_ apt-get. This doesn't mean that is has every feature or that it is an exact replica of apt-get.

This also doesn't mean that features like this cannot be added. We've discussed this a couple of times in the mailing list, however upon searching it doesn't appear that it was ever made into an Enhancement. We are definitely adding this feature.

Issue 2 - Stopping on Error

The second note, that chocolatey stops on error is not a behavior we want in v1. Please file it as a separate issue.

@ghost ghost assigned mwrock Nov 6, 2012
@ferventcoder
Copy link
Contributor

Also, it's important to note that apt-get is very stable in it's feature set. It's been around for awhile and is a mature product.

Chocolatey on the other hand is not even to v1 yet. It's immature and not stable in it's feature set yet. Something to keep in mind. :D

@Redsandro
Copy link
Contributor Author

Don't get me wrong, I am enthusiastic about this and don't mean to be nitpicky! Ofcourse it's not gonna be apt-get all the way.

But the ease of installing your favourite apps on a clean OS all at once using a single command is arguably one of the most useful and widely used features of a package manager. I've used apt-get, yum, aptitude, pacman and dpkg, and they all do this. I guess I automatically assumed it is expected behavior of a package manager.

Sorry, I am new to this, I just googled around, found chocolately and npackd. One of the reasons I chose chocolately first was because I read it was older, so I didn't really think about not even to v1 yet. :P

(The other reason is that the Chocolately site is much nicer and has terminal support out of the box. Very nice!)

(Admittedly I installed npackd afterwards to install the packages that had failed in chocolately (like Security Essentials) and/or didn't have a 64 bit candidate.)

(Since Chocolately is much nicer, but npackd fails less often, think of the amount of bases that are belong to you if the projects are merged! ;))

@ferventcoder
Copy link
Contributor

Actually I would have to verify, but I believe npackd is older. Chocolately has been around for about a year and a half.

I don't mind nitpicky at all! It's a way we get better. I honestly don't use packages.config that much. I prefer

cinst all -source customsource or to put together a .ps1 file w/separate calls. Both of these mean I install multiple packages w/1 call, but there is setup time involved. If you are in powershell you can create an array of package names and pipe them into the install command. Again, not optimal, but available.

That's why we definitely want the ability to pass in a list and to keep going if one fails.

@ferventcoder
Copy link
Contributor

This lifehacker article about npackd is older by a month than chocolatey: http://m.lifehacker.com/5754305/npackd-is-a-linux+like-package-manager-for-windows

And to avoid confusion, the date of the article is a month before chocolatey development started.

@Redsandro
Copy link
Contributor Author

Hey you are right. It's a wonder I made it through school, I still don't do my homework right. :P

Thanks for the hints. Is powershell different from the normal shell? Could you give an example on how to do the array thing on powershell? It would give me some power before v1 hits the stage.

On Linux it would be:
for N in app1 app2 app3; do cinst $N; done

Now you mention it, I think it's also possible in normal shell (cmd), probably something like this iirc:
FOR %n IN (app1, app2, app3) DO (cinst %n)
(This is a reasonably educated guess, cannot test it, am not on Windows now.)

@Redsandro
Copy link
Contributor Author

By the way, since Chocolately can internally process a list from XML (packages.conf), isn't it relatively easy to implement a feature to use a command-line list?

I imagine the list from XML will end up in an unshifting array or something. I don't know powershell coding but using javascript pseudocode it would be something like this:

// Use command line multiple input if no packages.conf is specified
if (arguments.length > 2) // Multiple packages found
    for (var n=2; n<arguments.length; n++) // From first to last package
        install_array.push(arguments[n]); // Create installation array

Where:

arguments[0] = chocolately install app1 app2 app3
arguments[1] = install
arguments[2] = app1
arguments[3] = app2
arguments[4] = app3

@Redsandro
Copy link
Contributor Author

I updated chocolatey.cmd to allow batch-installation. It just continues with the next when a package fails, which is what we want, because with the batch-xml I used to do it was so annoying that it stopped on error.

Here is the update: #304

@ferventcoder
Copy link
Contributor

Agreed that the xml batch stopping on error is annoying.

@ghost ghost assigned ferventcoder Jun 27, 2013
@ferventcoder
Copy link
Contributor

This is fixed in 6ca7ed1

@ferventcoder
Copy link
Contributor

also in alpha2 prerelease...

@Redsandro
Copy link
Contributor Author

cinst chocolatey -pre

@ferventcoder
Copy link
Contributor

or cup chocolatey -pre

@Redsandro
Copy link
Contributor Author

I noticed I did -beta sometimes before I remembered to do -pre.
Just a thought: Maybe add beta as a synonym for pre?

@ferventcoder
Copy link
Contributor

This sounds reasonable at first glance, however, does it feel natural to say --beta when it installs an alpha or rc?

And .... if there was a beta version and a more recent alpha, wouldn't you want it to install the beta and not the alpha based on the wording of the switch?

@Redsandro
Copy link
Contributor Author

True. I hadn't thought of that. It's not as simple as I thought. Monday half brain day.

@ferventcoder
Copy link
Contributor

My brain is ...... well somewhat fried. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants