; sdlperl.nsi ; ; Wayne Keenan 2002 ; The name of the installer Name "SDL_Perl" ; The file to write OutFile "%SDL_PERL_RELEASE_ID%.exe" ; The default installation directory InstallDir $PROGRAMFILES\SDL_Perl ; Registry key to check for directory (so if you install again, it will ; overwrite the old one automatically) InstallDirRegKey HKLM SOFTWARE\SDL_Perl "Install_Dir" ; The text to prompt the user to enter a directory ComponentText "This will install SDL_Perl on your computer. Select which optional things you want installed." ; The text to prompt the user to enter a directory DirText "Choose a directory to install in to:" ShowInstDetails Show ; The stuff to install Section "SDL_Perl Modules (required)" ; Set output path to the installation directory. SetOutPath $INSTDIR ; Put file there File "README.win32" File "CHANGELOG" File /r test ; put in the PPD files File "SDL_perl.ppd" File "%SDL_PERL_RELEASE_ID%.tar.gz" SearchPath $1 ppm.bat ExecWait '$1 remove SDL_Perl' ExecWait '$1 install --location="$INSTDIR" SDL_Perl' ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\SDL_Perl "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDL_Perl" "DisplayName" "SDL_Perl (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDL_Perl" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe" SectionEnd Section "SDL_Perl Examples" ; Set output path to the installation directory. SetOutPath $INSTDIR File /r test SectionEnd ; optional section Section "Core SDL and 3rd party DLL's" SetOutPath $WINDIR %LIST:DLLFiles% SectionEnd ; optional section Section "Start Menu Shortcuts" CreateDirectory "$SMPROGRAMS\SDL_Perl" CreateShortCut "$SMPROGRAMS\SDL_Perl\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\SDL_Perl\ReadMe.lnk" "$INSTDIR\readme.win32.txt" "" "$INSTDIR\readme.win32.txt" 0 CreateShortCut "$SMPROGRAMS\SDL_Perl\CHANGELOG.lnk" "$INSTDIR\readme.win32.txt" "" "$INSTDIR\CHANGELOG" 0 CreateShortCut "$SMPROGRAMS\SDL_Perl\Examples.lnk" "$INSTDIR\Test" "" "$INSTDIR\test" 0 SectionEnd ; uninstall stuff UninstallText "This will uninstall SDL_Perl. Hit next to continue." ; special uninstall section. Section "Uninstall" ; remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDL_Perl" DeleteRegKey HKLM SOFTWARE\SDL_Perl ; remove files Delete $INSTDIR\readme.win32.txt Delete $INSTDIR\CHANGELOG Delete "$INSTDIR\SDL_perl.ppd" Delete "$INSTDIR\%SDL_PERL_RELEASE_ID%.tar.gz" ; MUST REMOVE UNINSTALLER, too Delete $INSTDIR\uninstall.exe Delete "$WINDIR\sdl_gfx.dll" Delete "$WINDIR\zlib.dll" Delete "$WINDIR\libpng1.dll" Delete "$WINDIR\sdl_image.dll" Delete "$WINDIR\jpeg.dll" Delete "$WINDIR\sdl_mixer.dll" Delete "$WINDIR\sdl_net.dll" Delete "$WINDIR\vorbisfile.dll" Delete "$WINDIR\ogg.dll" Delete "$WINDIR\sdl_sound.dll" Delete "$WINDIR\smpeg.dll" Delete "$WINDIR\vorbis.dll" Delete "$WINDIR\in_flac.dll" Delete "$WINDIR\sdl_ttf.dll" Delete "$WINDIR\sdl.dll" Delete "$WINDIR\sdl_console.dll" ; remove shortcuts, if any. Delete "$SMPROGRAMS\SDL_Perl\*.*" ; remove directories used. RMDir "$SMPROGRAMS\SDL_Perl" RMDir /r "$INSTDIR" SearchPath $1 ppm.bat ExecWait '$1 remove SDL_Perl' SectionEnd ; eof