Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating an installer for Java desktop application

I know this question has been asked many a times and all the time there is an answer which says about using an executable jar or making an .exe using launch4j or similar app.

I may sound like a novice, which I actually am.

I have been trying a few things with a Java project. I have successfully made an executable jar and also an .exe file from it. All thanks to your previous answers in SO :)

But, I want to create a installer for Windows. Like, pressing Next for 2 - 3 times(which shows all the terms and conditions etc), then a user specify a location(like C:\Program Files\New Folder\My App), then my .exe, lib folder, img folder, other important folders get pasted in the destination folder along with the .exe file and then a shortcut is created on a desktop.

Any pointers to how can I achieve this ?

like image 260
ItachiUchiha Avatar asked Feb 04 '13 10:02

ItachiUchiha


People also ask

Can we make desktop application with Java?

As mentioned, Java can be used to create desktop applications. These applications can have attractive interfaces and designs, they can store and retrieve data from a database, and much more. For desktop application development, you can use Java Frameworks to build Graphical User Interfaces (GUI).

How do you package a Java application?

The recommended way to package Java applications is to use a collection of Ant tasks ( ant-javafx. jar ), which are provided with the JRE. NetBeans IDE uses these Ant tasks to package JavaFX and Java SE projects. Embedded packaging support in NetBeans IDE covers most of the typical use cases.


2 Answers

I have been using InnoSetup for a long time. It has always worked very well. It can do everything you need (unpack files, put shortcuts on desktop, start menu etc) and generates installers that we are used to.

like image 66
Adam Dyga Avatar answered Sep 23 '22 21:09

Adam Dyga


If you want free and open source, you could take a look IzPack. We use this at work for its command line support in our builder.

You could also take a look install4j which is a commercial product we've trialed on and off before (but when it comes to spending money, you tend to want to know you're getting what you want ;))

like image 42
MadProgrammer Avatar answered Sep 23 '22 21:09

MadProgrammer