gen_classicart.nsi 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. ; waplugin.nsi
  2. ;
  3. ; This script will generate an installer that installs a Winamp 2 plug-in.
  4. ;
  5. ; This installer will automatically alert the user that installation was
  6. ; successful, and ask them whether or not they would like to make the
  7. ; plug-in the default and run Winamp.
  8. ;--------------------------------
  9. ;Header Files
  10. !include "Sections.nsh"
  11. !include "WinMessages.nsh"
  12. ; common defines for a generic dro installer :o)
  13. !define VERSION "0.6"
  14. !define ALT_VER "0_6"
  15. !define PLUG "Album Art Viewer"
  16. !define PLUG_ALT "Album_Art_Viewer"
  17. !define PLUG_FILE "gen_classicart"
  18. ; use leet compression
  19. SetCompressor lzma
  20. ; adds xp style support
  21. XPStyle on
  22. ; The name of the installer
  23. Name "${PLUG} v${VERSION}"
  24. ; The file to write
  25. OutFile "${PLUG_ALT}_v${ALT_VER}.exe"
  26. InstType "Plugin only"
  27. InstType "Plugin + language file"
  28. InstType /NOCUSTOM
  29. InstType /COMPONENTSONLYONCUSTOM
  30. ; The default installation directory
  31. InstallDir $PROGRAMFILES\Winamp
  32. InstProgressFlags smooth
  33. ; detect winamp path from uninstall string if available
  34. InstallDirRegKey HKLM \
  35. "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
  36. "UninstallString"
  37. ; The text to prompt the user to enter a directory
  38. DirText "Please select your Winamp path below (you will be able to proceed when Winamp is detected):"
  39. # currently doesn't work - DirShow hide
  40. ; automatically close the installer when done.
  41. AutoCloseWindow true
  42. ; hide the "show details" box
  43. ShowInstDetails show
  44. ;--------------------------------
  45. ;Pages
  46. PageEx directory
  47. Caption " "
  48. PageExEnd
  49. Page components
  50. Page instfiles
  51. ;--------------------------------
  52. ; The stuff to install
  53. Section ""
  54. SetOverwrite on
  55. SetOutPath "$INSTDIR\Plugins"
  56. ; File to extract
  57. File "x86_Release\${PLUG_FILE}.dll"
  58. SetOverwrite off
  59. SectionEnd
  60. Section "Example language file"
  61. ; SectionSetFlags 0 SF_BOLD
  62. SectionIn 2
  63. SetOverwrite on
  64. SetOutPath "$INSTDIR\Plugins\${PLUG_FILE}"
  65. ; File to extract
  66. File "x86_Release\LangFiles\${PLUG_FILE}.lng"
  67. SetOverwrite off
  68. SectionEnd
  69. ;--------------------------------
  70. Function .onInit
  71. ;Detect running Winamp instances and close them
  72. !define WINAMP_FILE_EXIT 40001
  73. FindWindow $R0 "Winamp v1.x"
  74. IntCmp $R0 0 ok
  75. MessageBox MB_YESNO|MB_ICONEXCLAMATION "Please close all instances of Winamp before installing$\n\
  76. ${PLUG} v${VERSION}. Attempt to close Winamp now?" IDYES checkagain IDNO no
  77. checkagain:
  78. FindWindow $R0 "Winamp v1.x"
  79. IntCmp $R0 0 ok
  80. SendMessage $R0 ${WM_COMMAND} ${WINAMP_FILE_EXIT} 0
  81. Goto checkagain
  82. no:
  83. Abort
  84. ok:
  85. FunctionEnd
  86. Function .onInstSuccess
  87. MessageBox MB_YESNO \
  88. '${PLUG} was installed. Do you want to run Winamp now?' \
  89. IDNO end
  90. ExecShell open "$INSTDIR\Winamp.exe"
  91. end:
  92. FunctionEnd
  93. Function .onVerifyInstDir
  94. ;Check for Winamp installation
  95. IfFileExists $INSTDIR\Winamp.exe Good
  96. Abort
  97. Good:
  98. FunctionEnd