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 InstFilesSection “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 🙂
Hmm, this one seems to be good. Have used Installshield trial and didn't have a good time with it.
LikeLike
Good one!
LikeLike
@thameera: just try it..you will love it .. 🙂
@danishka: thanks a lot .. 🙂
LikeLike
Nice..I am gonna try this. Thanks v much:)
LikeLike
nice post 🙂
LikeLike
Yes, it worked like a charm. Had to learn the scripting lang. but it is really worthy…thanks again!!
LikeLike
This comment has been removed by the author.
LikeLike
@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. 🙂
LikeLike
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) 🙂
LikeLike
This comment has been removed by the author.
LikeLike
hiii harshani i always read u r blogs ….absolutely good ..
LikeLike
@ShashankRaj: Thanks a lot. I'm so happy to know that you found it interesting 🙂
LikeLike
yup …sure u r blogs contain all good technical stuffs .specially u r blogs on jasper report .. helped me a lot..thanks again..harshani
LikeLike