If I have jar file of java application and supporting jars then what are the steps for creating installer using installBuild tool. Also how can I start my application on windows startup after creating installer?

asked 10 Apr '12, 05:22

TTH's gravatar image

accept rate: 0%

InstallBuilder's Java support page gives you a really good start. http://installbuilder.bitrock.com/java/

The link includes different compressed Java packages for various platforms. Just expand them; then put all of the subfolders in one place. I use these:

  • installbuilder-8.2.0/jre1.7.0_04/java-linux
  • installbuilder-8.2.0/jre1.7.0_04/java-linux-64
  • installbuilder-8.2.0/jre1.7.0_04/java-windows

Each compressed package has its own java.xml. The only difference between the different java.xml files is the value of a variable called "java_bitness", where it's different for 32 vs 64 bit platforms:

<setInstallerVariable name="java_bitness" value="32" />
<setInstallerVariable name="java_bitness" value="64" />

So, I consolidated them into one by making two changes. Now, I can use only one java.xml in my installer package. The changes include:

  1. Change existing value to refer to a variable:

    <setInstallerVariable name="java_bitness" value="${host_bitness}" />

  2. Create a new action list that sets the new ${host_bitness} variable:

    <initializationActionList> <setInstallerVariable> <name>host_bitness</name> <value>32</value> </setInstallerVariable> <setInstallerVariable> <name>host_bitness</name> <value>64</value> <ruleList> <platformTest> <type>linux-x64</type> </platformTest> </ruleList> </setInstallerVariable> <setInstallerVariable> <name>host_bitness</name> <value>64</value> <ruleList> <platformTest> <type>windows-x64</type> </platformTest> </ruleList> </setInstallerVariable> <setInstallerVariableFromScriptOutput> <exec>isainfo</exec> <execArgs>-v</execArgs> <name>solaris_bitness</name> <ruleList> <platformTest> <type>solaris</type> </platformTest> </ruleList> </setInstallerVariableFromScriptOutput> <setInstallerVariable> <name>host_bitness</name> <value>64</value> <ruleList> <compareText> <logic>contains</logic> <nocase>1</nocase> <text>${solaris_bitness}</text> <value>64</value> </compareText> </ruleList> </setInstallerVariable> </initializationActionList>

I would suggest the InstallBuilder team incorporate these changes to next program update.

Finally, this java.xml component does not detect existing Java installations. So, I have another java-detect.xml component that uses <autodetectJava> and installs the new package only if Java is not detected on the host. This component also detects if the host is a Debian Linux distribution and if the users is running as superuser. It then uses apt-get to install java, no the packages here. This could be expanded to include yum for Redhat/Fedora, and other package managers for other distros. If anyone is interested in this component, I'll be happy to share it somewhere.


answered 13 May '12, 02:05

tahoar's gravatar image

accept rate: 42%

If your application is a Java jar file, you could either require the Java runtime to be installed in the target machine or bundle it within your installer.

You could also try to autodetect it using the <autodetectJava> action, and if you cannot find any valid version, either unpack a bundled one or throw an error:

<throwError text="Java is required but was not found.
  Please install it an relaunch this installer">

You could even download it at runtime:

              <title>Downloading files</title>
              <programArguments>xzf ${installdir}/java.tar.gz -C ${installdir}</programArguments>

You could also create a luncher for your jar file:

        <windowsResourceLegalCopyright>Test Launcher 1</windowsResourceLegalCopyright>
        <windowsResourceLegalTrademarks>(c) 2010 Bitrock S.L.</windowsResourceLegalTrademarks>
        <windowsResourceProductName>Test launcher 1</windowsResourceProductName>

You can find additional information in our online documentation.

Regarding starting the application at startup, if you create a launcher you could just create a shortcut to the startup menu

            <comment>Client for managing myapp</comment>
            <name>Launch myapp client</name>

answered 10 Apr '12, 12:20

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%


Just use actual installer that sripting tool. http://www.actualinstaller.com


answered 12 May '12, 08:56

Rust's gravatar image

accept rate: 0%

It's really uncool to advertise another product on Bitrock's support forum!

(13 May '12, 01:26) tahoar
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: 10 Apr '12, 05:22

Seen: 11,014 times

Last updated: 13 May '12, 02:06