milkdrop.nsi 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. ; LICENSE
  2. ; -------
  3. ; Copyright 2005-2013 Nullsoft, Inc.
  4. ; All rights reserved.
  5. ;
  6. ; Redistribution and use in source and binary forms, with or without modification,
  7. ; are permitted provided that the following conditions are met:
  8. ;
  9. ; * Redistributions of source code must retain the above copyright notice,
  10. ; this list of conditions and the following disclaimer.
  11. ;
  12. ; * Redistributions in binary form must reproduce the above copyright notice,
  13. ; this list of conditions and the following disclaimer in the documentation
  14. ; and/or other materials provided with the distribution.
  15. ;
  16. ; * Neither the name of Nullsoft nor the names of its contributors may be used to
  17. ; endorse or promote products derived from this software without specific prior written permission.
  18. ;
  19. ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  20. ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  21. ; FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  22. ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. ; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24. ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  25. ; IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  26. ; OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. ; ----------------------------------------------------------------
  28. ; NOTE: this .nsi script was last built with 'makensis.exe'
  29. ; version 1.98. If you go to install it (unchanged) and get errors,
  30. ; try tracking down that older version, or try to figure out what
  31. ; has changed since then. You can get NSIS at:
  32. ;
  33. ; http://www.nullsoft.com/free/nsis/
  34. ;
  35. ; This installer will produce a single EXE file that, when run,
  36. ; will decompress and install your plugin and all of its data files
  37. ; to Winamp 2 or Winamp 3.
  38. ; ----------------------------------------------------------------
  39. ; MODIFYING THIS SCRIPT TO CREATE AN INSTALLER FOR YOUR OWN PLUGIN:
  40. ; ----------------------------------------------------------------
  41. ; 1) there are three sections below, each marked 'EDIT THIS SECTION
  42. ; [x/3]' where 'x' is the section number. These are the 3
  43. ; places where you need to make changes to customize this
  44. ; installer script for your particular plugin. Go to each
  45. ; and make the changes, reading the comments there for
  46. ; more information.
  47. ; 2) download NSIS from http://www.nullsoft.com/free/nsis/, if you
  48. ; haven't already.
  49. ; 3) run the command 'makensis.exe installer.nsi' to build
  50. ; the executable. (note: ignore the warning message about
  51. ; 'InstallRegKey' being used multiple times; this is necessary
  52. ; to determine whether Winamp 2 or 3 is a better candidate
  53. ; for the install.)
  54. ; ----------------------------------------------------------------
  55. ; WHAT THIS INSTALLER SCRIPT DOES:
  56. ; ----------------------------------------------------------------
  57. ; If Winamp 2 is installed, it will install your plugin to Winamp 2,
  58. ; in the directory Winamp\Plugins (or whatever is specified as the
  59. ; vis plugins path, in Winamp\winamp.ini). It will also select
  60. ; the plugin as the current plugin. (Note that Winamp must be
  61. ; closed to do this, so if it's open, the installer will ask the
  62. ; user to close it before proceeding.) At the end of a successful
  63. ; install, it asks if they'd like to run Winamp.
  64. ;
  65. ; If Winamp 2 is not present but Winamp 3 is, or if the user manually
  66. ; selects the Winamp 3 directory to install to, the plugin will be
  67. ; installed to Winamp 3 as a classic visualization plugin, to the
  68. ; directory Winamp3\Plugins. At install time, if ClassicVis is not
  69. ; installed, it will prompt the user to go download it. If they
  70. ; don't download it, it will tell them the installation failed.
  71. ; If they already had it, or after they presumably download it,
  72. ; the installer will briefly tell them how to select their new
  73. ; plugin and run it in Winamp 3, using ClassicVis. Finally, at
  74. ; the end of a successful install, it asks if they'd like to run
  75. ; Winamp 3.
  76. ; ----------------------------------------------------------------
  77. ; -------------------- EDIT THIS SECTION [1/3] --------------------
  78. ; -------------------- EDIT THIS SECTION [1/3] --------------------
  79. ; -------------------- EDIT THIS SECTION [1/3] --------------------
  80. !define PLUGIN_NAME "MilkDrop 2" ; Brief name of the component. Can have spaces in it.
  81. !define INSTALL_CAPTION "MilkDrop 2.2 Setup" ; Caption for the installer dialog
  82. !define PLUGIN_DLL "vis_milk2.dll" ; The filename of the actual plugin
  83. !define PLUGIN_OUTFILE "milkdrop_2.exe" ; Name of the installer to create
  84. ; ----------------------- END SECTION [1/3] -----------------------
  85. ; ----------------------- END SECTION [1/3] -----------------------
  86. ; ----------------------- END SECTION [1/3] -----------------------
  87. ; ----------------------------------------------------------------
  88. Name ${PLUGIN_NAME}
  89. Caption "${INSTALL_CAPTION}"
  90. OutFile ${PLUGIN_OUTFILE}
  91. ; ----------------------------------------------------------------
  92. ; to determine the install directory, we start with Program Files\Winamp.
  93. ; then, if winamp 3 is found, override this and use that directory.
  94. ; finally, if winamp 2 is found, override again and use that directory.
  95. InstallDir $PROGRAMFILES\Winamp
  96. InstallDirRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp3" "UninstallString"
  97. InstallDirRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" "UninstallString"
  98. DirText \
  99. "The installer has determined that this is the path to Winamp.$\rIf it is not correct, please change it. You will not be able to proceed$\runtil a valid path is found." \
  100. "Select the directory in which Winamp 2 or 3 is installed:"
  101. Function .onInit
  102. IfFileExists $INSTDIR\winamp.exe End ; else if winamp.exe found (winamp2), we're good
  103. IfFileExists $INSTDIR\winamp3.exe End ; if winamp3.exe found (winamp3), we're good
  104. IfFileExists $INSTDIR\studio.exe End ; or if studio.exe found (older version of winamp3), we're good
  105. ; the above will work fine if winamp 2 or 3 is installed,
  106. ; but will break if winamp 2 or 3 was uninstalled *but the directory remains.*
  107. IfFileExists $PROGRAMFILES\Winamp\winamp.exe SelectNaturalWinamp2 ; last but not least, try the default winamp 2 directory
  108. IfFileExists $PROGRAMFILES\Winamp3\winamp3.exe SelectNaturalWinamp3 ; otherwise, try the default winamp 3 directory
  109. IfFileExists $PROGRAMFILES\Winamp3\studio.exe SelectNaturalWinamp3 ; otherwise, try the default winamp 3 directory
  110. ; if all of these failed, no good path to Winamp (2 or 3) could be found,
  111. ; and the 'Next' button will be disabled until the user can specify
  112. ; the correct folder.
  113. Goto End
  114. SelectNaturalWinamp3:
  115. strcpy $INSTDIR $PROGRAMFILES\Winamp3
  116. goto End
  117. SelectNaturalWinamp2:
  118. strcpy $INSTDIR $PROGRAMFILES\Winamp
  119. goto End
  120. End:
  121. FunctionEnd
  122. Function .onVerifyInstDir
  123. IfFileExists $INSTDIR\Winamp.exe DirOk
  124. IfFileExists $INSTDIR\Winamp3.exe DirOk
  125. IfFileExists $INSTDIR\Studio.exe DirOk
  126. Abort ; leaves the directory as the selected one, but disables the 'Next' button...
  127. DirOk:
  128. FunctionEnd
  129. Function QueryWinampVisPath
  130. ; input: $INSTDIR, the currently-selected install dir (path to winamp)
  131. ; output: $1, the path to the winamp vis plugins subdirectory
  132. ; -for winamp 3x, this is just $INSTDIR\plugins
  133. ; -for winamp 2x, it comes from the winamp.ini file
  134. ; (or just $INSTDIR\plugins if there is an error reading it.)
  135. IfFileExists $INSTDIR\Winamp.exe CaseWinamp2
  136. IfFileExists $INSTDIR\Winamp3.exe CaseWinamp3
  137. IfFileExists $INSTDIR\Studio.exe CaseWinamp3 ; legacy check
  138. goto CaseImpossible
  139. CaseWinamp2:
  140. StrCpy $1 $INSTDIR\Plugins\MilkDrop2
  141. ReadINIStr $8 $INSTDIR\winamp.ini Winamp VisDir
  142. StrCmp $8 "" End
  143. IfFileExists $8 0 End
  144. StrCpy $1 $8 ; update dir
  145. goto end
  146. CaseWinamp3:
  147. CaseImpossible:
  148. StrCpy $1 $INSTDIR\Plugins\MilkDrop2
  149. goto end
  150. End:
  151. FunctionEnd
  152. ; The stuff to install
  153. Section ""
  154. CloseWinamp2:
  155. ; make sure winamp is closed before we 1) try to install files
  156. ; and 2) (later) edit winamp.ini. for 1), if they're running
  157. ; (or were running) some other vms-based plugin using
  158. ; vms_desktop.dll, then if winamp is still open, the installer
  159. ; could have trouble overwriting vms_desktop.dll, or other files;
  160. ; the user would get an abort/retry/ignore box, but it's easier
  161. ; to just play it safe.
  162. FindWindow $R0 "winamp v1.x"
  163. StrCmp $R0 0 "" RequestCloseWinamp2
  164. goto Winamp2Closed
  165. RequestCloseWinamp2:
  166. MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "Winamp is currently running; please close it,$\rand then hit OK to continue..." \
  167. IDCANCEL WarnWinampStillOpen
  168. goto CloseWinamp2
  169. WarnWinampStillOpen:
  170. FindWindow $R0 "winamp v1.x"
  171. StrCmp $R0 0 "" WarnWinampStillOpen2
  172. goto Winamp2Closed
  173. WarnWinampStillOpen2:
  174. MessageBox MB_OK|MB_ICONEXCLAMATION "Warning: Winamp is still open; as a result, the installer$\rwill not be able to set ${PLUGIN_NAME} as the default plugin; you will$\rhave to do this yourself.$\r$\rTo do so, wait until the installation is finished. Then bring up $\rWinamp and hit CTRL+K. From there, you will be able to select$\r${PLUGIN_NAME} from the list of visualization plug-ins, and it will$\rbecome the new default."
  175. goto Winamp2Closed
  176. Winamp2Closed:
  177. ; this function sets $1 to point to the 'winamp\plugins\milkdrop2' folder:
  178. ; (see function definition above)
  179. Call QueryWinampVisPath
  180. ; -------------------- EDIT THIS SECTION [2/3] --------------------
  181. ; -------------------- EDIT THIS SECTION [2/3] --------------------
  182. ; -------------------- EDIT THIS SECTION [2/3] --------------------
  183. ; LIST FILES TO INCLUDE WITH THE INSTALLER
  184. ; For each file we want to install onto the destination system,
  185. ; we first set the output directory (relative to $1, which is
  186. ; the PLUGINS directory) and then list files. The paths for
  187. ; the files will be local paths on your hard disk, but fear not -
  188. ; the files will be placed in the current output directory
  189. ; (as last set by SetOutPath) on the destination system.
  190. ; So, first, we set the current output path (the folder to which
  191. ; files will be decompressed on the user's system) to '$1',
  192. ; which is the path to their winamp plugins folder.
  193. SetOutPath $1
  194. File "C:\program files\winamp\plugins\${PLUGIN_DLL}"
  195. SetOutPath $1\Milkdrop2\config
  196. File "C:\program files\winamp\plugins\milkdrop2\config\milk_msg.ini"
  197. File "C:\program files\winamp\plugins\milkdrop2\config\milk_img.ini"
  198. ;File "C:\program files\winamp\plugins\milkdrop2\config\milkdrop.ini" ;this one will be generated - do not install
  199. SetOutPath $1\Milkdrop2\data
  200. File "C:\program files\winamp\plugins\milkdrop2\data\vms_desktop.dll"
  201. File "C:\program files\winamp\plugins\milkdrop2\data\comp_ps.fx"
  202. File "C:\program files\winamp\plugins\milkdrop2\data\comp_vs.fx"
  203. File "C:\program files\winamp\plugins\milkdrop2\data\warp_ps.fx"
  204. File "C:\program files\winamp\plugins\milkdrop2\data\warp_vs.fx"
  205. File "C:\program files\winamp\plugins\milkdrop2\data\include.fx"
  206. SetOutPath $1\Milkdrop2\docs
  207. File "C:\program files\winamp\plugins\milkdrop2\docs\milkdrop.html"
  208. File "C:\program files\winamp\plugins\milkdrop2\docs\milkdrop_preset_authoring.html"
  209. File "C:\program files\winamp\plugins\milkdrop2\docs\q_and_t_vars.gif"
  210. SetOutPath $1\Milkdrop2\textures
  211. File "C:\program files\winamp\plugins\milkdrop2\textures\*.*"
  212. SetOutPath $1\Milkdrop2\presets
  213. File "C:\program files\winamp\plugins\milkdrop2\presets\*.milk"
  214. hmmm
  215. SetOutPath $1\MilkDrop2\presets\3d
  216. File "C:\program files\winamp\plugins\milkdrop2\presets\3d\*.milk"
  217. hmmm
  218. SetOutPath $1\MilkDrop2\presets\inverted
  219. File "C:\program files\winamp\plugins\milkdrop2\presets\inverted\*.milk"
  220. ; ----------------------- END SECTION [2/3] -----------------------
  221. ; ----------------------- END SECTION [2/3] -----------------------
  222. ; ----------------------- END SECTION [2/3] -----------------------
  223. ; now time to create the Uninstaller:
  224. IfFileExists $INSTDIR\Winamp.exe UninstWinamp2
  225. IfFileExists $INSTDIR\Winamp3.exe UninstWinamp3
  226. IfFileExists $INSTDIR\Studio.exe UninstWinamp3 ; legacy check
  227. goto UninstDone
  228. UninstWinamp3:
  229. WriteRegStr HKLM SOFTWARE\${PLUGIN_DLL}Winamp3 "Install_Dir" "$INSTDIR"
  230. WriteRegStr HKLM SOFTWARE\${PLUGIN_DLL}Winamp3 "Install_Plugins_Dir" $1
  231. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp3" "DisplayName" "${PLUGIN_NAME} for Winamp 3 (remove only)"
  232. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp3" "UninstallString" '"$INSTDIR\uninst-${PLUGIN_DLL}.exe"'
  233. WriteUninstaller "$INSTDIR\uninst-${PLUGIN_DLL}.exe"
  234. CreateDirectory "$SMPROGRAMS\Winamp3\Vis Plugin Uninstallers"
  235. CreateShortCut "$SMPROGRAMS\Winamp3\Vis Plugin Uninstallers\Uninstall ${PLUGIN_NAME}.lnk" "$INSTDIR\uninst-${PLUGIN_DLL}.exe" "" "$INSTDIR\uninst-${PLUGIN_DLL}.exe" 0
  236. goto UninstDone
  237. UninstWinamp2:
  238. WriteRegStr HKLM SOFTWARE\${PLUGIN_DLL}Winamp "Install_Dir" "$INSTDIR"
  239. WriteRegStr HKLM SOFTWARE\${PLUGIN_DLL}Winamp "Install_Plugins_Dir" $1
  240. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp" "DisplayName" "${PLUGIN_NAME} for Winamp 2x (remove only)"
  241. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp" "UninstallString" '"$INSTDIR\uninst-${PLUGIN_DLL}.exe"'
  242. WriteUninstaller "$INSTDIR\uninst-${PLUGIN_DLL}.exe"
  243. CreateDirectory "$SMPROGRAMS\Winamp\Vis Plugin Uninstallers"
  244. CreateShortCut "$SMPROGRAMS\Winamp\Vis Plugin Uninstallers\Uninstall ${PLUGIN_NAME}.lnk" "$INSTDIR\uninst-${PLUGIN_DLL}.exe" "" "$INSTDIR\uninst-${PLUGIN_DLL}.exe" 0
  245. goto UninstDone
  246. UninstDone:
  247. SectionEnd
  248. ;----------------------------------------------------------------------
  249. UninstallText "This will uninstall the ${PLUGIN_NAME} plugin. Hit next to continue."
  250. ShowUninstDetails Show
  251. Section "Uninstall"
  252. ; This section is the code that will be run when the user goes
  253. ; to Uninstall the plugin.
  254. IfFileExists $INSTDIR\Winamp.exe UninstStep1Winamp2
  255. IfFileExists $INSTDIR\Winamp3.exe UninstStep1Winamp3
  256. IfFileExists $INSTDIR\Studio.exe UninstStep1Winamp3 ; legacy check
  257. goto UninstScriptDone
  258. UninstStep1Winamp3:
  259. ReadRegStr $1 HKLM SOFTWARE\${PLUGIN_DLL}Winamp3 "Install_Plugins_Dir"
  260. goto UninstStep2
  261. UninstStep1Winamp2:
  262. ReadRegStr $1 HKLM SOFTWARE\${PLUGIN_DLL}Winamp "Install_Plugins_Dir"
  263. goto UninstStep2
  264. UninstStep2:
  265. ; -------------------- EDIT THIS SECTION [3/3] --------------------
  266. ; -------------------- EDIT THIS SECTION [3/3] --------------------
  267. ; -------------------- EDIT THIS SECTION [3/3] --------------------
  268. ; LIST OF FILES TO DELETE WHEN USER RUNS THE UNINSTALL
  269. Delete "$1\${PLUGIN_DLL}"
  270. ;Delete "$1\vms_desktop.dll" ** DO NOT DELETE! **
  271. Delete "$1\milkdrop.html"
  272. Delete "$1\milkdrop_preset_authoring.html"
  273. Delete "$1\q_and_t_vars.gif"
  274. MessageBox MB_YESNO|MB_ICONQUESTION \
  275. "Clear your saved settings?:$\r $1\milkdrop_config.ini$\r $1\milk_msg.ini$\r $1\milk_img.ini" \
  276. IDNO SaveSettings
  277. Delete "$1\milkdrop_config.ini"
  278. Delete "$1\milk_msg.ini"
  279. Delete "$1\milk_img.ini"
  280. SaveSettings:
  281. MessageBox MB_YESNO|MB_ICONQUESTION \
  282. "Delete all presets in these 3 directories?:$\r $1\milkdrop$\r $1\milkdrop\3d$\r $1\milkdrop\inverted" \
  283. IDNO SavePresets
  284. Delete "$1\milkdrop2\inverted\*.milk"
  285. Delete "$1\milkdrop2\3d\*.milk"
  286. Delete "$1\milkdrop2\*.milk"
  287. RMDir "$1\milkdrop2\inverted"
  288. RMDir "$1\milkdrop2\3d"
  289. RMDir "$1\milkdrop2"
  290. SavePresets:
  291. ; ----------------------- END SECTION [3/3] -----------------------
  292. ; ----------------------- END SECTION [3/3] -----------------------
  293. ; ----------------------- END SECTION [3/3] -----------------------
  294. IfFileExists $INSTDIR\Winamp.exe UninstStep3Winamp2
  295. IfFileExists $INSTDIR\Winamp3.exe UninstStep3Winamp3
  296. IfFileExists $INSTDIR\Studio.exe UninstStep3Winamp3 ; legacy check
  297. goto UninstScriptDone
  298. UninstStep3Winamp3:
  299. DeleteRegKey HKLM SOFTWARE\${PLUGIN_DLL}Winamp3
  300. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp3"
  301. Delete $INSTDIR\uninst-${PLUGIN_DLL}.exe
  302. Delete "$SMPROGRAMS\Winamp3\Vis Plugin Uninstallers\Uninstall ${PLUGIN_NAME}.lnk"
  303. RMDir "$SMPROGRAMS\Winamp3\Vis Plugin Uninstallers"
  304. goto UninstScriptDone
  305. UninstStep3Winamp2:
  306. DeleteRegKey HKLM SOFTWARE\${PLUGIN_DLL}Winamp
  307. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp"
  308. Delete $INSTDIR\uninst-${PLUGIN_DLL}.exe
  309. Delete "$SMPROGRAMS\Winamp\Vis Plugin Uninstallers\Uninstall ${PLUGIN_NAME}.lnk"
  310. RMDir "$SMPROGRAMS\Winamp\Vis Plugin Uninstallers"
  311. goto UninstScriptDone
  312. UninstScriptDone:
  313. SectionEnd
  314. ;----------------------------------------------------------------------
  315. Function .onInstSuccess
  316. IfFileExists $INSTDIR\Winamp.exe CaseWinamp2
  317. IfFileExists $INSTDIR\Winamp3.exe CaseWinamp3
  318. IfFileExists $INSTDIR\Studio.exe CaseWinamp3 ; legacy check
  319. goto CaseImpossible
  320. CaseWinamp3:
  321. IfFileExists $INSTDIR\wacs\classicvis.wac ClassicVisOk
  322. ; no classicvis -> give them instructions
  323. MessageBox MB_YESNO|MB_ICONEXCLAMATION \
  324. "IMPORTANT: You must download and install the Classic Visualization$\rComponent before ${PLUGIN_NAME} will work with Winamp 3.$\r$\rWould you like to download it now?" \
  325. IDNO FailNoClassicVis
  326. ExecShell "open" "http://www.winamp.com/components3/detail.jhtml?componentId=122130"
  327. MessageBox MB_OK|MB_ICONINFORMATION \
  328. "Your web browser will now open and allow you to download$\rthe Classic Visualization Component. Please download$\rand install it.$\r$\rOnce it is installed, open Winamp 3 and hit CTRL+P$\rto open the Preferences screen. Then, on the left,$\rscroll to 'Classic Visualizations' and select it. From there,$\ryou can easily select, configure and run any plugins$\rinstalled to Winamp 2 or 3."
  329. goto end
  330. FailNoClassicVis:
  331. MessageBox MB_OK|MB_ICONSTOP "Installation failed."
  332. goto end
  333. ClassicVisOk:
  334. FindWindow $R0 "STUDIO"
  335. StrCmp $R0 0 "" DoneWinamp3
  336. MessageBox MB_YESNO|MB_ICONQUESTION \
  337. "${PLUGIN_NAME} was installed successfully.$\rWould you like to run Winamp 3 now?" \
  338. IDNO DoneWinamp3
  339. ; to do here: update 'oldvisname' string in the *xml* file winamp3\studio.xnf,
  340. ; and set 'oldvisidx' to "0"
  341. IfFileExists $INSTDIR\Winamp3.exe CaseWinamp3b
  342. Exec '"$INSTDIR\studio.exe"'
  343. goto DoneWinamp3
  344. CaseWinamp3b:
  345. Exec '"$INSTDIR\winamp3.exe"'
  346. goto DoneWinamp3
  347. DoneWinamp3:
  348. MessageBox MB_OK "While in Winamp 3, press CTRL+P to bring up the$\rPreferences screen, then scroll down and select$\rthe 'Classic Visualizations' option. From there,$\ryou can select, configure, and run the ${PLUGIN_NAME} plugin."
  349. goto end
  350. CaseWinamp2:
  351. ; note: winamp 2 should already be closed at this point.
  352. WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_name" ${PLUGIN_DLL}
  353. WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_num" "0"
  354. MessageBox MB_YESNO|MB_ICONQUESTION \
  355. "${PLUGIN_NAME} was installed successfully.$\r$\rWhile in Winamp, press ALT+K to configure it (optional);$\rpress CTRL+SHIFT+K to execute it.$\r$\rWould you like to run Winamp now?" \
  356. IDNO end
  357. Exec '"$INSTDIR\Winamp.exe"'
  358. Goto end
  359. CaseImpossible:
  360. MessageBox MB_OK|MB_ICONEXCLAMATION "ERROR: unable to find winamp.exe (winamp2) or studio.exe/winamp3.exe (winamp3) in the install directory..."
  361. Goto end
  362. End:
  363. FunctionEnd
  364. ; eof