I need to run a Java program to query the user's system, and then present a set of choices based on the output from the Java program.

How do I integrate this with InstallBuilder?


asked 20 Mar '12, 11:08

bstoke's gravatar image

accept rate: 0%

You can just call the Java program and return the result as the stdout. Then, you can populate the options using the <addChoiceOptionsFromText> action:

   <programArguments>-jar ${installdir}/yourprogram.jar</programArguments>
<!-- Process the stdout to get the appropriate format -->

Please note that if you want to configure the choice parameter before the installation stage you will need to use an <unpackFile> action to unpack the jar file and the Java runtime (if you are not using the one from the system).

You can find some more details in the below links:

Run Program after Install and present Choices

Populating Parameters at runtime


answered 20 Mar '12, 11:31

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

It is possible to run a Java JAR before installation is performed and based on its output or exit code perform certain actions - such as set whether parameter should be shown.

Below is an example of finding Java, unpacking a JAR file, running it and setting if installdir parameter should be shown based on if exit code is 0:

    <programArguments>-jar "${system_temp_directory}/myjar.jar"</programArguments>

It is also possible to populate choice parameter options using <addChoiceOptions> or <addChoiceOptionsFromText> actions.

Based on what exactly you want to do, you can find additional information in our User Guide:


answered 20 Mar '12, 11:32

wojciechka's gravatar image

wojciechka ♦♦
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 20 Mar '12, 11:08

Seen: 1,878 times

Last updated: 20 Mar '12, 11:32