我可以编写Cygwin安装脚本以包括某些软件包吗?
收藏

我安装cygwin的频率足够高,以使其自动化。具体来说,我希望能够提前指定要安装的软件包,这样我就不必在安装时记住它们。有什么办法吗?

最佳答案

是的你可以。假设您尚未安装Cygwin,则bash不可用,因此您必须使用CMD脚本。这是一个例子:

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.

如果您将此脚本命名为setup.bat或setup.cmd,并将其与setup-x86.exe放在同一目录中,则可以运行该脚本以一键式安装Cygwin,其中包含您所有的软件包想。

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.

    公众号
    关注公众号订阅更多技术干货!