Let’s create a smart installer for Windows

Installer is the first experience of an application. You can create a user friendly, very helpful application but if it contains a very bad installer the users of your application get a very bad first experience and you all know that the first impression makes a mind set which can be never changed… 😉

“How to create an installer?”.I asked this question from the founder of iReport, Giulio. He told me to use NSIS. Now NSIS came in to the scene. Lets explore what is NSIS.

Here we go…

According to Wikipedia

Nullsoft Scriptable Install System (NSIS) is a script-driven Windows installation system with minimal overhead backed by Nullsoft, the creators of Winamp. NSIS has risen to popularity as a widely used alternative to commercial and proprietary products like InstallShield.

It was created mainly to distribute Winamp and NSIS is a free software 🙂

Popular products that use NSIS are

Mozilla Firefox
7-Zip
Bit Torrent
FileZilla
Google Talk
Kaspersky AntiVirus
OpenOffice.org for Windows
Winamp
and the list goes on.

You can easily create an windows installer for a zip file just by one click using NSIS. If you need more advanced features and a modern user interface you have to read about NSIS scripts a little. Don’t worry I can assure you it wont take much time.

Step 1: download NSIS from here and install it.

Step 2: Open your favorite editor and type this script and save it as CopyPaste.nsi

#Sample script by Harshani Nawarathna to paste a folder “hi”
#which contains the text file “hi.txt”
#to the folder “CopyPaste” created in Program Files and
#create a shortcut to the “hi.txt” on the desktop.

Name “CopyPaste”
OutFile “CopyPaste.exe”
InstallDir “$PROGRAMFILES\CopyPaste”
Page License
Page Directory
Page InstFiles

Section “CopyPaste”

SetOutPath $INSTDIR
File /r hi
CreateShortCut “$Desktop\hi.lnk” “$INSTDIR\hi\hi.txt”

SectionEnd

Step 3: Right click on the file and compile the script.

Step 4: You can see the .exe file created. Let us test the installer.

Step 5: This is how the installation procedure looks like

Then you can see the folder copied to the Program Files and the shortcut on the desktop 🙂

You can explore more about NSIS by it’s user manual and NSIS tutorials.

Have a nice time with NSIS 🙂

13 thoughts on “Let’s create a smart installer for Windows

  1. @kalani akka: Just now saw your comment. you are almost welcome 🙂

    I found your blog 2years back via Saliya sir's blog and it was your blog motivated me to start blogging. I'm so happy finally you also found my blog. 🙂

    Like

  2. So nice to hear that nangi:) Actually Saliya is the one who directed me to your blog post when I was searching for a good installation sys. So I could make a pretty good installer and thought of posting some tips on NSIS too…

    Keep up the good work, this is such a nice blog (I read almost all the posts) 🙂

    Like

Leave a comment