Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


[Enhancement] Chocolatey should build a packages.config as you install #67

AnthonyMastrean opened this Issue · 23 comments

In regards to bennage's comments on #31, Chocolatey could build your machine's packages.config as you install or update items. This way, it could also track what was installed with other sources (ruby gems, webpi, etc).

You might figure out a way to do a one-time scan of the Chocolatey packages on the machine to get started.


Freakin awesome idea. :D


This would be a very cool feature. Maybe also have the ability to import packages.config files into your main one: e.g. packages.essentials.config, packages.systools.config, packages.devtools.config in order to share bundles of packages between developers.


I'm using chocolatey to install utils on a new dev machine at work, i'd love it if I could get a file of everything I installed into my dropbox folder so that next time I have to build a dev box I can use this as check list. I might also find it useful when installing something on my desktop and then later needing it on my laptop.


In addition to having this at the machine level, I think it would be very useful to create lists of packages at the gallery level - see my issue at NuGet/NuGetGallery#521


@jasondenizac It's fine to put issues on NuGet gallery, but keep in mind that Chocolatey and are separate projects. Having the nuget gallery add it would be awesome, but sometimes things are quicker to get added to and pointed to later. See this PR: NuGet/NuGetGallery#525


What happened to this idea? I was just looking for a way to create a packages.config file on one machine so that I could share with others.


@gep13 Thanks!


That is great news! :-)


Any update on this? It would be great to use a parameter to specify if we want to install it (much like npm)

cinst thepackage --save

If --save is just a flag param then it saves to ./packages.config but you could pass a filepath to the --save param for it to save there.


no updates yet, but it will be automatic without a save flag. Folks would want to opt in automatically and opt out by a flag.


There is a workaround for this that @jongalloway came up with recently.


@ferventcoder Do you have a link to the mentioned workaround?


I used a powershell one-liner to script based on the contents of chocolateyinstall\lib:

(ls "$env:ChocolateyInstall\lib" | select basename).basename | % {'cinst ' + $_.split('\.')[0]}  | sort -unique

If you want to comment / fork, the gist is here:

@ferventcoder ferventcoder added v0.9.11 and removed v0.9.9 labels

This feature would be awesome! Coming soon I hope! :-)


A tool has been proposed here:!topic/chocolatey/VKm1ARnzOcg

That does something similar.


I've just started using Chocolatey and I think this would be a fantastic feature to have! Thanks @jongalloway for the workaround too.


I know this is not exactly what you're going for with this request, but here is a powershell command you can run to kinda accomplish your goal

"choco install",((clist -l | % {$_ -replace '^(\S*)\s.*$','${1}'} | select -Skip 1 | select -first (((clist -l | % {$_ -replace '^(\S*)\s.*$','${1}'} | measure).Count)-2)) -join " ") -join " " | Out-File -FilePath cinst.bat -Encoding ascii

edited to output the bat file as ascii

then just take the cinst.bat that it generates and copy it to another machine (install chocolatey on the new machine first though!)

please pardon my ridiculous inefficiency with powershell and inconsistent use of syntax.

Also note that @jongalloway posted a solution that unfortunately won't work if you have packages like dotnet3.5 because it stips out the .5


this accomplishes basically the same thing as above (if using old chocolatey the sting length in file.write() should be corrected)...


@aronovgj yeah i didn't think about that, im using 0.9.9


sorry, edited it a few times. i actually meant my own script :)


I suppose another good thing to consider would be this;

Chocolatey 0.9.9 stopped using version numbers in the lib folder naming, so if you run that command i posted and then delete all the subfolders from lib and then run the bat file it'll kinda "clean" the folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.