我可以编写 Cygwin 安装脚本来包含某些软件包吗?
我经常安装 cygwin,因此将过程自动化会很方便。 具体来说,我希望能够提前指定要安装的软件包,这样我就不必在安装时记住它们。 有什么办法可以做到这一点吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的你可以。 假设您还没有安装 Cygwin,则 bash 不可用,因此您必须使用 CMD 脚本。 这是一个示例:
并将其他包添加到列表中。 每行末尾的脱字号 (
^
) 字符是 CMD 脚本中的行继续字符。 包名称列表以逗号分隔,这是--packages
选项所期望的,尽管没有记录。您可以运行
setup-x86.exe --help
,或查看Cygwin 常见问题解答,了解可用的命令行设置选项。如果您将此脚本命名为 setup.bat 或 setup.cmd,并将其放在与 setup-x86.exe 相同的目录中,那么您可以运行它来一键安装 Cygwin 以及您需要的所有软件包。想。
另请注意,您必须为全新安装指定
--site
和--root
选项,否则它将退出“安静模式”并提示无论如何用户。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:
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.apt-cyg 与我正在寻找的类似,尽管它需要预先存在的 cygwin 安装有一些非默认软件包。
apt-cyg is similar to what I was looking for, although it requires a pre-existing cygwin install with a few non-default packages.
我不知道您是否可以编写脚本,但我找到了有关创建自定义包目录和与之配套的安装程序的“操作方法”。 这样,您就可以获得所需的所有软件包并预先选择安装程序。
您可以在此处找到该文章。
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.