HI Team,

I have a piece of java custom codes which needs to be executed before actual installation starts(pre install section). Also few java custom codes needs to be executed before actual un installation starts. Can you please let me know how can i achieve this ?. I will be bundling my own jre with installer under ${installdir}/jre directory. I want to use this jre for running my java custom code.

Thanks, Shiva Prasad T

asked 07 Nov '11, 01:40

shivakmpl's gravatar image

accept rate: 0%

Running Java applications after installation - such as during Post Installation or Pre Uninstallation should work normally. You can simply use runProgram, such as:

  <programArguments>-jar "path/to/app.jar"</programArguments>

The above will work if the installer deploys Java runtime into ${installdir}/jre.

However, running Java in Pre Installation is a bit more difficult - since it will require unpacking entire JRE to a temporary directory.

Assuming you bundle your Java as "jre-${platform_name}" (i.e. jre-linux, jre-windows, jre-linux-x64) folder in "jre" component, it would require the following actions:

<!-- delete directory if it existed -->

<!-- unpack JRE -->

<!-- unpack JAR that is needed -->

<!-- run the application -->
   <programArguments>-jar test.jar</programArguments>

<!-- clean up -->

The jars are assumed to be a test.jar file in "jars" component, "jars" folder.

The names of components and folders are the short names (<name> tag) for components and folders that contain JRE and JAR files respectively.

You can find more information on unpacking files before installation here


answered 07 Nov '11, 05:10

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: 07 Nov '11, 01:40

Seen: 1,443 times

Last updated: 07 Nov '11, 06:35

Related questions