Can I script a Cygwin install to include certain packages?

前端 未结 3 1173
南笙
南笙 2020-12-23 21:06

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

相关标签:
3条回答
  • 2020-12-23 21:22

    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.

    0 讨论(0)
  • 2020-12-23 21:23

    apt-cyg is similar to what I was looking for, although it requires a pre-existing cygwin install with a few non-default packages.

    0 讨论(0)
  • 2020-12-23 21:34

    I don't know if you can script it, but I found a 'how-to' on making a custom package directory and the installer to go with it. This way, you can have all the packages you need and have the installer pre-selected. You can find that article here.

    0 讨论(0)
提交回复
热议问题