I am trying to find a native installer for windows to install an enterprise java application. The most important feature I want is the ability to upgrade existing installations in an rpm kind of way (distinguish between configuration files and files to be upgraded/replaced). I am currently using IZPack which as far as I can see lacks this feature.
Other features I require are maven/ant integration, jre version check and bundling, registering as windows server and application (ability to uninstall from windows own tools) and ability to parse and replace parameters in configuration files based on parameters givet at install time.
Do anyone know of an installer that can do all of this?
Check out NSIS. It is scriptable and easy to use.
For Maven integration use the Maven NSIS Plug-in.
It costs money (it definitely couldn't be classed as cheap), but you could consider InstallAnywhere.
I'm using the 2008 pro edition and it does pretty much everything you've specified. I started using it ages ago, and haven't
Ant integration (ant task for building installers)
Ant integration (call an ant build script as part of the installer).
Bundles java (you download specific packs for windows/linux/solaris etc)
Installs as a service
Custom panels for your own look and feel.
Multi-platform Native looking adapter (i.e. no command prompt window a-la batch file start).
Uninstallable via windows control panel.
Parameter replacement in files that have just been installed.
BitRock InstallBuilder can do nearly everything that you mention out of the box, about half of our customers use it to install Java apps on Windows. We do not support the RPM behavior of marking certain files as configuration, but you can replicate this with a little bit of logic inside the installer (you can compare dates or md5s and only substitute if they are different.) We provide free licenses to open source projects and discounts to SMBs, let us know in case you qualify.
Related
Is there any application that creates an native application launcher of Java application? As the "native" term I mean "looks like normal, platform-dependent application, that only launches the java -jar foobar.jar, and displays the error if there're no JVM installed". I heard about Launch4j, but it only works for Windows. I want multi-platform (Win+Lin+Mac) solution. And I'm not talking about shell scripts; I want normal executable file.
Btw., Eclipse looks that it has got something like that I want.
Regards.
If you are using maven, then it would be very easy to create Native application for all platform, we use launch4j for windows(.exe), for debian(.deb) we use jdeb and for Mac OSX(.app and .dmg) we use osxappbundle.
There are tools like launch4j that do this.
You can use it together with izPack in order to provide a native installer and launcher. See this for extra details.
I use LibGDX Packr but it uses the JVM that you package with your application instead of the JVM installed on the operating system. As I prefer providing real GNU Linux packages, I use JDeb and Redline RPM. I will have to find a solution to create a MSI package for Windows.
Those tools are cross-platform, it means that you don't have to be under Mac OS X to create an .app file, you don't have to be under Windows to create a zipped file with a native Windows launcher, you don't have to be under GNU Linux to create GNU Linux packages.
I use Ant as a build tool but you can do the same with Maven, both JDeb and Redline RPM support it, writing an Ant task for LibGDX Packr is quite easy. I still hesitate to put my high level deployment tools into a separate library when I succeed in using JDeb and Redline RPM correctly. I'd like to use an homogeneous syntax in order to allow a developer to use the same parameters to create all native packages. Moreover, my code creates the .icns files for you, it is very helpful when you don't want to depend on native Mac OS X tools or any external applications, it's based on my patch of Apache Commons Imaging.
P.S: I put my own tool (JNDT) into a separate Ant script a few months ago, its documentation is here.
I found install4j useful for multi-platform application binding. It's easy to use and has nice graphical interface.
It supports Windows + Linux + MacOSX + Unix.
It can also bind JRE so that you can run it even if user did not have any JRE installed.
I would like to create an installer for my app. Since I am using ant for build automation, I would like to use ant for installation purposes as well, but I want to save the user as much trouble as possible, including installing ant.
Is there a way to create a stand-alone ant bundle (one that would not depend on ant being installed in the system), or is there another way to create an installer? I have to install Apache Tomcat, MySQL and some other things on Windows.
I think you're looking for the ANT installer package.
Take care when writing custom installers for other people's applications (thankless task). For 3rd party dependencies that your application has, I would consider using tools like Chef and Puppet. The only issue is that windows support from both these tools is only emerging at the moment.
I just installed http://yacy.net/
It advertises as easy install except that when I run it says cannot find javaw which spoils nearly everything.
If I were to distribute a java app myself I'd like not to have user knows anything about downloading and installing java, so any article, tool which explains how to package a java app professionally like one can do with a windows app easily ?
There are several approaches to this, all of which have their own set of drawbacks. Here are some of the most popular:
Bundle a private JRE with your application. See the README file that comes with your JRE for the details.
Use a launcher (such as launch4j) that can download a JRE at runtime if a suitable one is not found on the target machine.
Compile Java to native, then distribute as a regular Win32/Linux executable. You can do this with Excelsior JET.
Since you are concerned with deployment, you'll probably also want to create an installer for your application. There are dozens of options for this, such as NSIS.
What's the best way to package Java software for running on Windows? Is there a standard for writing .BAT files which can discover the latest installed JRE on the machine? Are there any Maven plugins for this? What's the deal with executable Jar files?
I would without any doubt recommand you to use Java Web Start, as it allows you easy control over version used (and by far the easier to use update mechanism available nowadays).
Depends on what you need.
We've found that using the One-JAR + JSmooth gives a very good user experience as it allows us to distribute a single EXE-file which can be put anywhere on the users system, as opposed to having installation binaries, which need to be installed and uninstalled etc. etc. etc. JSMooth checks for the existance of the appropriate Java runtime, and redirects to the official download site if none is found.
The reason for One-jar is that you generally need to use library jars which is best to have separately but JSmooth only allows for a single jar file.
Also the One-Jar SDK and JSmooth is scriptable without being tied to Windows, so we can build new versions on our Hudson engine running on Linux.
In the past I've used a java installer package like launchForJ. However, a lot of these packages use Java so you may need to a batch or simple executable written in native windows code that does a quick check to see if Java is already installed then run the installer.
Since Java uses system variables during install you should be able to check if the version (or higher) that you require exists in this way.
The standard way would be to use Java Web Start.
Using Java Web Start technology, standalone Java software applications can be deployed with a single click over the network. Java Web Start ensures the most current version of the application will be deployed, as well as the correct version of the Java Runtime Environment (JRE)
Maven has a Webstart Maven Plugin to help building application bundles that can be deployed via Web Start.
An alternative solution would be to use a cross-platform installer generator to generate, well, an installer. I personally like IzPack (I think that JSmooth is very similar but I have more experience with IzPack) and, if you are specifically targeting the Windows platform, you could use IzPack to Build [a] Native Windows Installers with IzPack Native Launcher:
A problem still arise with IzPack when
the target system does not have a JRE
installed. The user needs to first
install it and then run the IzPack
installer. This is not a problem with
Linux or BSD users since they are
generally skilled and they know how to
do that by hand or with a packaging
system (RPM, DEB, ebuilds, ports,
...). Similarly, a Mac OS X user will
not have much problems since it is
available with the operating system.
However the situation is more
complicated on the Windows platform as
a JRE must be installed. Worse,
several instances can be installed in
a sometimes messy situation.
The IzPack Native Launcher tries to
solve this problem. It is a C++ native
application that is available under
the very permissive MIT License and
that uses wxWidgets for the GUI. It is
thus cross-platform (for the
historians: it was first developed on
a FreeBSD box), but most people will
need it on Windows. It uses a simple
configuration file and will first
check for a JRE. If none can be found,
it will pop-up a dialog to let the
user choose between the following
options:
manually specify a JRE location
download one from the Internet
install one that is provided by the packager (if available).
IzPack also offers a Maven Plugin. Worth the check.
I need to build an installer that does the following:
Installs my jar on the client.
Auto-detects if JRE is installed (in which case it does not re-install it), otherwise installs it without the user clicking on another button.
Auto-starts the application when the client is booted.
Works across Windows, Mac and Linux.
Any idea how to go about it?
If a commercial tool is ok, I can recommend install4j. 1, 2 and 4 are easy to do with it, but about 3 I'm not sure. Edit: You could probably achieve that by installing your app as a "service", which install4j supports for all platforms. Quoting from its Features page:
install4j offers full support for
generating and installing services
(daemons). For services, install4j
generates service executables on
Windows, startup items on Mac OS X and
start/stop scripts on Unix/Linux
platforms.
Edit: Regarding #2, JRE detection: install4 has pretty nice, flexible options for JRE bundling/detecting. You can include a JRE (statically or dynamically, shared or not) or prefer to use one already present, with the possibility to download a JRE from within your installer as a fallback. Check these docs for more: How Installers Find a JRE and JRE Bundles.
(More about my experiences with install4j.)
For other tools, you could check some of the earlier Java installer questions on SO:
What’s the best way to distribute Java applications?
Java Application Installers
What is the best installation tool for java?
Commercial tools like InstallAnywhere can do that. After installing the JAR (and links and such), installers can check the registry if Java is already installed and proceed or not. As long as the installer supports all needed plattforms, you are fine.
You could use launch4j , it does not automatically install java however. But maybe there's a way to make that work by packaging the JRE for example.
You may also want to take a look at BitRock InstallBuilder, it provides built-in functionality to perform what you want. We will be happy to build a sample installer for you, just drop us a line.
I recommend downloading the source code for the build scripts of popular Java programs like limewire and follow their example. The end.
...Or you can do like I did:
I have done the JRE detection and
download/install of redistributable if required with
NSIS on Windows. Maybe an .msi is better than a installer.exe which NSIS creates. I believe msi are more like packages on mac so they allow proper updates. Maybe NSIS creates MSIs... not sure.
Mac is simply an Java App
bundle and you specify the JRE and other Java info in the
info.plist and you can optionally create a .pkg
file to give the user an installer and bundle up in a dmg using the command line dmg programs.
I haven't done Linux and don't plan to... sorry :)
All this was a fair chunk of work. I first did the Windows stuff then a couple years later did the Mac stuff.
You can integrate all of this in NSIS build scripts and Ant. I can't remember why I didn't use install4j. Probably I was too cheap :)
Haven't heard of anything that works across all those platforms, but JSmooth might help (fits your needs on Windows). I've used it about 2 years ago and it worked fine.