; example1.nsi ; ; This script is perhaps one of the simplest NSIs you can make. All of the ; optional settings are left to their default settings. The installer simply ; prompts the user asking them where to install, and drops a copy of makensisw.exe ; there. !define VERSION "0.0.4" !define VERSION_SHORT "004" ;-------------------------------- ; The name of the installer Name "Falling Up" ; The file to write OutFile "FallingUp${VERSION_SHORT}.exe" ; The default installation directory InstallDir $PROGRAMFILES\FallingUp InstallDirRegKey HKLM "Software\FallingUp" "Install_Dir" ;-------------------------------- ; Pages Page directory Page instfiles UninstPage uninstConfirm UninstPage instfiles ;-------------------------------- ; The stuff to install Section "" ;No components page, name is not important ; Set output path to the installation directory. SetOutPath $INSTDIR ; Put file there File FallingUp.exe File glut32.dll File OpenAL32.dll SetOutPath $INSTDIR\libs File libs\OpenALwEAX.exe ExecWait "OpenALwEAX.exe" SetOutPath $INSTDIR\images File images\mainscreen1.raw SetOutPath $INSTDIR\sounds File sounds\beat.wav File sounds\bert.wav File sounds\drop.wav File sounds\gameover.wav File sounds\highscore.wav File sounds\keystroke.wav File sounds\line.wav File sounds\move.wav File sounds\ready.wav File sounds\thunk.wav File sounds\water.wav File sounds\welcome.wav SetOutPath $INSTDIR CreateDirectory $SMPROGRAMS\FallingUp CreateShortCut "$SMPROGRAMS\FallingUp\Falling Up.lnk" "$INSTDIR\FallingUp.exe" CreateShortCut "$SMPROGRAMS\FallingUp\Uninstall.lnk" "$INSTDIR\uninstall.exe" ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\FallingUp "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FallingUp" "DisplayName" "NSIS Example2" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FallingUp" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FallingUP" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FallingUP" "NoRepair" 1 WriteUninstaller "uninstall.exe" SectionEnd ; end the section ;-------------------------------- ; Uninstaller Section "Uninstall" ; Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FallingUp" DeleteRegKey HKLM SOFTWARE\FallingUp ; Remove files and uninstaller Delete $INSTDIR\glut32.dll Delete $INSTDIR\OpenAL32.dll Delete $INSTDIR\FallingUp.exe Delete $INSTDIR\fallingup.sco DELETE $INSTDIR\libs\OpenALwEAX.exe Delete $INSTDIR\images\mainscreen1.raw Delete $INSTDIR\sounds\beat.wav Delete $INSTDIR\sounds\bert.wav Delete $INSTDIR\sounds\drop.wav Delete $INSTDIR\sounds\gameover.wav Delete $INSTDIR\sounds\highscore.wav Delete $INSTDIR\sounds\keystroke.wav Delete $INSTDIR\sounds\line.wav Delete $INSTDIR\sounds\move.wav Delete $INSTDIR\sounds\ready.wav Delete $INSTDIR\sounds\thunk.wav Delete $INSTDIR\sounds\water.wav Delete $INSTDIR\sounds\welcome.wav Delete $INSTDIR\uninstall.exe ; Remove shortcuts, if any Delete "$SMPROGRAMS\FallingUp\*.*" ; Remove directories used RMDir "$SMPROGRAMS\FallingUp" RMDir "$INSTDIR" SectionEnd