Everyday Coder

eve·ry·day cod·er [ev-ree-dey koh-der, noun]
a person who designs, writes and tests computer programs daily

Windows Installer for Java

I have to admit, that I always avoided installers for my Java apps. The last project I worked on was a big one. One that, of course, required a fancy installer for Windows (the only supported platform). Management (not the dev team) dictated that we must use the Wise installer. This seemed all well and good until I noticed the cost. WOW! Something as simple as copying a few files to the right place really costs that much? I was speechless.

Before that big project, I generally had to install on *nix, Mac, and Windows. Most of those projects simply required the user to unzip a zip file. I've been recently working on internal management projects in which Java Web Start is the installation method of choice. That works really well if your target audience already has Java installed.

My current project actually needs a bonafide Windows installer, as it will be distributed on CD and ship with its own JRE. I was given free reign this time (no management mandates). I did a little research and ran across the Nullsoft Scriptable Install System (NSIS). This is the same installer that WinAmp and many other OSS Windows apps use. It's licensed as completely free, even for corporate use.

The scripting language for NSIS is a bit cryptic if you've never done assembly before. But, the plethora of example scripts on their Wiki and in the examples covered everything I needed. More importantly, it just works.

As a side note, there are also examples of making a native launcher for your Java application using NSIS. That means that you can distribute a native EXE with your app that will launch your main class.

Trackback URI | Comments RSS

Post a Comment