我可以脚本化Cygwin安装包括某些包吗? [英] Can I script a Cygwin install to include certain packages?

查看:123
本文介绍了我可以脚本化Cygwin安装包括某些包吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装cygwin的频率足够高,这样可以让进程自动化。具体来说,我想能够提前指定我想要安装的软件包,这样我就不必在安装时记住它们了。有办法做吗?

解决方案

是的,你可以。假设你还没有安装Cygwin,bash不可用,所以你必须使用CMD脚本。例如:

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

并将其他软件包添加到列表中。每行结尾处的插入符号( ^ )是CMD脚本中的行连续字符。包名称的列表以逗号分隔,这是 - packages 选项期望的,虽然没有记录。



您可以运行 setup-x86.exe --help ,或查看 Cygwin常见问题,阅读有关可用的命令行选项进行设置。



如果您命名这个脚本,例如,setup.bat或setup.cmd,并把它放在与setup-x86.exe相同的目录,然后你可以运行它,以获得一个点击安装Cygwin所有的包你想要的。 / p>

请注意,您必须指定 - site - root 命令用于全新安装,否则将会退出安静模式,并提示用户。


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?

解决方案

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 commands for a fresh install, or it will kick out of "quiet mode" and prompt the user anyway.

这篇关于我可以脚本化Cygwin安装包括某些包吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆