home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / nastroje / d23456 / NSIS.EXE / waplugin.nsi < prev    next >
Text File  |  2001-05-19  |  2KB  |  74 lines

  1. ; waplugin.nsi
  2. ;
  3. ; This script will generate an installer that installs a Winamp plug-in.
  4. ; It also puts a license page on, for shits and giggles.
  5. ;
  6. ; This installer will automatically alert the user that installation was
  7. ; successful, and ask them whether or not they would like to make the 
  8. ; plug-in the default and run Winamp.
  9. ;
  10.  
  11. ; The name of the installer
  12. Name "TinyVis Plug-in"
  13.  
  14. ; The file to write
  15. OutFile "waplugin.exe"
  16.  
  17. ; License page
  18. ; LicenseText "This installer will install the Nullsoft Tiny Visualization 2000 Plug-in for Winamp. Please read the license below."
  19. ; use the default makensis license :)
  20. ; LicenseData license.txt
  21.  
  22. ; The default installation directory
  23. InstallDir $PROGRAMFILES\Winamp
  24. ; detect winamp path from uninstall string if available
  25. InstallDirRegKey HKLM \
  26.                  "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
  27.                  "UninstallString"
  28.  
  29. ; The text to prompt the user to enter a directory
  30. DirText "Please select your Winamp path below (you will be able to proceed when Winamp is detected):"
  31. DirShow hide
  32.  
  33. ; automatically close the installer when done.
  34. AutoCloseWindow true
  35. ; hide the "show details" box
  36. ShowInstDetails nevershow
  37.  
  38. Function .onVerifyInstDir
  39.   IfFileExists $INSTDIR\Winamp.exe Good
  40.     Abort
  41.   Good:
  42. FunctionEnd
  43.  
  44. Function QueryWinampVisPath ; sets $1 with vis path
  45.   StrCpy $1 $INSTDIR\Plugins
  46.   ; use DSPDir instead of VISDir to get DSP plugins directory
  47.   ReadINIStr $9 $INSTDIR\winamp.ini Winamp VisDir 
  48.   StrCmp $9 "" End
  49.   IfFileExists $9 0 End
  50.     StrCpy $1 $9 ; update dir
  51.   End: 
  52. FunctionEnd
  53.  
  54.  
  55. ; The stuff to install
  56. Section "ThisNameIsIgnoredSoWhyBother?"
  57.   Call QueryWinampVisPath
  58.   SetOutPath $1
  59.  
  60.   ; File to extract
  61.   File "C:\program files\winamp\plugins\vis_nsfs.dll"
  62.  
  63.   ; prompt user, and if they select no, skip the following 3 instructions.
  64.   MessageBox MB_YESNO|MB_ICONQUESTION \
  65.              "The plug-in was installed. Would you like to run Winamp now with TinyVis as the default plug-in?" \
  66.              IDNO NoWinamp
  67.     WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_name" "vis_nsfs.dll"
  68.     WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_num" "0"
  69.     Exec '"$INSTDIR\Winamp.exe"'
  70.   NoWinamp:
  71. SectionEnd
  72.  
  73. ; eof
  74.