Below, you can find answers to frequently asked questions on InstallBuilder. We also have an online Knowledge Base that is searchable, and we are constantly working to expand its contents.
Please note that InstallBuilder and InstallBuilder for Qt are functionally the same, so the below FAQs apply to both InstallBuilder versions. Currently, the only difference between the two is that InstallBuilder for Qt can generate installers that have a Qt-themed front-end, so they look native on KDE.
If you can't find the answers to your questions below, in the InstallBuilder User Guide (PDF), or in our Knowledge Base, please contact our support department by completing our online form or sending an email to support@bitrock.com.
After downloading the binary file, change the permissions to allow execution. You can either right-click on the file and select Properties from your desktop environment or issue the following command line :
$ chmod +x
installbuilder-4.0.0-linux-installer.bin |
You are ready to install the software by clicking on it from your desktop environment or by typing :
$
./installbuilder-4.0.0-linux-installer.bin |
To complete the installation, just follow the instructions on screen.
topIf you get the following error while trying to run the installer from the command line:
Installer payload initialization failed. This is likely due to an incomplete or corrupt downloaded
file.
The file was probably not downloaded correctly and you will need to download it again. We have found this problem happens intermittently when using recent versions of the Mozilla browser on Debian unstable.
topThis is happening because you are forwarding the X session over ssh. Make sure you have:
ForwardX11Trusted yes
in ~/.ssh/config and /etc/ssh_config
This is happening because you are running SELinux and it is interfering with the in-memory decompressor used by InstallBuilder. To temporarily disable SELinux, you can execute the following command as root
/usr/sbin/setenforce 0
and then execute InstallBuilder.
To reenable SELinux:
/usr/sbin/setenforce 1
This is happening because the version of the GTK GUI libraries that InstallBuilder is using is not exactly the same as the one installed in your system. You can disregard this warning, as the installer should work correctly in most cases.
topBitRock InstallBuilder has been designed to create installers that will run out of the box in virtually any Linux distribution. In rare ocassions, a certain combination of system libraries and X-Window server setup may cause the installer to crash. If that occurs, you may want to try running in different modes:
./installer-name.bin --mode xwindow
or
./installer-name.bin --mode text
In any case, please report the issue so it can be addressed.
topAre you running the installer from a network or shared drive? This may cause a delay of 20 - 30s when starting the installer.
topThe format of BitRock InstallBuilder project files is XML. This makes it easy to manipulate with scripts and integrate in source control systems. The XML structure of the file and naming of tags has been designed to be human-friendly, meaning that it is easy to edit by hand as well. In fact, many of our customers prefer to do so, especially for complex projects. You can see a sample installer project in the Appendix of the documentation included with the product.
topRegular single-file installers from our competitors require extracting the contents first, and then installing the software. For big programs, this doubles space requirements in the target system, slows execution and can cause problems if the user does not have enough space in the partition holding the /tmp directory. BitRock installers do not have these issues, allowing for faster startup and installation times.
topYou can perform a silent installation, using the --mode unattended option from the command
line:
$
./sample-installer.bin --mode unattended |
This will perform an unattended installation that will not prompt the user for any information. Any required information can be passed to the installer using command line switches. This mode allows for easy integration of the installer into your own scripts.
Unattended mode can also be used to easily integrate with the Ant build tool.
topThe text installation mode is only available on Unix platforms. It
will be automatically used if no graphical mode is available (for
example, when running the installer on a server without an X-Window
installation). You can also force a text-based installation in those
platforms using the --mode text option from the command
line:
$
sample-installer.bin --mode text |
If you use this option in Windows, the installation will be performed in unattended mode.
topYes. The best installation method available is automatically detected at startup time. If no X-Window server is detected, the installation will switch to text mode.
topYes, you can create CDROM installers that share files among installers. Select "Multiplatform CDROM" as "Build Platform" in the "Packaging screen" of InstallBuilder. You also have the option of running the installation from the CD automatically.
topYes, most of BitRock InstallBuilder Features are available through the GUI. However, many of our customers mention that they are equally comfortable editing the XML files by hand. A hand-edited project file can safely be imported into the GUI project and your changes will be preserved.
topYes, the XML-based project file format enables source control integration, collaborative development and customizing projects both by hand and using external scripts.
topYes, BitRock InstallBuilder has a command line interface that allows you to automate and integrate installer creation with your own build process. If you want to build installers from the command line for different platforms, use:
$
path/to/installbuilder/bin/builder build /path/to/project.xml |
You can specify the target platform to build the installer for. This allows you to generate installers for all platforms from a single build environment. For example, you can generate a Windows installer while running on Linux with the following command line:
$
path/to/installbuilder/bin/builder build project.xml windows |
You can specify any of the following values for platform: linux, windows, osx, solaris-sparc, solaris-intel, linux-x64, linux-ia64, linux-ppc, linux-s390, freebsd5, freebsd6, freebsd, freebsd4, openbsd3, hpux, aix, irix-n32, and cdrom.
topBitRock installers serve a different purpose than RPMs. RPMs are designed and optimized to package applications for a particular distribution. BitRock Installers are designed to allow the same software package to be installed across all Linux distributions.
Additionally, RPMs do not allow interaction with the end-user and require root privileges to install any kind of application. BitRock installers allow full interaction with the end-user in graphical, text and unattended modes.
There are scenarios where integration with the underlying package management system can be desirable. BitRock can provide support for generating RPM installers from a BitRock XML project file and integrating with the RPM database at installation time. Please email us if you are interested in these capabilities.
topBitRock installers are self-contained binary executables files with no external dependencies.
topBitRock InstallBuilder can generate native installers that run on virtually all platforms in use today:
Please contact us if you need additional platform support.
topYes, it does. Because there are differences in how paths are specified on Windows and Unix, we recommend the use of forward slashes instead of backslashes to avoid compatibility issues if you are planning to share the same project file among multiple platforms.
topIt means that absolute paths specified in the installer project file will be relativized when saving. The paths will be relative to the location of the project file. This is especially useful when the same project file is shared by multiple developers on different machines or when using the same project file on Windows and Unix (because of the differences in how paths are specified on each platform).
topYou cannot use html files directly as Readme or License files because their content has to be displayed in multiples modes, including text. On Unix, you can easily convert your html file into text using:
$ lynx -dump
license.html > license.txt |
Yes, but because of the differences in how paths are specified on each platform, if you share the same project.xml among different platform, you have to activate the "save relative paths" option.
topLet's say you want to use c:\myapp-4.0 for Windows and
/usr/local/myapp-4.0 for Unix as the default installation directory.
In InstallBuilder, go to "Customization" screen and then to the "Installer"
tab. Specify /usr/local/${product_shortname}-${product_version} as
Installation Directory and Save the project.xml file.
Now edit your project.xml file with your favorite text editor and replace
the line <preInstallationActionList/> with this code:
<preInstallationActionList>
<setInstallerVariable>
<name>installdir</name>
<value>${env(SYSTEMDRIVE)}/${product_shortname}-
${product_version}</value>
<ruleList>
<compareText>
<text>${platform_name}</text>
<logic>equals</logic>
<value>windows</value>
</compareText>
</ruleList>
</setInstallerVariable>
</preInstallationActionList>
|
Remember that if you choose /usr/local as the destination for your
application you have to require that the installation is performed as the root
user.
${product_shortname} and ${product_version} are installer variables. You can find the complete list of the default installer variables available and their meaning in the product documentation included with InstallBuilder.
topYou can create an update installer using the
<installationType>update</installationType> |
The difference between using <installationType>normal</installationType> and <installationType>update</installationType> is that with second type no uninstaller will be created and on windows, no Start menu group will be either created.
top/path/to/installbuilder/output. However, you can choose a different
location using the <outputDirectory> tag like in the following
example:
<outputDirectory>/home/user/myInstallers</outputDirectory> |
Yes. In order to avoid compatibility issues, we recommend that you always use forward slashes, rather than backslashes, in your paths.
topTo enable RPM support add <registerWithPackageDatabase>1</registerWithPackageDatabase> to your project file. This will register your installation with the RPM database and allow you to query, uninstall, etc. your application using the rpm command line tool. You will need to install as root in an RPM based distribution for this to work, otherwise the setting will be ignored.
To successfully register an RPM, the following tags must be also present in the XML project file:
<vendor>
<summary>
<release>
<description> |
Yes. To specify different components, you have to add <allowComponentSelection>1</allowComponentSelection> to your project.xml. Then, you can add different components inside the componentList section of your installer project file. The components defined will be shown to the user. For example, you may use:
<componentList>
<component>
<name>default</name>
<description>My Application</description>
<canBeEdited>1</canBeEdited>
<detailedDescription>My application detailed description
</detailedDescription>
<selected>1</selected>
<show>1</show>
<folderList>
.....
</folderList>
</component>
<component>
<name>database</name>
<description>Database application</description>
<canBeEdited>1</canBeEdited>
<detailedDescription>Detailed database description
</detailedDescription>
<selected>0</selected>
<show>1</show>
<folderList>
......
</folderList>
</component>
</componentList>
|
You can enable/disable components from the command line using the following options:
--enable-components name1,name2,name3
--disable-components name1,name2,name3
where name1, name2,... are the names inside the <name> tag of
components. Component names are case sensitive.
It is often necessary to determine whether a component has been selected in order to show additional pages or execute certain actions. You can do accessing a special variable: ${component(componentname).selected}
You will need to substitute componentname with the specific component's name
topYou can add your own messages to the instalation log using the <logMessage> action. This can be useful when debugging your installation
<logMessage text="Value of
hostname is ${hostname}" /> |
Java(tm)-based installers require either a JVM on the target system, or bundling a JVM with the installer. If your application is not Java(tm)-based, you will need to add the JVM to run the installer (even though your application itself does not require it.) That means more than 14Mb overhead on average.
Additionally, you may not have control over the JVM installed by the user. This can create multiple installation issues due to incompatibilities.
Finally, all of our installers provide native look-and-feel and integration for all supported platforms, providing an excellent end-user experience.
topYes! In fact, more than 50% of our clients use InstallBuilder to distribute Java(tm)-based applications. BitRock InstallBuilder includes a set of features specifically designed for Java(tm) developers such as JVM autodetection.
topIf you do not want the autodetection action to exit after throwing an error, you can just add:
<abortOnError>0</abortOnError> |
inside the <autodetectJava> action tag. If you want to throw your own custom message, you can also add a <customErrorMessage> tag.
Alternatively, you can add a <showMessageOnError>0</showMessageOnError> so it will fail silently and then, later in the installer you can show a specific installation page or issue a custom <showWarning> action based on the presence of the environment java_version.
topYes, we offer free, full-featured licenses for open source projects that meet the following requirements:
Please contact us at info@bitrock.com if you are interested in using our installers for your open source project.
topYes, there is a 50% discount on renewals made within 30 days of the expiration of a license.
topNo, you do not have to renew your license if you are happy with your current version. We are constantly adding new features to InstallBuilder, though, so we recommend that you renew your license so that you can take advantage of new functionality added after your license expires. An active license also entitles you to keep receiving support and bugfixes.
topBy default, BitRock installers use a set of installer environment variables. These variables contain data for the installation project that will be substituted for their values at runtime.
You can set and read all of the installation parameters using installer environment variables. For example, if you display the following text in one of the installer's page:
The software will be installed in ${installdir}
if the user selects "/opt/installbuilder" as the installation directory, then the text will be rendered as :
The software will be installed in /opt/installbuilder
You can find the complete list of the default installer environment variables and their meaning in the Advanced Functionality section of the product documentation included with InstallBuilder.
Installer environment variables are not related to the system environment variables. Those can be accessed using the ${env(varname)} construct, as explained below.
topYou can access any system environment variable using the ${env(varname)} construct, where varname is the name of a system environment variable. For example, on Windows you can refer to the system drive with ${env(SYSTEMDRIVE)} and in Unix to the user home directory with ${env(HOME)}
topNo, installer environment variables are not case sensitive. You can
access the value of the installdir installer environment variable using either
${installdir} or ${INSTALLDIR}.
If the installation directory is in a different drive that the one the installer file is you need to use:
cd /s ${installdir}
You can create custom environment installer variables using a <setInstallerVariable> action. For example:
<setInstallerVariable>
<name>serverport</name>
<value>3306</value>
</setInstallerVariable> |
The code above will create an installer environment variable called
serverport, which can later be referred to as
${serverport}. Wherever it appears, it will be substituted for its
value during installation.
Check that the icon is pointing to the correct image file. The image may be present in your system, but not be referenced correctly.
topThis is likely to be happening because you hardcode the path to the image or executable to the location of the files in your system, and do not include those files as part of your installation.
Make sure you include the file the shortcut points to and the image or
icon the shortcut is using as part of your installation. Make sure they are
referenced as ${installdir}/path/to/image.png so the right path is specified
once installed. On Unix, make sure also that if the target is an executable, it
has the right permissions (chmod +x filename).
It may be that your script requires a specific working directory. If you find this issue, you can try passing the working directory to the script, and cd into it before running. As exec argument when creating the shortcut put :
${installdir}/example
Then, inside script add the following line at the
beginning, after #!/bin/sh:
cd $1
That will cd into the correct directory before executing the rest of the script.
topYou can use the QuickBuild button to avoid rebuilding an installer from scratch if you are just making changes to installer-specific settings, such as: license and readme file, default installation path, logo image, installation required by root, product name and version, and so on. Those settings will be updated without having to pack every product file again.
You will need to follow the normal build process if you make changes to the product files themselves (the ones you added in the Files screen.)
The QuickBuild feature is intended to make interactive development of installers easier, especially of large installers containing many files. When creating installers for release to others, you should use always use the regular build function.
topSometimes, it is desirable to change the name or location of the uninstaller, for example to avoid it from being overwritten if two different products are installed in the same base directory. You can use the uninstallerName and uninstallerDirectory tags for this purpose.
<uninstallerDirectory>${installdir}/subdir</uninstallerDirectory>
<uninstallerName>myuninstaller</uninstallerName>
|
When creating a new project, InstallBuilder automatically created an uninstallation shortcut. If you change the location of the uninstaller, you must remember to also change the path to the uninstaller inside this shortcut.
topYou can avoid creating a Start Menu group by creating an empty one:
<startMenuGroupName></startMenuGroupName> |
You can ask the user:
You can also validate user input using a validationActionList as explained here.
topYes! You can specify required inputs by adding new parameters to the <parameterList> section in the project file. There are different kind of parameters to ask the user for a string, a file, yes/no questions, and so on. Each one of this parameters will in turn be represented appropriately in each of the installation modes. For example, a yes/no question will be presented in the GUI interface as a couple of radiobuttons and in the text interface as a text prompt [y/n] question. The installer will also create corresponding command line options for each one of the defined parameters.
topYou can ask the user for a password during installation using a password parameter. You will have to include a section like the one below inside the parameterList section of your XML installer project file.
<passwordParameter>
<name>anonpasswd</name>
<title>Title of my password page</title>
<description>Please specify a password</description>
<descriptionRetype>Retype the password</descriptionRetype>
<explanation>Text to explain what the
password will be used for</explanation>
<ask>yes</ask>
<width>40</width>
</passwordParameter> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can request a text string from the user during installation using a string parameter. You will have to include a section like the one below inside the parameterList section of your xml installer project file.
<stringParameter>
<name>hostname</name>
<default>localhost</default>
<title>Application Server</title>
<value></value>
<ask>1</ask>
<description>Hostname</description>
<explanation>Please enter the hostname for
your application server.</explanation>
</stringParameter> |
This will create an installer environment variable called hostname
that will contain the string introduced by the user. You can later
refer to the value of that variable using ${hostname}.
Click here to download a sample project.xml file that integrates this functionality.
topYou can direct the installer to ask the user to enter a file or directory using a file or directory parameter. You will have to include a section like the following inside the parameterList section of your installer project file.
<directoryParameter>
<name>mydir</name>
<value></value>
<title>Title for you directory page</title>
<description>Some Directory</description>
<explanation>Please specify the directory requested</explanation>
<default></default>
<cliOptionName>prefix</cliOptionName>
<ask>yes</ask>
<mustBeWritable>yes</mustBeWritable>
</directoryParameter> |
This will create an installer environment variable called mydir that
will contain the directory or file introduced by the user. You can
later refer to the value of the variable using ${mydir}.
Click here to download a sample project.xml file that integrates this functionality.
topYou can ask for multiple parameters in the same screen using a parameterGroup parameter, as shown in the example. Please note that parameter groups also need to contain a <name> tag.
<parameterGroup>
<name>userandpass</name>
<explanation>Please enter the username and password for your database.</explanation>
<parameterList>
<stringParameter>
<name>username</name>
<default>admin</default>
<description>Username</description>
</stringParameter>
<passwordParameter>
<ask>yes</ask>
<name>masterpass</name>
<description>Password</description>
<descriptionRetype>Retype password</descriptionRetype>
<explanation>Please provide a password for the database user</explanation>
<cliOptionName>password</cliOptionName>
</passwordParameter>
</parameterList>
</parameterGroup>
|
You can do so setting the orientation property of a parameter group to "horizontal" as shown in the example. This functionality is available only in InstallBuilder 4.2.0 and later.
<parameterGroup>
<name>server</name>
<title>Server Data</title>
<explanation>Please provide the server information</explanation>
<orientation>horizontal</orientation>
<parameterList>
<stringParameter>
<name>address</name>
<description>Address</description>
<value>127.0.0.1</value>
<width>20</width>
</stringParameter>
<stringParameter>
<name>port</name>
<description>Port</description>
<width>4</width>
<value>80</value>
</stringParameter>
</parameterList>
</parameterGroup>
|
You can make the installer ask the user a yes/no question using a boolean parameter. You will have to include a section like the one below inside the parameterList section of your XML installer project file.
<booleanParameter>
<name>createdb</name>
<ask>yes</ask>
<default>1</default>
<title>Database Install</title>
<explanation>Should initial database structure
and data be created?</explanation>
<value>1</value>
</booleanParameter> |
This will create an installer environment variable called createdb that will contain the
value "1" if the user answered "yes"
or the value "0" if the user answered "no" to the question. You can
later refer to the content of the variable using ${createdb}.
Click here to download a sample project.xml file that integrates this functionality.
topYou can display a read-only text information page to the user using an info parameter. You will have to include a section like the one below inside the parameterList section of your XML installer project file.
<infoParameter>
<name>serverinfo</name>
<title>Web Server</title>
<explanation>Web Server Settings</explanation>
<value>Important Information! In the following screen you will
be asked to provide (...)</value>
</infoParameter> |
This will create an installer environment variable called serverinfo
that will contain the text displayed. You can later refer to the
content of the variable using ${serverinfo}.
Click here to download a sample project.xml file that integrates this functionality.
topYou can direct the user to select a value among a predefined list of values using a choice parameter. You will have to include a section like the one below inside the parameterList section of your XML installer project file. In GUI mode, it will be represented by a combobox. In text mode the user will be presented with a list.
<choiceParameter>
<ask>1</ask>
<default>http</default>
<description>Which protocol?</description>
<explanation>Default protocol to access the login page.</explanation>
<title>Protocol Selection</title>
<name>protocol</name>
<optionList>
<option>
<value>http</value>
<text>HTTP (insecure)</text>
</option>
<option>
<value>https</value>
<text>HTTPS (secure)</text>
</option>
</optionList>
</choiceParameter> |
This will create an installer environment variable called protocol
that will contain the value of the text selected by the user. You can
later refer to the content of the that variable using ${protocol}. In
this example, if the user selects HTTP (unsecure), the variable
protocol will contain the value http.
Click here to download a sample project.xml file that integrates this functionality.
topYou can validate user input adding a <validationActionList> to the parameter, as explained here.
For example, adding the following code to the 'installdir' parameter, will prevent the user from selecting a directory that contains a space.
<validationActionList>
<throwError>
<text>This directory path can not contain spaces</text>
<ruleList>
<compareText>
<text>${installdir}</text>
<logic>contains</logic>
<value> </value>
</compareText>
</ruleList>
</throwError>
</validationActionList> |
This will create an installer environment variable called protocol
that will contain the value of the text selected by the user. You can
later refer to the content of the that variable using ${protocol}. In
this example, if the user selects HTTP (unsecure), the variable
protocol will contain the value http.
Click here to download a sample project.xml file that integrates this functionality.
top<cliOptionName> stands for Command Line Interface Option Name. You can use it to pass the value of that parameter to the installer using the text or the unattended mode. For example, if you have defined a parameter like:
<stringParameter>
<name>hostname</name>
<cliOptionName>host</cliOptionName>
<default>localhost</default>
<title>Application Server</title>
<value></value>
<ask>1</ask>
<description>Hostname</description>
<explanation>Please enter the hostname for your
application server.</explanation>
</stringParameter> |
$ sample-1.0-installer.bin --mode unattended --host myhostname
If no <cliOptionName> tag is defined, you can use the name of the parameter directly.
topYou can show images during installation using the <slideShowImageList> section as in the following example:
<slideShowImageList>
<slideShowImage><path>image1.png</path></slideShowImage>
<slideShowImage><path>image2.png</path></slideShowImage>
<slideShowImage><path>image3.png</path></slideShowImage>
<slideShowImage><path>image4.png</path></slideShowImage>
</slideShowImageList> |
Sometimes it is desirable to show additional pages after installation has finished and before the final page is displayed. You can do so by adding the following to the appropriate parameter section:
<insertAfter>installation</insertAfter> |
You can perform string substitutions with the substitution action. This action allows you to specify pattern/value pairs that will be substituted in certain files. It takes a list of glob file patterns separated by ';' and a list of the pattern/value pairs.
<substitute>
<files>*/launcher/launchMyJavaApp.sh;*/bin/*.sh</files>
<substitutionList>
<substitution>
<pattern>@@INSTALLDIR@@</pattern>
<value>${installdir}</value>
</substitution>
<substitution>
<pattern>@@JAVADIR@@</pattern>
<value>${installdir}/jre</value>
</substitution>
</substitutionList>
</substitute> |
Suppose the user sets /home/user/application as installdir and the
original launchMyJavaApp.sh looked like:
#!/bin/sh
export MYAPPDIR=@@INSTALLDIR@@
@@JAVADIR@@/bin/java com.some.class.Name
|
Then the script will look like the following after installation:
#!/bin/sh
export MYAPPDIR=/home/user/application
/home/user/application/jre/bin/java com.some.class.Name
|
Click here to download a sample project.xml file that integrates this functionality.
You can find more information about this action in Actions section of the product documentation included with InstallBuilder.
topSometimes your installer will bundle text files with different end-of-line characters than the platform you are installing to understands
You can convert plain text files in DOS/MAC format to Unix format with the dos2unix action.
<dos2unix>
<files>*/*.sql;*/*.sh;*.ascii</files>
</dos2unix> |
Click here to download a sample project.xml file that integrates this functionality.
You can find more information about this action in the Unix manual page for the dos2unix command.
topYou can set Unix permissions for some files or directories using changePermissions action. You will have to include a section like the one below inside an action list section of your XML installer project file.
<changePermissions>
<files>*/*.sh;*/*.bin</files>
<permissions>755</permissions>
</changePermissions> |
The permissions are expressed in octal format. Please see the chmod manual page for details on how permissions work in Unix.
By default, when building an installer on a Unix platform, the installer will preserve the permissions of the files being packed, so the above will not be necessary in most cases.
Click here to download a sample project.xml file that integrates this functionality.
topYou can create a system environment variable using a addEnvironmentVariable action. You will have to include a section like the one below inside an action list section of your XML installer project file. On Unix platforms, the variable will be added to any of the shell configuration files: ~/.bashrc, ~/.profile. On Windows, the environment variable will be created in the registry.
<addEnvironmentVariable>
<name>MYAPP_HOME</name>
<value>${installdir}</value>
</addEnvironmentVariable> |
Note that in Unix, the effect will not take place until the user logs in again.
Click here to download a sample project.xml file that integrates this functionality.
topYou can add a directory to the system PATH using an addDirectoryToPath action. You will have to include a section like the one below inside an action list section of your XML installer project file. On Unix platforms, the value will be added to the PATH definition in the shell configuration files: ~/.bashrc, ~/.profile. On Windows, the environment variable will be created in the registry.
<addDirectoryToPath>
<path>${installdir}/bin</path>
</addDirectoryToPath> |
Click here to download a sample project.xml file that integrates this functionality.
You can remove a directory from the system PATH using a removeDirectoryFromPath action. You will have to include a section like the one below inside an action list section of your XML installer project file, usually the postUninstallationActionList section. On Unix platforms, the directory will be added to the PATH definition in the shell configuration files: ~/.bashrc, ~/.profile. On Windows, the environment variable will be created in the registry.
<removeDirectoryFromPath>
<path>${installdir}/bin</path>
</removeDirectoryFromPath> |
You can append text at the end of a file using an addTextToFile action. You will have to include a section like the one below inside an action list section of your XML installer project file.
<addTextToFile>
<file>${installdir}/bin/environment.sh</file>
<text>export JAVA_HOME=${installdir}/jre
export PATH=$JAVA_HOME/bin:$PATH</text>
</addTextToFile> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can make the installer display an error message to the user if certain conditions are met using a throwError action. Those conditions are expressed by rules as explained in the conditional evaluation chapter of the product documentation included with InstallBuilder.
If used inside a parameter <validationActionList> section, an error message will be displayed to the user and the user will be prompted again for the required information.
If used in any other action list section, such as <preInstallationActionList>, it will display an error message to the user and the application will exit.
The following example code, when placed in <preInstallationActionList> will throw an error and abort the installation if the Apache configuration file is not writable by the current user:
<throwError>
<text>The Apache configuration file is not writable by
the current user</text>
<ruleList>
<fileTest>
<path>/usr/local/apache/conf/httpd.conf</path>
<condition>not_writable</condition>
</fileTest>
</ruleList>
</throwError> |
Click here to download a sample project.xml file that integrates this functionality.
topYes, you can make the installer autodetect whether or not there is an existing Java(tm) installation in the system by using an <autodetectJava> action. If a suitable Java(tm) is found, the action will also create a number of variables, described later on. This action is usually placed at the <preInstallationActionList> and if no valid JRE or JDK is found, the installer will abort with an error listing the supported JREs and JDKs.
The following example will select any Sun Microsystems JRE 1.3 or newer (for example, 1.3, 1.4, 1.5) or any IBM JRE with version number equal or greater than 1.4.2 but inside the 1.4 series (1.5 will not work at this time).
<autodetectJava>
<validVersionList>
<validVersion>
<vendor>sun</vendor>
<minVersion>1.4.2</minVersion>
<maxVersion>1.4</maxVersion>
</validVersion>
<validVersion>
<vendor>ibm</vendor>
<minVersion>1.3</minVersion>
<maxVersion></maxVersion>
</validVersion>
</validVersionList>
</autodetectJava> |
Each element in the <validVersionList> contains the following fields:
Upon successful autodetection, the following installer variables will be created :
/usr/bin/java, C:\Program
Files\Java\j2re1.4.2_03\java.exe.Click here to download a sample project.xml file that integrates this functionality.
topYou can do that by adding <promptUser> to the above example as shown below.
<autodetectJava>
<validVersionList>
<validVersion>
<vendor>sun</vendor>
<minVersion>1.4.2</minVersion>
<maxVersion>1.4</maxVersion>
</validVersion>
<validVersion>
<vendor>ibm</vendor>
<minVersion>1.3</minVersion>
<maxVersion></maxVersion>
</validVersion>
</validVersionList>
<promptUser>1</promptUser>
</autodetectJava> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can create a new registry key or modify the value of an existing registry key using a <registrySet> action. You will have to include a section like the one below inside an action list section of your XML installer project file.
<registrySet>
<key>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Control\Session Manager\Environment</key>
<name>MY_APPDIR</name>
<value>${installdir}</value>
</registrySet> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can store the value of a registry key in an installer variable using a <registryGet> action. If the key or name does not exist, then the variable created will be empty. You will have to include a section like the one below inside an action list section of your XML installer project file.
<registryGet>
<variable>installdir</variable>
<key>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Control\Session Manager\Environment</key>
<name>MY_APPDIR</name>
</registryGet> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can delete a registry key using a <registryDelete> action. If the key to delete does not exist, the action will be ignored. You will have to include a section like the one below inside an action list section of your XML installer project file.
<registryDelete>
<key>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
\Control\Session Manager\Environment</key>
<name>MY_APPDIR</name>
</registryDelete> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can change the owner and group of a file or directory using a <changeOwnerAndGroup> action. Because these changes require administrative privileges, you will need to require installation by the administrator. You will have to include a section like the one below inside an action list section of your XML installer project file.
<changeOwnerAndGroup>
<files>*/somefile.conf;*/var/somefile</files>
<owner>nobody</owner>
<group>nobody</group>
</changeOwnerAndGroup> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can create a symbolic link using a <createSymbolicLink> action. You will have to include a section like the one below inside an action list section of your XML installer project file.
<createSymLink>
<linkName>${installdir}/bin/somelinkname</linkName>
<target>${installdir}/bin/somefile</target>
</createSymLink> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can create or set the value of an installer variable from the output of a script or program using a <setInstallerVariableFromScriptOutput>. You will have to include a section like the one below inside an action list section of your XML installer project file.
<setInstallerVariableFromScriptOutput>
<name>myhostname</name>
<exec>hostname</exec>
<execArgs>-f</execArgs>
</setInstallerVariableFromScriptOutput> |
That code will create an installer environment variable called myhostname that will store the output thrown by the program hostname. You can later refer to the content of that variable using ${myhostname}.
Click here to download a sample project.xml file that integrates this functionality.
topYes, you can run a program as part of the installation of your application with InstallBuilder by using a <runProgram> action. You will have to include a section like the one below inside an action list section of your XML installer project file.
<runProgram>
<program>${installdir}/utils/scripts/init_db.bat</program>
<programArguments></programArguments>
</runProgram> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can make the installer perform certain actions based on a set of rules using an <actionGroup> section. This will execute more than one action based on the same set of rules. See the conditional evaluation section in the documentation for details on rule-based execution of actions.
You will have to include a section like the one below inside an action list section of your XML installer project file.
<actionGroup>
<actionList>
<setInstallerVariable>
<name>installapache</name>
<value>1</value>
</setInstallerVariable>
<setInstallerVariable>
<name>installtomcat</name>
<value>1</value>
</setInstallerVariable>
</actionList>
<ruleList>
<compareText>
<text>${installtype}</text>
<logic>equals</logic>
<value>server</value>
</compareText>
</ruleList>
</actionGroup> |
Click here to download a sample project.xml file that integrates this functionality.
topWith rule lists you can control whether certain actions take place, pages are shown or files are installed.
Rule lists can be included in action, parameter and folder sections. Each <ruleList> contains a set of rules or conditions that are evaluated, and depending on the result, the action is executed, the page associated with the parameter shown or the folder installed.
topThere are two logic operands rules: and, or. Those operand have to be specified in a <ruleEvaluationLogic> section. <ruleEvaluationLogic> sections can be used inside action, parameter or folder sections. By default, rules are evaluated with 'and' logic.
topEach ruleList can contain one or more <compareText>, <fileTest> or <fileContentTest> sections.
<compareText> text comparison rules can contain three fields :
Example:
<compareText>
<text>${server}</text>
<logic>equals</logic>
<value>Apache</value>
</compareText> |
<fileTest> file testing rules contain two fields :
Example:
<fileTest>
<path>/usr/bin/perl</path>
<condition>executable</condition>
</fileTest> |
<fileContentTest> file content testing rules contain three fields :
Example:
<fileContentTest>
<path>/etc/group</path>
<logic>contains</logic>
<text>apache</text>
</fileContentTest> |
The following example shows how a particular script will be executed only if the installation type is 'server', it is running on Linux and a certain file is not already present in the system. The value for the installation type was set during the installation process using a user-defined parameter, as explained earlier in this document.
<runProgram>
<ruleEvaluationLogic>and</ruleEvaluationLogic>
<ruleList>
<compareText>
<text>${installtype}</text>
<logic>equals</logic>
<value>server</value>
</compareText>
<compareText>
<text>${platform_name}</text>
<logic>equals</logic>
<value>linux</value>
</compareText>
<fileTest>
<path>/etc/init.d/myservice</path>
<condition>not_exists</condition>
</fileTest>
</ruleList>
<program>${installdir}/bin/install_service.sh</program>
</runProgram> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can view the free disk space available for your application using a <getFreeDiskSpace> action. This action will retrieve the amount of disk space available on the drive partition holding a particular directory. The directory is specified in the 'path' argument and the value (in Kb) will be stored in the variable specified by 'variable'. For example:
<getFreeDiskSpace>
<variable>diskspace</variable>
<path>${installdir}</path>
</getFreeDiskSpace> |
You can backup a file or directory using a <backupFile> action as in the following example:
<createBackupFile>
<path>${installdir}/conf/myapp.conf</path>
</createBackupFile> |
This action creates a new file or directory, named after the path specified, with the suffix .bak0. If a backup file with that name already exists, it will create a new one ending in .bak1 (or .bak2, etc.)
topYes. You can delete a file or directory as part of your application installation using a <deleteFile> action as in the following example:
<deleteFile>
<path>/tmp/mytempfiles*.*</path>
</deleteFile> |
You can copy a file or directory as part of an installation using a <copyFile> action as in the following example:
<copyFile>
<origin>${installdir}/conf/myfile.template</origin>
<destination>${installdir}/conf/myfile.conf</destination>
</copyFile> |
You can configure the installer to inform the user but not cancel
installation after an error is found running an action using the
<runProgram>
<program>${installdir}/bin/myapp</program>
<programArguments>argument1 argument2</programArguments>
<abortOnError>0</abortOnError>
<showMessageOnError>1</showMessageOnError>
</runProgram> |
You can launch an application in the background (so InstallBuilder
will not wait for it to finish) by adding & as the final argument of
the
<finalPageActionList>
<runProgram>
<program>${installdir}/bin/myapp</program>
<programArguments>&</programArguments>
<progressText>Do you want to launch ${product_fullname} now?
</progressText>
</runProgram>
</finalPageActionList> |
You can rename a file or directory as part of the installation process by using a <renameFile> action, as shown in the following example:
<renameFile>
<origin>${installdir}/conf/myfile.template</origin>
<destination>${installdir}/conf/myfile.conf</destination>
</renameFile> |
An action list is a list of actions that will be executed individually. There are several types of action lists that are executed at different points of the installation.
An actionGroup is a group of actions that will be executed based on a common set of rules.
topYou can remove a main Windows registry key using a <registryDelete> action without specifying any <name> and without a final \ in the <key> value. For example:
<registryDelete>
<key>HKEY_LOCAL_MACHINE\SOFTWARE\My Software
\${product_fullname}\${product_version_short}</key>
</registryDelete> |
You can add <rebootRequired>1</rebootRequired> to the project XML file and at the end of installation, the installer will ask the user if they want to restart. If they select "yes", the computer will be restarted.
topDuring installation of certain applications, such as server side softwate, you may want to allow the user to select a TCP/IP port. It is common to check whether that port is already in use or not. You can use the <portTest> rule to do just that, as shown in the example below. The application will not allow the end user to continue unless he chooses a free port. Remember that in Unix systems, root privileges are required to bind to ports less than 1024.
<stringParameter>
<name>tomcatport</name>
<title>HTTP Port</title>
<description>Tomcat HTTP Port</description>
<explanation>Please enter the port for your Tomcat server.</explanation>
<value>8080</value>
<default>8080</default>
<allowEmptyValue>1</allowEmptyValue>
<ask>1</ask>
<cliOptionName></cliOptionName>
<width>40</width>
<validationActionList>
<throwError>
<text>Unable to bind to the given port number. Please select another one.</text>
<ruleList>
<portTest>
<condition>cannot_bind</condition>
<port>${tomcatport}</port>
</portTest>
</ruleList>
</throwError>
</validationActionList>
</stringParameter>
|
When you specify a README file using the GUI builder or the <readmeFile> setting in the project XML, the user will be presented with an option to display it in the final installation page. Starting with version 4.2.0, you will also be able to display text pages using the <showText> action.
topYou can use a <launchBrowser> action inside a <finalPageActionList>, as shown in the example below. You can control the text displayed using the <progressText> tag.
<finalPageActionList>
<launchBrowser url="http://example.com/congratulations/"
progressText="Visit Example website." />
</finalPageActionList>
|
You can direct the installer to perform actions before installation starts by using the <preInstallationActionList> section. For example, the following code will set a different installation directory depending on the platform the installer is running on.
<preInstallationActionList>
<setInstallerVariable>
<name>installdir</name>
<value>${env(SYSTEMDRIVE)}/${product_shortname}</value>
<ruleList>
<compareText>
<text>${platform_name}</text>
<logic>equals</logic>
<value>windows</value>
</compareText>
</ruleList>
</setInstallerVariable>
<setInstallerVariable>
<name>installdir</name>
<value>/usr/local/${product_shortname}</value>
<ruleList>
<compareText>
<text>${platform_name}</text>
<logic>equals</logic>
<value>linux</value>
</compareText>
</ruleList>
</setInstallerVariable>
</preInstallationActionList> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can direct the installer to perform some actions after installation is complete by using the <postInstallationActionList> section. The following example makes the installer run different scripts at the end of the installatiion process depending on whether or not is the root user who is performing the installation.
<postInstallationActionList>
<runProgram>
<program>${installdir}/scripts/root_script.sh</program>
<programArguments>${installdir}</programArguments>
<ruleList>
<compareText>
<logic>equals</logic>
<text>${installer_root_install}</text>
<value>1</value>
</compareText>
</ruleList>
</runProgram>
<runProgram>
<program>${installdir}/scripts/myscript.sh</program>
<programArguments>${installdir}</programArguments>
<ruleList>
<compareText>
<logic>equals</logic>
<text>${installer_root_install}</text>
<value>0</value>
</compareText>
</ruleList>
</runProgram>
</postInstallationActionList> |
Click here to download a sample project.xml file that integrates this functionality.
topYou can direct the installer to perform actions before a page is shown by using a <preShowPageActionList> section. The following example presents the user with information that stored in a registry key under Windows and in an environment variable under Linux.
<infoParameter>
<preShowPageActionList>
<registryGet>
<variable>some_info</variable>
<key>HKEY_LOCAL_MACHINESOFTWARE</key>
<name>MYAPP</name>
<ruleList>
<compareText>
<text>${platform_name}</text>
<logic>equals</logic>
<value>windows</value>
</compareText>
</ruleList>
</registryGet>
<setInstallerVariable>
<name>some_info</name>
<value>${env(SOMEINFO)}</value>
<ruleList>
<compareText>
<text>${platform_name}</text>
<logic>equals</logic>
<value>linux</value>
</compareText>
</ruleList>
</setInstallerVariable>
</preShowPageActionList>
<name>display_info</name>
<title>License File Information</title>
<explanation>This screen shows important information
about licensing issues</explanation>
<value>Important Information! Setup has detected
the following : ${some_info}.
In the following screen you
will be asked to confirm the information or enter a new (...)</value>
</infoParameter> |
You can direct the installer to perform actions after a page is shown by using a <postShowPageActionList> section. The following example sets the value of a registry key with the value specified by the user if the installer is running on Windows, and keeps the same information in an environment variable if the installer is running on Linux.
<fileParameter>
<name>confirmation</name>
<value>${mypath}</value>
<title>Server File Confirmation</title>
<description>Server file</description>
<explanation>Please confirm the information showed below
or introduce
a new value</explanation>
<default></default>
<ask>yes</ask>
<mustBeWritable>yes</mustBeWritable>
<postShowPageActionList>
<registrySet>
<value>${mypath}</value>
<key>HKEY_LOCAL_MACHINESOFTWARE</key>
<name>MYAPP</name>
<ruleList>
<compareText>
<text>${platform_name}</text>
<logic>equals</logic>
<value>windows</value>
</compareText>
</ruleList>
</registrySet>
<setInstallerVariable>
<name>mypath</name>
<value>${mypath}</value>
<ruleList>
<compareText>
<text>${platform_name}</text>
<logic>equals</logic>
<value>linux</value>
</compareText>
</ruleList>
</setInstallerVariable>
</postShowPageActionList>
</fileParameter> |
You can allow the user to start your software in the final installation page using a <runProgram> action inside a <finalPageActionList> as in the following example:
<finalPageActionList>
<runProgram>
<program>${installdir}/bin/myprogram</program>
<programArguments></programArguments>
<progressText>Do you want to launch ${product_fullname} now?</progressText>
</runProgram>
</finalPageActionList> |
You can also customize the text that will be shown to the user on the final installation page with the <progressText> property. That text will be placed beside a checkbox. The user can choose whether or not to run the application by checking the box.
topYou can allow only a limited set of languages to be available at installation time by using the <allowedLanguages> tag in the installer project file.
Available languages are Catalan (ca), Gaelic (cy), Spanish (es), French (fr), Dutch (nl), Brazilian-Portuguese (pt_BR), Romanian (ro), Valencian (va), German (de), English (en), Estonian (et), Hungarian (hu), Italian (it), Japanese (jp), Polish (pl), Portuguese-Portugal (pt), Rusiian (ru), Slovenian (sl), Traditional Chinese (zh_TW), Simplified Chinese (zh_CN).
For example, if you want to allow the installation of your application in English, German and Spanish, check that the Allow Language Selection is activated and add this line to your installer project:
<allowedLanguages>en de es</allowedLanguages> |
You can customize the language used in custom installer page messages using the <customLanguageList> tag, as in the following example:
<customLanguageFileList>
<language>
<code>en</code>
<encoding>iso8859-1</encoding>
<file>pathToLanguageFiles/myapp_en.lng</file>
</language>
<language>
<code>de</code>
<encoding>iso8859-1</encoding>
<file>pathToLanguageFiles/myapp_de.lng</file>
</language>
<language>
<code>fr</code>
<encoding>iso8859-1</encoding>
<file>pathToLanguageFiles/myapp_fr.lng</file>
</language>
</customLanguageFileList> |
myapp_de.lng should be a text file with a format similar to this:
database.title=Datenbank auswälhen
database.explanation=Standard Datenbanken
datatabase.description=Welche Datenbank?
.....
and myapp_en.lng:
database.title=Database Selection
database.explanation=Default database
datatabase.description=Which database?
.....
and so on with the rest of custom language files.
Then, you can for example create a <choiceParameter> page and use:
<choiceParameter>
<ask>1</ask>
<default>oracle</default>
<description>${msg(database.description)}</description>
<explanation>${msg(database.explanation)}</explanation>
<title>${msg(database.title)}</title>
<name>database</name>
<optionList>
<option>
<value>oracle</value>
<text>Oracle</text>
</option>
<option>
<value>mysql</value>
<text>Mysql</text>
</option>
</optionList>
</choiceParameter> |
If you need to display many different parameters in the same installation screens, it may be desirable to change the default GUI installer dimensions. You can do so using the <width> and <height> tags.
<width>600</width>
<height>400</height>
|