Installer options?

Hi all,

does anybody have advice on what installers work well for a Java-based project such as a JME application?

  • Runs on Linux
  • Offers an Eclipse and/or Maven plugin
  • Targets: Windows, Mac OS X, Linux
  • Generated installer can install for all users (with admin privileges) or just current user (unprivileged install)
  • Can use bundled (or downloaded) JRE, or - if that’s a good idea - an existing JRE (bundled JRE & admin install needs to be extra careful)
  • Can install a background process (“service” in Windows, “daemon” in Linux and Mac)
  • Needs to be able to deal with native libraries (unpacking natives at runtime won’t fly when installed for all users)

I’m seeing this discussed on Stack Overflow, but often limited to Windows and mostly with no clear recommendations.

I found an excellent introductory/overview article on the issue:

If you can get away without an installer, I would recommend that. As people tend to not like installing stuff they download from the internet (unless its from a trusted source), if it just clicks and opens, they feel a bit safer

Why do you need a cross platform installer capable of installing a daemon/service? I wouldn’t let such a thing pass my front door.

No, what wezrule said, use the SDK and check a box and it is all taken care of. Couldn’t be easier.

Generally windows users expect an installer, I use wix for that - but just for windows. Linux users generally don’t expect one, mac I don’t really use so I’m not sure what is expected there.

MSI. I’d generally rather use the installers the OS developers supply than some external installer system if possible. Modern application deployment works via online stores, so thats always platform specific anyway. Otherwise theres izpack, an open source installer stack in java.

Wix generates MSI files, it’s the free microsoft command line tools for making them. It’s a bit… fiddly… but it does work.

mac I don’t really use so I’m not sure what is expected there.
Mac users traditionally expect a dmg disk image from which they can drag&drop their application as one .app folder/icon (they are shown as application icons in the finder) to their Applications folder. Zips are just as fine, they unzip automatically after download and you can drag the application to your folder, so the SDK basically delivers what a Mac user expects already :) Installers are only needed when you need to install system specific stuff like drivers and system-wide templates or such, due to the access rights stuff for those folders.
Wix generates MSI files, it’s the free microsoft command line tools for making them. It’s a bit… fiddly… but it does work.
Ah, nice, is it pure java? Maybe we can make some extension to the desktop deployment plugin / build script? If you extend the desktop-impl.xml I'll put the stuff in the options panel, ok? ;)

Nah, it’s not java at all. It makes installers for anything. The way I have it set up at the moment I run the build as usual, then to do a release I unzip the file in location and then I’ve set up a batch file:

[java]“C:\Program Files (x86)\Windows Installer XML v3.6\bin\candle” -ext WixUIExtension -ext WiXUtilExtension “HeroDex Installer.wxs”
“C:\Program Files (x86)\Windows Installer XML v3.6\bin\light” -ext WixUIExtension -ext WiXUtilExtension “HeroDex Installer.wixobj”

The wxs file is an XML file basically describing where to find the files for the installer, where to put them, what start menu shortcuts to make, what image files and installer screens/options to show, etc.

It would certainly be possible to include wix into the build in some fashion - maybe by simplifying the options and letting the build script generate the xml file - I don’t know off hand how much work would be involved though.

Here is a shell script I wrote for another project. It is a linux installer. Just substitute “svansprogram” for whatever your application is named, it assumes you have an executable JAR-file as your main binary.

Let my try to answer the various proposals:

“no installer” / “just send the jar” - doesn’t set up stuff like start menu entries and file associations. Otherwise I’d be fine with that, but… well, it’s better to meet expectations.

JME SDK mechanisms: Won’t work for me. I’m using just the engine in an Eclipse project. I even uninstalled the SDK after a few minutes of fiddling and general unfamiliarity aches. Not that I’m saying that either IDE is better, mind you, just that I’m more familiar and hence more productive with Eclipse right now.

Daemon/service: just for those who want to host a shared universe (it’s a networking multiplayer game).
OTOH a LAN party game could run just like a normal application, and a 24/7 server would probably be a Linux box where it’s easy to run user processes in the background, so this is probably not really necessary.

wix and other Win-only installers: I’d like to avoid that if I can have a cross-platform one. One less tool to learn.
A separate tool per platform would be the fallback if no good cross-platform one shows up.
Does wix run on Linux? Without that, I can’t use it.

MSI: I hope whatever tool I use will be able to generate that. A .exe would probably be fine, too.

App Stores: Probably not.
a) I don’t like the walled garden building that’s going on in most (all?) of them
b) I’m not targetting the markets reachable through them - I don’t want to bet on Win8’s success, and I have no idea how to control touchscreen games so the mobile market is not on my radar.

Shell script: Looks nice :slight_smile:
I first thought it was assuming that ~/.local/share/applications is in the PATH, but on second look, that’s just the .desktop file.
It does not seem to move the application to ~/.local/share/svansprogram though, which is what I’m seeing other applications do.
Such things are one reason why I like to use the tool. People who build such a tool can take care of more details than I’d have the capacity to learn and, more importantly, keep up with. (But the shell script is still a very nice fallback in case I’m not finding a readymade tool.)

Points that haven’t been addressed yet:

  • Maven plugin? (Eclipse plugin would be the fallback.)
  • JRE bundling ability?
  • Can deal with native libs?

So what you basically say is that you skip all options given to you cause you decided to go your own way and now ask for solutions for the problems arising? I mean if you chose to make an app with eclipse cause you’re used to it, how do you usually distribute them?

1 Like