Multiple Build ConfigurationsThis tutorial will guide you in creating a project with multiple
build configurations. Lets suppose our product is a Java application and we need to
distribute it in three different forms: one for MacOS X and two for
Windows (with and without bundled JRE). - Add your application files to the project
- Create and configure your Java products
- Create a new build configuration
- Select the JRE to be bundled in the product
- Configure build properties
- Create a second feature and add files to it
- Add a prerequisite for a build configuration
- Configure a Mac OS X Build
- Build your project
- Finish
Add your application files to the project Click on the "Files and
Folders" option and select the "Application
Folder" (in the tree from the left pane of the view). Add all
your application files here.
Create and configure your Java products
Go to the Java Products page by clicking on "Java
Products" on the left side page menu.
Create a new Java Product by clicking on
the [ New Product ] toolbar button and configure it as
necessary.
Create a new build configuration Go to
the Media page by clicking on "Media" on the left side
page menu.
Use the [ New MSI Build ]
toolbar button to add a new build configuration. Rename it
"BuildWithJre". This build will contain the bundled JRE.
Select the JRE to be bundled in the product Go to the "Java" tab, press the "Add JRE Bundle..."
button and select the desired JRE.

This operation automatically created a new feature called "JRE Bundle" and added all JRE files to it.
This feature will also be automatically marked to be included
only in the "BuildWithJre" build.

Configure build properties
The "DefaultBuild" build will use the default output configuration (MSI,
with one cab file inside), while the "BuildWithJre" build will be
configured to use LZMA
compression (EXE, with all files inside). These settings will be
independently configured for each of the project builds.
Select a build from the "Builds" pane and then edit its properties in
the "Media", "MSI", "Bootstrapper" and "Java" tabs.
Create a second feature and add files to it Go to the Organization page by clicking
on "Organization" on the left side page menu.
Use the [ New Feature ]
toolbar button to add a new feature named "SecondFeature".
In the "Feature Properties" pane choose the "Include feature only in
the selected builds" option and select only the "DefaultBuild"
configuration in the list. 
Add a prerequisite for a build configuration Go to the Prerequisites page by clicking
on "Prerequisites" on the left side page menu.
Select the "Software" tab, add a new
prerequisite and configure it. Select the "Builds" tab in the "New
Prerequisite" dialog and choose to include this prerequisite
only in the "BuildWithJre" build configuration.

Configure a Mac OS X Build Go to
the Media page by clicking on "Media" on the left side
page menu.
Use the [ New Mac OS X
Build ] toolbar button to add a Mac OS X build configuration
named "BuildMacOS". This build will contain all the Java products in the
project and all the files that were selected in the The Mac OS X settings tab from the Java Products.
Build your project You can build all the output
configurations at once, or you can choose to build only a certain build
configuration by selecting it in the "Build" drop-down menu.

FinishThat's it ! |