View source | Discuss this page | Page history | Printable version   
Main Page
Upload file
What links here
Recent changes

PDF Books
Add page
Show collection (0 pages)
Collections help


Release Management/Customizing the Setup Tool

Release Management/Internal




The Setup Tool is used in Openbravo ERP for doing the initial configuration in custom and development installations. It provides a comfortable user interface to configure the basic files required by Openbravo ERP to be built and to run properly. This includes information like database connection information or a directory for the ERP attachments.


The Setup Tool offers an easy way for end users to configure all the files required for Openbravo ERP to build and run properly. Currently the files are the following ones:

While all this files contain templates can be copied and configured by hand, it's hard to keep track of all the files that the development team requires users to configure. So the setup tool is always up to date with these changes and provides a simplified way of doing this.

Note that it supports both graphical and command line environments.

General process

The Setup Tool is a binary file that is generated from a XML file. This XML includes a definition of what fields we want to include in each window. And we use a program called BitRock InstallBuilder to build binaries from that XML file. Currently we generate binaries for AIX, FreeBSD (x86 and x86_64), HPUX, Linux (x86, x86_64, IA64 and PPC), OpenBSD, OSX, (open)Solaris (Intel, Sparc) and Windows.

High-level process

Infrastructure setup

The first step to get the environment ready is to install BitRock InstallBuilder. We do not use the latest version of the package, and it is no longer available in the official download website. So ask the Release Management Team to provide you this, if you think you should have it.

Once you have the tar file, uncompress it give it permissions to your everyday user:

$ cd /opt && tar zxvf /tmp/installbuilder.tgz
$ ln -sf installbuilder-5.4.10 installbuilder
$ chown -R johndoe:johndoe /opt/installbuilder

Add it to the PATH of your everyday user (if you use bash, otherwise do the equivalent in your shell):

$ echo "export PATH=$PATH:/opt/installbuilder/bin" > /home/johndoe/.bashrc
$ source $HOME/.bashrc

Then check out the setp tool sources, stored in a Subversion repository:

$ cd $HOME/src/openbravo/erp
$ svn co

XML structure

Now let's analyze the structure of the repository we've just checked out:

 |-- images/ -> Directory containing some png images used in the binary.
 |-- licenses/ -> Directory containing the license used in a window.
 |-- output/ -> Directory where the binaries are stored. Once committed the ant setup task takes the binaries from this URL.
 |-- setup-properties.xml -> XML file that feeds BitRock InstallBuilder to create the final binaries.

The setup-properties.xml file has the following general structure:

   <!-- 1. General information about the installer, like the name, the license, dimensions and images -->
   <fullName>Openbravo ERP</fullName>
   <!-- (..) -->
   <!-- 2. PreInstallation actions, such as getting the current values from the -->
   <!-- (...) -->
   <!-- 3. All the screens of the program, marked in the code with the ''paramenterList'' XML tag -->
   <!-- (...) -->
   <!-- 4. PostInstallation actions, such as setting the selected values into, log4j.lcf, etc -->
   <!-- (...) -->

We'll take some lines of config/ to see what the tool does with them:

$ cat /some/erp/root/config/

First, the tool takes the already selected values of those properties in the preInstallationActionList tag. That is, it detects that bbdd.rdbms is set to POSTGRE so it selects PostgreSQL in combo box when that window appears to the user.

Next, when that window appears (window defined with a parameterList tag) the user can choose between PostgreSQL and Oracle in that combo box.

The final choice is saved in the config/ when the user confirms it with the final "OK" button in the tool. And this is implemented in the postInstallationActionList tag.

Common controls

In this section we'll see how to implement the different kind of most used controls, such as a text box, a combo box, etc.

Text box

Use the stringParameter tag for this. Example:

  <description>Context name</description>

Text box example

Directory selection box

Use the directoryParameter tag for this. Example:

  <description>Attachments directory</description>

Directory box example after clicking on the directory icon

Combo box

Use the choiceParameter tag for this. Example:

  <title>Date format</title>
  <description>Date format</description>
      <text>DD MM YYYY</text>
    <text>MM DD YYYY</text>
    <text>YYYY MM DD</text>

Combo box example, not expanded

Radio buttons

Use the choiceParameter tag with the radiobuttons value in the displayType tag for this. Example:

  <description>Please select a database</description>
    <option text="Oracle" value="ORACLE"/>
    <option text="PostgreSQL" value="POSTGRE"/>

Radio buttons example

Common actions

Get/Set values of variables from Java properties files

Openbravo ERP uses the Java property format for both config/ and config/log4j.lcf. So we mostly want to read the values of the properties and change them to other values.

To get the value of a property and store it in a variable, in this case we'll take the attach.path property and save its value in the attachpath variable (BitRock internal variable):


We mostly do this property retrievals in the preInstallationActionList tag.

Now imagine that the attachpath variable has been selected by the user using a directory box. To set its value back to the property file:



In some situations it is very valuable to validate if the input given by the users makes sense in the given control. For example, if we have a text box that asks for the port number of the database server, it does not make sense for the user to enter non-numerical or empty values. For this purpose we can use validations.

As an example:

    <text>Please enter a valid port</text>
      <regExMatch text="${ora_bbddport}" logic="does_not_match" pattern="^[0-9]*$"/>
      <compareText logic="does_not_equal" text="${ora_bbddport}" value=""/>

Validation example

Build and publish binaries

To build a binary for a specific platform (example: linux):

$ cd $HOME/src/openbravo/erp/setup
$ /opt/installbuilder/bin/builder build setup-properties.xml linux

We recommend adding the following script somewhere your PATH (e.g. $HOME/bin/, which will make your life easier to create the binaries for all the platforms:

if [ ! -f $xmlfile ]; then
  echo 'File does not exist.'
  exit 1
if [ $# -eq 0 ]; then
  archs='linux windows linux-x64 linux-ia64 osx solaris-sparc solaris-intel linux-ppc freebsd6 freebsd6-x64 openbsd3 hpux aix'
for i in $archs;
  /opt/installbuilder/bin/builder build $xmlfile $i

For testing purposes it is useful just to build one binary for your own system:

$ $HOME/src/openbravo/erp/setup/setup-properties.xml linux

So once you are happy with the results, to build all the installers:

$ $HOME/src/openbravo/erp/setup/setup-properties.xml

The results are stored in /opt/installbuilder/output/

For OSX it creates a directory, so we need to compress it:

$ rm -f $HOME/src/openbravo/erp/setup/output/*
$ cp -r /opt/installbuilder/output/setup* $HOME/src/openbravo/erp/setup/output/
$ cd $HOME/src/openbravo/erp/setup/output/
$ tar zcvf
$ rm -rf

To publish the files, just commit the files to the Subversion repository:

$ cd $HOME/src/openbravo/erp/setup/
$ svn ci -m "Update the setup binaries with x and y"


Retrieved from ""

This page has been accessed 3,473 times. This page was last modified on 2 February 2010, at 07:32. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.