Monday 27 October 2014

Create software installer for your application [free installer maker]

Whenever we think of java based desktop application what comes to your mind?

  1. Executable JAR or JNLP stuff
  2. Set of libraries
  3. System PATH value/ system variable setup
  4. Registry Entries 
  5. Shortcut generation
  6. Branding etc…
To handle this list manually is a time taking and tedious task. 
What if you get a single setup file that will do this for you?
Sounds interesting?

After a long-run of net-mining, I found a very use full tool to create windows installer [or setup.exe] that is easy to use and powerful enough to handle all installation parameters. 


The most important thing “IT’s FREE…. ”. 

The tool is called as “NSIS (Nullsoft Scriptable Install System)”.
Even if this tool can be used to create windows installer of any application, as a java junky I will demonstrate it for JAVA.


Following tutorial will brief you about easiest way to get your work done. 

Lets ROCK!

Prerequisite:

  1. NSIS Desktop Application 
  2. Eclipse [I am using Luna version] with NSIS Plug-in 
  3. Application Executable JAR/JNLP file
  4. .ico file [ to be used as application icon for setup file and application]

[Note: to create .ico file from any image click here]

Step 1

Download NSIS Desktop application installer and install the application 

Step 2

Open eclipse IDE and goto:
File Menu -> New -> Other 
in next window goto EcplipseNSIS -> NSIS Script and click Next button



[if you don't have EclipseNSIS listed as shown in above figure. Click here to know the process to add the same.]

Step 3

You will get a NSIS welcome screen 

Here you can select script templates listed. This templates are having pre-configured option, but we want to set parameters by our self so we will just click on next.

Step 4

On next window you can set:
  1. Application Info
    1. Application Name [Compulsory]
    2. Version : application version
    3. Publisher Name : you may write company or team name here
    4. Publisher URL : 
  2. Installer file info:
    1. Installer File [Compulsory]: Name to be given to installer file
    2. Installer Icon : Icon For installer file. here you can use predefined set of icon that is available or custom your own company icon
  3. Uninstaller File info: Same as Installer info          

and click next.

Step 5

On next window you can setup the proffered 

  1. Installation directory
    1.  in drop-down many standard location are referred with $<name>, here we want to install our jar at Program file folder we will use $PROGRAMFILES
  2. Start Menu Group
    1. Here we can control the way in which you application will be listed in the start menu.
  3. There are further configurations for multi-user, multilingual setup but we will not play with them now, as we want to use English language only.

Now click next.

Step 6

Many stylish installer have a welcome animation, this can be introduced in our installer in next interface will help us do it.
  1. License Setting
    1. Here we can add our license file.
  2. Splash Screen
    1. Here you can set welcome animation for our installer.
and click next

Step 7

Now here we will be adding the components the installer will be installing on the client computer.
  1. Default warning
    1. By default, this window will show warning that Main section content are empty as we haven't added anything to it.
  2. Main section Content
    1. Now here select Main section as we want to add content to it.
  3. Add Component
    1. The plus sign button will allow you to add component one by one

Now click green Plus sign 

Step 8

As you click on Green Plus sign it will show you the list of component type that can be added:
  1. File
  2. File Set
  3. Folder
  4. Library
  5. Shortcut
  6. Registry Key
  7. Registry Value



As we will want to install our JAR/JNLP we will select file.



Step 10



As you select File following window will open:


where we will be specifying 
  1. Source File : i.e. out JAR/Jnlp file
  2. Destination : where we wants to put it after installation 
    • Destination drop-down again contain many standard location specified by $<variable> but as we wants to install it in installation directory only. we will use $INSTDIR and click ok.
[Note : Similarly you can add ICON for application, Desktop shortcut, etc..]

then Click Next.


Step 11

Now this is the final step to generate our install.nsi file
In here we need to select the action that installer should do after completing the installation.


now change installer script save setting to File system and specify the location to save the script and click finish.



image source : http://aberdeenc.files.wordpress.com/2013/04/finally-done.jpg


Hureeeeeeeeeyyyy .. we done with the process....





Reference:
  1. for detailed process reading : http://eclipsensis.sourceforge.net/help/index.html
  2. Popular NSIS user screenshots       :http://nsis.sourceforge.net/Screenshots
  3. Some custome scripts : http://nsis.sourceforge.net/Category:Code_Examples

So here is all from my side THANKS.....



TAGS: free installer, installer for java application, easy way to create installer,java, jnlp, jar, easy installer, Create Installer, installation package, free software installer, free installation package,  create MSI