开发者

Creating an installer via command line / through Jenkins "Execute Batch Command"

开发者 https://www.devze.com 2023-03-28 02:05 出处:网络
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 开发者_StackOverflow中文版artefact

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 开发者_StackOverflow中文版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.


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.


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):

# name the installer
outFile "Installer.exe"

# default section start; every NSIS script has at least one section.
section

# default section end
sectionEnd

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.


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.


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 and ReleaseConfig. The Jenkins job checks out the InstallShield project including the Project.ism and runs:

"\Program Files\InstallShield\2011\System\IsCmdBld.exe" -a "%ProjectConfig%" -r "%ReleaseConfig%" -b "%BuildDir%" -p Project.ism

You can get more details on the command line options by running IsCmdBld -? or in the InstallShield documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号