by Njål

Install4j: Installing to the home directory of user

 

Install4j is a great installer that wraps Java application into a native installer package & launcher (executable). It can embed JRE, so you won’t have to worry about user that don’t have Java installed.

When releasing our application I wanted to offer our customers two installers:

  1. One standard installer which installs the application to the home directory of the user. This application auto updates itself. No admin privileges required.

  2. One Terminal Server version which installs the program for all users. Admin privileges are needed to install, and auto updates are disabled since normal users can’t update the application anyways.

(This is the way Chrome and a lot of other great apps do it)

Making a Terminal Server installer was very easy. Just enable “For All Users” and set “Elevation”.

Here’s how you make the installer install into a users home directory by default:

context.setInstallationDirectory(new File(System.getProperty("user.home") + "/ArgusClient"));

 

image

 

 

The installer now suggests your home folder:image

  • Ingo

    That a good technique for arbitrary installations directories that are determined at runtime.

    For the user home directory there’s an even simpler way: On the “Installer options” step of the media wizard, select “Use custom installation base directory” and enter “~” (without the quotes) into the adjacent text field.