Last week I faced a new problem, I had to program a installer for Windows in order to deploy some software we have produced at work. After a quick googling I found NSIS an installer generator, open source and with a simple scripting language.
NSIS comes with a compiler which parses the sentences writting in its own language and produces a pretty decent installer. It also has a look-and-feeling similar to latets Windows versions, so it was the perfect choice!
The scripting language is really simple, we can generate a simple installer with only the next few lines:
OutFile “simpleAdvansenInstaller.exe”
InstallDir $DESKTOP
Section
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstaller.exe
CreateShortCut “$SMPROGRAMS\simpleAdvansen.lnk” “$INSTDIR\uninstaller.exe”
SectionEnd
Section “Uninstall”
Delete $INSTDIR\uninstaller.exe
Delete $INSTDIR\test.txt
Delete “$SMPROGRAMS\simpleAdvansen.lnk”
SectionEnd
After compiling the script with the tool NSIS package’s comes with, two executables are generated:
simpleAdvansenInstaller.exe
Which will copy the uninstaller.exe to the Installation Dir set up to the Desktop and will add an entry in the Programs Menu for the uninstaller.
uninstaller.exe
Will delete itself and remove the entry in the Programs Menu.
NOTE: NotePad++ highlights the syntax of NSIS as well.