2002-08-23 20:06:23 +00:00
; NSIS Install Script
2002-09-09 05:22:02 +00:00
; created by
; BBF
2002-08-23 20:06:23 +00:00
; I use the following command to create the installer:
; D:\Program Files\NSIS>makensis.exe /v3 /cd "m:\Dev Projects\CVS\stepmania\stepmania.nsi"
;
; NOTE: this .NSI script is designed for NSIS v1.8+
Name "StepMania"
2002-10-24 01:51:01 +00:00
OutFile "stepmania300final.exe"
!define PRODUCT_NAME "StepMania 3.0 final"
2002-08-26 19:30:58 +00:00
2002-08-23 20:06:23 +00:00
; Some default compiler settings (uncomment and change at will):
SetCompress auto ; (can be off or force)
SetDatablockOptimize on ; (can be off)
CRCCheck on ; (can be off)
2002-08-26 19:30:58 +00:00
AutoCloseWindow true ; (can be true for the window go away automatically at end)
2002-08-23 20:06:23 +00:00
; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
; SetDateSave off ; (can be on to have files restored to their orginal date)
InstallDir " $PROGRAMFILES \StepMania"
InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\StepMania\StepMania" ""
DirShow show ; (make this hide to not let the user change it)
DirText "Select the directory to install StepMania in:"
2002-08-26 19:30:58 +00:00
;
; .oninit is called before window is shown
;
2002-08-23 20:06:23 +00:00
Function .onInit
2002-08-26 19:30:58 +00:00
; force uninstall of previous version using Vise
IfFileExists " $INSTDIR \uninstal.log" prompt_uninstall_vise old_vise_not_installed
prompt_uninstall_vise :
MessageBox MB_YESNO | MB_ICONINFORMATION "The previous version of StepMania must be uninstalled before continuing.$\nDo you wish to continue?" IDYES do_uninstall_vise
Abort
do_uninstall_vise :
Exec '$WINDIR\unvise32.exe $INSTDIR\uninstal.log' ; don't use quotes here, or unvise32 will fail
old_vise_not_installed :
; force uninstall of previous version using NSIS
IfFileExists " $INSTDIR \uninst.exe" prompt_uninstall_nsis old_nsis_not_installed
prompt_uninstall_nsis :
MessageBox MB_YESNO | MB_ICONINFORMATION "The previous version of StepMania must be uninstalled before continuing.$\nDo you wish to continue?" IDYES do_uninstall_nsis
Abort
do_uninstall_nsis :
Exec " $INSTDIR \uninst.exe"
old_nsis_not_installed :
2002-08-23 20:06:23 +00:00
; Check for DirextX 8.1 (to be moved to the right section later)
2002-12-20 19:55:15 +00:00
; XXX: we seem to run fine on 8.0 (4.08.00.0400)
2002-08-23 20:06:23 +00:00
ReadRegStr $0 HKEY_LOCAL_MACHINE "Software\Microsoft\DirectX" "Version"
StrCpy $1 $0 2 2 ; 8.1 is "4.08.01.0810"
IntCmpU $1 8 check_subversion old_dx ok
check_subversion :
StrCpy $1 $0 2 5
IntCmpU $1 1 ok old_dx ok
old_dx :
MessageBox MB_YESNO | MB_ICONINFORMATION "You need to upgrade to the latest DirectX to use this software (at least 8.1).$\n Do you wish to visit Microsoft's site now ?" IDYES open_dx_page
Abort
open_dx_page :
ExecShell "" "http://www.microsoft.com/directx/"
Abort
ok :
FunctionEnd
2002-08-26 19:30:58 +00:00
;
; The default install section
;
Section ""
; write out uninstaller
2002-08-23 20:06:23 +00:00
SetOutPath " $INSTDIR "
2002-08-26 19:30:58 +00:00
SetOverwrite on
WriteUninstaller " $INSTDIR \uninst.exe"
; add registry entries
2002-08-23 20:06:23 +00:00
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\StepMania\StepMania" "" " $INSTDIR "
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\StepMania" "DisplayName" "StepMania (remove only)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\StepMania" "UninstallString" '"$INSTDIR\uninst.exe"'
2002-08-26 19:30:58 +00:00
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Classes\Applications\smpackage.exe\shell\open\command" "" '"$INSTDIR\smpackage.exe" "%1"'
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Classes\smzipfile" "" "StepMania package"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Classes\smzipfile\DefaultIcon" "" " $INSTDIR \smpackage.exe,0"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Classes\smzipfile\shell\open\command" "" '"$INSTDIR\smpackage.exe" "%1"'
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Classes\.smzip" "" "smzipfile"
; Begin copying files
2002-08-23 20:06:23 +00:00
SetOverwrite ifnewer
CreateDirectory " $INSTDIR \Announcers"
SetOutPath " $INSTDIR \Announcers"
2002-08-26 19:30:58 +00:00
File "Announcers\instructions.txt"
2002-08-23 20:06:23 +00:00
CreateDirectory " $INSTDIR \BGAnimations"
2002-08-26 19:30:58 +00:00
SetOutPath " $INSTDIR \BGAnimations"
File "BGAnimations\instructions.txt"
2002-08-23 20:06:23 +00:00
CreateDirectory " $INSTDIR \Cache"
SetOutPath " $INSTDIR \Cache"
2002-08-26 19:30:58 +00:00
File "Cache\instructions.txt"
CreateDirectory " $INSTDIR \CDTitles"
SetOutPath " $INSTDIR \CDTitles"
File "CDTitles\instructions.txt"
2002-08-23 20:06:23 +00:00
CreateDirectory " $INSTDIR \Courses"
SetOutPath " $INSTDIR \Courses"
2002-08-26 19:30:58 +00:00
File "Courses\instructions.txt"
2002-08-23 20:06:23 +00:00
2002-08-26 19:30:58 +00:00
CreateDirectory " $INSTDIR \Music"
SetOutPath " $INSTDIR \Music"
File "Music\instructions.txt"
2002-10-21 02:15:06 +00:00
RMDir /r " $INSTDIR \NoteSkins\dance\MAX"
2002-08-26 19:30:58 +00:00
CreateDirectory " $INSTDIR \NoteSkins\dance\MAX"
SetOutPath " $INSTDIR \NoteSkins"
File "NoteSkins\instructions.txt"
SetOutPath " $INSTDIR \NoteSkins\dance"
File /r "NoteSkins\dance\MAX"
CreateDirectory " $INSTDIR \RandomMovies"
SetOutPath " $INSTDIR \RandomMovies"
File "RandomMovies\instructions.txt"
2002-08-23 20:06:23 +00:00
CreateDirectory " $INSTDIR \Songs"
SetOutPath " $INSTDIR \Songs"
2002-08-26 19:30:58 +00:00
File "Songs\instructions.txt"
2002-08-23 20:06:23 +00:00
2002-10-21 02:15:06 +00:00
RMDir /r " $INSTDIR \Themes\default"
2002-08-23 20:06:23 +00:00
CreateDirectory " $INSTDIR \Themes"
SetOutPath " $INSTDIR \Themes"
2002-08-26 19:30:58 +00:00
File "Themes\instructions.txt"
2002-08-23 20:06:23 +00:00
File /r "Themes\default"
CreateDirectory " $INSTDIR \Visualizations"
SetOutPath " $INSTDIR \Visualizations"
2002-08-26 19:30:58 +00:00
File "Visualizations\instructions.txt"
2002-08-23 20:06:23 +00:00
SetOutPath " $INSTDIR "
2002-12-20 19:55:15 +00:00
; File "msvcr70.dll"
; File "msvcp70.dll"
2002-08-23 20:06:23 +00:00
File "bass.dll"
2002-12-20 19:55:15 +00:00
File "jpeg.dll"
File "libpng13a.dll"
File "ogg.dll"
File "vorbis.dll"
File "vorbisfile.dll"
File "zliba.dll"
File "SDL.dll"
File "SDL_image.dll"
File "SDL_net.dll"
2002-08-23 20:06:23 +00:00
File "COPYING.txt"
File "README-FIRST.TXT"
2002-09-09 05:22:02 +00:00
File "NEWS"
2002-08-26 19:30:58 +00:00
File "stepmania.exe"
2002-10-02 21:34:20 +00:00
; What to do here? Better to just delete an existing INI than to
; drop the local one in ... -glenn
2002-10-08 21:57:48 +00:00
; Agreed. - Chris
2002-12-20 19:55:15 +00:00
; But we shouldn't delete, either, since that'll wipe peoples' prefs.
; Better to address upgrade problems than to make people nuke INI's.
; Maybe we should remove this for snapshot releases; that way we can
; track down problems with INI upgrades (and then possibly restore it
; for the release if we're not confident we've fixed most problems) -glenn
2002-10-08 21:57:48 +00:00
Delete " $INSTDIR \stepmania.ini"
2002-10-02 21:34:20 +00:00
File "stepmania.vdi"
2002-08-26 19:30:58 +00:00
File "smpackage.exe"
; Create Start Menu icons
SetShellVarContext all ; install in "All Users" if NT
CreateDirectory " $SMPROGRAMS \StepMania\"
CreateShortCut " $DESKTOP \Play ${PRODUCT_NAME}.lnk" " $INSTDIR \stepmania.exe"
CreateShortCut " $SMPROGRAMS \StepMania\${PRODUCT_NAME}.lnk" " $INSTDIR \stepmania.exe"
CreateShortCut " $SMPROGRAMS \StepMania\Open Songs Folder.lnk" " $WINDIR \explorer.exe" " $INSTDIR \Songs\"
CreateShortCut " $SMPROGRAMS \StepMania\Package Exporter.lnk" " $INSTDIR \smpackage.exe"
CreateShortCut " $SMPROGRAMS \StepMania\README.lnk" " $INSTDIR \README-FIRST.txt"
CreateShortCut " $SMPROGRAMS \StepMania\Uninstall ${PRODUCT_NAME}.lnk" " $INSTDIR \uninst.exe"
CreateShortCut " $SMPROGRAMS \StepMania\Go To StepMania web site.lnk" "http://www.stepmania.com"
Exec '$WINDIR\explorer.exe "$SMPROGRAMS\StepMania\"'
2002-08-23 20:06:23 +00:00
SectionEnd ; end of default section
2002-08-26 19:30:58 +00:00
;
2002-08-23 20:06:23 +00:00
; begin uninstall settings/section
2002-08-26 19:30:58 +00:00
;
UninstallText "This will uninstall StepMania from your system.$\nAny add-on packs or songs you have installed will not be deleted."
2002-08-23 20:06:23 +00:00
Section Uninstall
2002-08-26 19:30:58 +00:00
2002-08-23 20:06:23 +00:00
; add delete commands to delete whatever files/registry keys/etc you installed here.
Delete " $INSTDIR \uninst.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\StepMania\StepMania"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\StepMania"
2002-08-26 19:30:58 +00:00
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Classes\Applications\smpackage.exe\shell\open\command"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Classes\smzipfile"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Classes\.smzip"
2002-08-23 20:06:23 +00:00
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \Announcers\instructions.txt"
RMDir " $INSTDIR \Announcers"
2002-08-23 20:06:23 +00:00
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \BGAnimations\instructions.txt"
RMDir " $INSTDIR \BGAnimations"
2002-08-23 20:06:23 +00:00
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \Cache\instructions.txt"
2002-08-23 20:06:23 +00:00
RMDir " $INSTDIR \Cache"
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \CDTitles\instructions.txt"
RMDir " $INSTDIR \CDTitles"
Delete " $INSTDIR \Cache\instructions.txt"
RMDir " $INSTDIR \Cache"
Delete " $INSTDIR \Courses\instructions.txt"
2002-08-23 20:06:23 +00:00
RMDir " $INSTDIR \Courses"
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \Music\instructions.txt"
RMDir " $INSTDIR \Music"
2002-08-23 20:06:23 +00:00
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \NoteSkins\instructions.txt"
RMDir /r " $INSTDIR \NoteSkins\dance"
RMDir " $INSTDIR \NoteSkins"
2002-08-23 20:06:23 +00:00
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \RandomMovies\instructions.txt"
RMDir " $INSTDIR \RandomMovies"
Delete " $INSTDIR \Songs\instructions.txt"
RMDir " $INSTDIR \Songs" ; will delete only if empty
Delete " $INSTDIR \Themes\instructions.txt"
2002-08-23 20:06:23 +00:00
RMDir /r " $INSTDIR \Themes\default"
RMDir " $INSTDIR \Themes"
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \Visualizations\instructions.txt"
2002-08-23 20:06:23 +00:00
RMDir " $INSTDIR \Visualizations"
Delete " $INSTDIR \bass.dll"
Delete " $INSTDIR \COPYING.txt"
Delete " $INSTDIR \README-FIRST.TXT"
2002-09-09 05:22:02 +00:00
Delete " $INSTDIR \NEWS"
2002-08-26 19:30:58 +00:00
Delete " $INSTDIR \stepmania.exe"
Delete " $INSTDIR \stepmania.ini"
Delete " $INSTDIR \smpackage.exe"
RMDir " $INSTDIR " ; will delete only if empty
SetShellVarContext all ; delete from "All Users" if NT
Delete " $DESKTOP \Play {PRODUCT_NAME}.lnk"
Delete " $SMPROGRAMS \StepMania\*.*"
RMDir " $SMPROGRAMS \StepMania"
2002-08-23 20:06:23 +00:00
SectionEnd ; end of uninstall section
; eof