Creating an installer via command line / through Jenkins "Execute Batch Command"
Solution 1
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.
Solution 2
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.
Solution 3
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.
Solution 4
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.
Sagar
I'm a software engineer, working as part of an Infrastructure & Tools Team. My main interests are in Python, C, and C++ development, and continuous integration methodologies (including infrastructure tools such as Jenkins). I also love refactoring old/legacy software.
Updated on June 11, 2022Comments
-
Sagar almost 2 years
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.
-
Sagar over 12 yearsThanks! I'll have a look at that. Setup will be manual in any case, since we do not yet deploy directly, so as long as building is command line, all good.
-
Sagar over 12 yearsThanks! The toolset for VS is definitely a plus.
-
DDK about 11 yearsWe have a list of process to manually build an application on InstallShield like click on start->programs->InstallShield, Select file->open choose a file. select build Wizard,Enter name, click next button etc.. Can we automate this process using batch file and use it in Jenkins?
-
Dave Bacher about 11 years@DDK Yes, see my update for details. You'll need a Jenkins builder on the machine with InstallShield, and the values for ProjectConfig and ReleaseConfig will be specific to your InstallShield project.
-
jalanga almost 6 yearsCan Jenkins be installed on a Linux Server and run Inno Setup?
-
Bernard almost 6 years@jalanga Not sure, never tried, but it might be possible as long as Inno Setup is supported in a Linux environment. I'm not sure that it is though.