My needs are simple. I need to copy one EXE file with no other runtime DLL's (because I rule). I need to install a shortcut to the start menu and (optionally) to the desktop. Upon uninstall, I need to remove those files along with some stuff in the registry that the game creates to track progress.
In other words, I need about the simplest install possible.
The baby-InstallShield solution is certainly tried and true. I shipped tens of thousands of games with it and can't recall any install-related problems, so that's a front-runner. Only problem is that it doesn't compile installs to a single EXE, which is the norm nowadays. I've got a later InstallShield Express that was free in PCPlus magazine, but if I install that I'll have to get a serial number from the site, which will guarantee a salesbot calling me to upgrade to a later version.
So I checked out free solutions. I had a buncha old bookmarks, but everything on my list was either gone, in "maintenance mode", or went commercial.
NSIS wasn't a very good solution when I last looked at it several years ago. It was really more of a glorified self-exploding ZIP than a full install program. It's grown up quite a lot since then. It's still quite simple, but is also very extensible.
The thing I like best about it, though, is its scripting. Rather than having some kind of "project file" containing links to all of the files to pack into an EXE, the program just scans your installer script and packs in all of the files that you specify in your code.
That means that my entire installer/uninstaller is built from this little bit of easy-to-follow code.
Name "Duck Tiles"
; The icon for the installer and uninstaller
; The file to write
; The default installation directory
InstallDir "$PROGRAMFILES\Duck Tiles"
; Store the install path so further installs will just overwrite the existing install
InstallDirRegKey HKLM "Software\The Code Zone" "Install_Dir"
; Program installation section
Section "Duck Tiles Game"
; Set output path to the installation directory.
; Put file there
; Write the installation path into the registry
WriteRegStr HKLM "SOFTWARE\The Code Zone\Duck Tiles" "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Duck Tiles" "DisplayName" "Duck Tiles"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Duck Tiles" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Duck Tiles" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Duck Tiles" "NoRepair" 1
; Start menu shortcuts section
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\Duck Tiles"
CreateShortCut "$SMPROGRAMS\Duck Tiles\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\Duck Tiles\Duck Tiles.lnk" "$INSTDIR\ducktiles.exe" "" "$INSTDIR\ducktiles.exe" 0
; Desktop menu shortcuts section
Section "Desktop Shortcut"
CreateShortCut "$DESKTOP\Duck Tiles.lnk" "$INSTDIR\ducktiles.exe" "" "$INSTDIR\ducktiles.exe" 0
; Remove registry keys that the game created
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Duck Tiles"
DeleteRegKey HKLM "SOFTWARE\The Code Zone\Duck Tiles"
DeleteRegKey /ifempty HKLM "SOFTWARE\The Code Zone"
; Remove files and uninstaller
; Remove shortcuts, if any
Delete "$SMPROGRAMS\Duck Tiles\*.*"
Delete "$DESKTOP\Duck Tiles.lnk"
; Remove directories used
RMDir "$SMPROGRAMS\Duck Tiles"
One thing I also recommend if you get NSIS is the free HM NIS Edit. It's a little editor that can compile your install script and display error messages. NSIS is a command-line kind of thing, but this thing eliminates your need to see it.
Took me all of about two hours to put together the install program for Duck Tiles.
I'm now a convert.