Installing all of Cygwin unattended
From SarahWiki
This is actually rather harder to do than would immediately appear to be sensible. The first problem is that there is very little documentation available on running Cygwin's setup.exe command with arguments. The second problem is that, whilst there is some level of support for unattended installation, it's a bit halfhearted. In particular, the one thing that really got me was that, even though an automated 'Base-only' install was possible, there appeared to be no way to make it install everything hands off. On examination of the source code, I found this to be actually true.
My first attempted work-around involved adding a simple -all switch to the code, but this seemed to make various things break in non-obvious ways, so I was left with the feeling that the installer code base is a little fragile, so it's probably best not prodded with a stick. Which left me with only one option -- hack the setup.ini file directly to cause it to install everything when the installer thinks it's just installing the base version. As it turns out, this is surprisingly easy to do, though it took a fair bit of hacking to get that far.
The steps necessary are as follows:
- Download setup.exe from the cygwin web site.
- Run the installer conventionally, choosing the options for downloading to a local directory without installing anything. Make sure you have everything set to 'Install' in the choose packages page.
- Run the sed script over the downloaded setup.ini file:
cp setup.ini setup.ini-backup sed "s/[cC]ategory:.*/Category: Base/" < setup.ini > setup.temp cp setup.temp setup.ini
This now leaves you with a 'canned' version of Cygwin that will install from the command line as follows:
setup.exe -q --local-install --root c:\where\you\want\to\put\cygwin -l c:\path\to\installer\directory
Note that the paths you give to setup.exe need to be Windows paths, not Cygwin paths.
