; GoldYoink.nsi ; ; This script will install the GameDev game GoldYoink. ; ; See http://gamedev.sf.net/ for details ; ; The name of the installer Name "GoldYoink" ; Output installer EXE name OutFile "GoldYoinkInst.exe" ; Default installation directory InstallDir "$PROGRAMFILES\GoldYoink" ; Remember install location if we installed previously InstallDirRegKey HKLM "SOFTWARE\GoldYoink" "Install_Dir" ; Allow the user to alter the install directory DirText "Please specify an install directory:" ; NOTE! If you use [a pre-release version of] NSIS 2.0, you may need ; to comment out the following line by preceding it with a semicolon. DirShow show UninstallText "Uninstall GoldYoink" ComponentText "Install GoldYoink" Section "Required Components" ; Install required system components first SetOutPath $SYSDIR SetOverwrite ifnewer ; VB Runtime Files CopyVBSysFiles: File "C:\WINDOWS\System32\ComCat.DLL" File "C:\WINDOWS\System32\STDOLE2.TLB" File "C:\WINDOWS\System32\ASYCFILT.DLL" File "C:\WINDOWS\System32\OLEPRO32.DLL" File "C:\WINDOWS\System32\OLEAUT32.DLL" File "C:\WINDOWS\System32\MSVBVM60.DLL" IfErrors 0 CopyMSFiles MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "An error occurred copying VB runtime files" IDRETRY CopyVBSysFiles MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to continue installing anyway?" IDNO EndInstall ; Referenced Microsoft Files and ActiveX Controls CopyMSFiles: File "C:\WINDOWS\System32\Comdlg32.ocx" RegDLL "$SYSDIR\Comdlg32.ocx" File "C:\WINDOWS\System32\MSComCtl.ocx" RegDLL "$SYSDIR\MSComCtl.ocx" IfErrors 0 CopyAppExeFiles MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "An error occurred copying ActiveX files" IDRETRY CopyMSFiles MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to continue installing anyway?" IDNO EndInstall ; Set output path to the installation directory. CopyAppExeFiles: SetOutPath $INSTDIR ; Copy Game System files to destination File "C:\Program Files\MyProjects\GameDev\GDPlay.exe" ; Normally GDPlay.EXE is a registered EXE, but this is not a necessary step File "C:\Program Files\MyProjects\GameDev\BMDXCtls.dll" RegDLL "$INSTDIR\BMDXCtls.dll" File "C:\Program Files\MyProjects\GameDev\ScrHost.dll" RegDLL "$INSTDIR\ScrHost.dll" IfErrors 0 CopyGameDatFiles MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "An error occurred application files" IDRETRY CopyAppExeFiles MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to continue installing anyway?" IDNO EndInstall ; Copy Game Data files to destination CopyGameDatFiles: File "C:\Program Files\MyProjects\GamePrj\Ladder\*.*" IfErrors 0 CreateGameShortcut MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "An error occurred copying game data files" IDRETRY CopyGameDatFiles MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to continue installing anyway?" IDNO EndInstall CreateGameShortcut: CreateDirectory "$SMPROGRAMS\GoldYoink" CreateShortCut "$SMPROGRAMS\GoldYoink\Play GoldYoink.lnk" "$INSTDIR\GDPlay.exe" '"$INSTDIR\GoldYoink.gdp" /p "$INSTDIR\GoldYoink.vbs"' CreateShortCut "$SMPROGRAMS\GoldYoink\Uninstall GoldYoink.lnk" "$INSTDIR\Uninst.exe" ; Store install location in case install runs again WriteRegStr HKLM "SOFTWARE\GoldYoink" "Install_Dir" "$INSTDIR" ; Add un-install entry for Add/Remove Programs WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GoldYoink" "DisplayName" "GoldYoink (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GoldYoink" "UninstallString" '"$INSTDIR\Uninst.exe"' WriteUninstaller "Uninst.exe" EndInstall: SectionEnd Section "Uninstall" MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "BMDXCtls.dll and ScrHost.dll will be unregistered and removed.$\r$\nIf you use The Scrolling Game Development Kit on this system you will have to re-register those files using regsvr32 or re-install GameDev, unless you have GameDev version 1.4 or later." IDCANCEL EndUninstall DeleteRegKey HKLM "SOFTWARE\GoldYoink" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GoldYoink" UnRegDLL "$INSTDIR\BMDXCtls.dll" UnRegDLL "$INSTDIR\ScrHost.dll" Delete "$INSTDIR\*.*" RMDir "$INSTDIR" Delete "$SMPROGRAMS\GoldYoink\*.*" RMDir "$SMPROGRAMS\GoldYoink" IfFileExists "$INSTDIR" 0 EndUninstall MessageBox MB_OK "Could not delete $INSTDIR" IDOK 0 IfFileExists "$SMPROGRAMS\GoldYoink" 0 EndUninstall MessageBox MB_OK "Could not remove shortcut." IDOK 0 EndUninstall: SectionEnd