Question

I want to create a windows installer package can be .exe or MSI. I want to do the following :

  1. Check if the Java 7 Runtime is available in the system & system has enough space for this installation
  2. If JRE is not available install the same from the installer package
  3. once JRE installation completes Unzip certain contents of the installer to specific location in the system say (C:\tools).
  4. Create a shortcut on the desktop.
  5. Exit the installer .
  6. Any issues alert the user

This is the first time am thinking something like this how this can be accomplished ?

Was it helpful?

Solution 2

you can achieve this with NSIS

here is another SO post explaining the process in more detail: NSIS script for java installation

In case your project can use Ant, then maybe the antinstaller might be the right choice.

OTHER TIPS

Give Inno Setup a try. A bit challenging at first, but very powerful. There's also many examples around on how you can make it a work with a Java program and check if JRE is installed. And the rest of your requirements are easy to accomplish.

If you want to create an MSI (plus an optional EXE) then I'd recommend looking at the WiX toolset. It's the installation tool that most major companies use including Microsoft.

For deploying Java desktop apps., the best option is usually to install the app. using Java Web Start. JWS works on Windows, OS X & *nix.

To address the specific steps:

1./2. Check for Java 7 & install

Use the deployment toolkit script to check for a suitable minimum JRE, and install if necessary. The script does not (cannot) check for available disk space, but I suspect the JRE installer does.

3. Install app. to specific location

JWS apps. are installed to the location specified in the Java Control Panel.

4. Create a shortcut

This is done automatically, if requested in the launch file. E.G. the two icons on the right hand side (JotPad/Star Zoom) are installed by JWS.

JWS can also install menu items.

5./6. Inform & exit

Done automatically by JWS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top