Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I script a Cygwin install to include certain packages?

I install cygwin frequently enough that it would be handy to have the process automated. Specifically, I want to be able to specify ahead of time the packages that I want to install, so that I don't have to remember them at install-time. Is there any way to do this?

like image 580
Gabe Moothart Avatar asked Apr 13 '09 20:04

Gabe Moothart


People also ask

How do I select all packages in Cygwin?

Update: In the new Cygwin interface, click the drop-down next to the View label in the top left and select Category. Thanks to simlev for the answer. Next, click the 'Default' next to 'All'. Now all packages are selected!

Where is Cygwin packages stored?

Information on installed packages is kept in the /etc/setup/ directory of your Cygwin installation; if setup.exe cannot find this directory it will act as if you have no Cygwin installation.

How do I see what packages are installed in Cygwin?

The -c option checks the version and status of installed Cygwin packages. If you specify one or more package names, cygcheck will limit its output to those packages, or with no arguments it lists all packages. A package will be marked Incomplete if files originally installed are no longer present.


1 Answers

Yes, you can. Assuming you haven't installed Cygwin yet, bash isn't available, so you have to use a CMD script. Here's an example:

setup-x86.exe ^ --quiet-mode ^ --packages ^ aria2,^ atool,^ autoconf,^ ... xmlstarlet,^ zip 

and add other packages to the list. The caret (^) character at the end of every line is the line continuation character in CMD scripts. The list of package names is comma-delimited, which is what the --packages option expects, although that's not documented.

You can run setup-x86.exe --help, or see the Cygwin FAQ, to read about the available command line options for setup.

If you name this script, say, setup.bat or setup.cmd, and put it in the same directory as setup-x86.exe, then you can run it to get a one-click install of Cygwin with all of the packages you want.

Note also that you'll have to specify the --site and --root options for a fresh install, or it will kick out of "quiet mode" and prompt the user anyway.

like image 156
Andrew Schulman Avatar answered Nov 23 '22 12:11

Andrew Schulman