通过命令行/通过 Jenkins“执行批处理命令”创建安装程序
我们使用 Jenkins 进行 CI。
我有一个在 Windows 中构建的项目,使用 CMake 2.8.4 和 VS2010 (NMake Makefiles)。构建完成后,我们手动压缩文物以提供给人们。如果可能的话,我想通过 Jenkins 创建一个安装包,而不必压缩所有内容。
有谁知道一个可以完全命令行工作的安装程序,这样我就可以将命令放在 Jenkins“执行批处理命令”窗口中?有人这样做过吗?您使用什么安装程序创建器?希望在免费/开源领域寻找一些东西。
We use Jenkins for CI.
I have a project that is built in Windows, using CMake 2.8.4 and VS2010 (NMake Makefiles). Once the build is complete, we manually zip up the artefacts to give to people. I would like to create an installation package via Jenkins if possible, instead of having to zip up everything.
Does anyone know of an installer that can work completely command line, so I can put the command in the Jenkins "Execute Batch Command" window? Has anyone done this? What installer-creator are you using? Hopefully looking for something in the free/open-source arena.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我通过 Jenkins 使用 Inno Setup 取得了很大成功。它是 Windows 的免费安装程序。安装文件是通过脚本创建的,并且在执行这些脚本来创建安装文件时可以使用命令行参数。 Inno Setup 脚本可以添加到源代码控制存储库中以跟踪更改,同时也使 Jenkins 可以访问它们。
I've used Inno Setup through Jenkins with much success. It is a free installer for Windows. Installation files are created via scripts and command-line arguments can be used when executing these scripts to create installation files. Inno Setup scripts can be added to your source control repository for tracking changes, while also making them accessible to Jenkins.
我们使用 Nullsoft 脚本安装系统 (NSIS),并让 Jenkins 调用存储库中的批处理文件来构建我们的安装程序。 NSIS 二进制文件也存储在存储库中,无需在构建服务器上安装任何内容。 NSIS 配置是一个文本文件,看起来像这样(来自 NSIS 简单教程):
到目前为止,它已经一直工作得很好。配置语言有点不寻常,但并不太难掌握,而且结果稳定且可预测。安装和网站上有大量示例和教程。
We use Nullsoft Scriptable Install System (NSIS), and have Jenkins call a batch file in the repository to build our installer. The NSIS binaries are also stored in the repository, no need to install anything on the build server. The NSIS configuration is a text file, looking something like this (from NSIS Simple Tutorials):
So far it has been working perfectly. The configuration language is a little unusual, but it is not too hard to grasp and the result is stable and predictable. There are plenty of examples and tutorials in the installation and on the web site.
我们使用 WiX 工具集 创建 Windows Installer 包 (MSI)。它是开源的。
所有工具都是命令行,我们从 Ant 脚本调用它们。 MSI无需用户参与即可安装,可用于测试。
WiX Toolset 还有一个 Visual Studio 插件 - Votive。
有一个关于如何使用 WiX 创建安装的很好的教程。
We used WiX Toolset to create an Windows Installer package (MSI). It is open source.
All the tools are command line and we called them from an Ant script. MSI can be installed without user being involved, which could be used for testing.
WiX Toolset also has a plugin to Visual Studio – Votive.
There's a good tutorial on how to create installs using WiX.
我们运行 InstallShield 作为批处理命令来构建 Windows 安装程序。打包的设置过程完全由 GUI 驱动,但您可以从命令行构建安装程序包。不过InstallShield并不是免费的。
InstallShield 配置是一个二进制文件,因此很难看出每次构建都发生了什么变化。
更新:在我们的实现中(使用InstallShield 2011),有一个带有两个参数的Jenkins作业:
ProjectConfig
和ReleaseConfig
。 Jenkins 作业检查包含Project.ism
的 InstallShield 项目并运行:您可以通过运行
IsCmdBld -?
或在 InstallShield 文档中获取有关命令行选项的更多详细信息。We run InstallShield as a batch command to build a Windows installer. The setup process for the packaging is entirely GUI driven, but you can build the installer package from the command line. InstallShield is not free though.
The InstallShield configuration is a binary file, so it's hard to see what's changed from build to build.
Update: In our implementation (using InstallShield 2011), there's a Jenkins job with two parameters,
ProjectConfig
andReleaseConfig
. The Jenkins job checks out the InstallShield project including theProject.ism
and runs:You can get more details on the command line options by running
IsCmdBld -?
or in the InstallShield documentation.