123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439 |
- !define PLUGIN_NAME "MilkDrop 2"
- !define INSTALL_CAPTION "MilkDrop 2.2 Setup"
- !define PLUGIN_DLL "vis_milk2.dll"
- !define PLUGIN_OUTFILE "milkdrop_2.exe"
- Name ${PLUGIN_NAME}
- Caption "${INSTALL_CAPTION}"
- OutFile ${PLUGIN_OUTFILE}
- InstallDir $PROGRAMFILES\Winamp
- InstallDirRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp3" "UninstallString"
- InstallDirRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" "UninstallString"
- DirText \
- "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." \
- "Select the directory in which Winamp 2 or 3 is installed:"
- Function .onInit
- IfFileExists $INSTDIR\winamp.exe End
- IfFileExists $INSTDIR\winamp3.exe End
- IfFileExists $INSTDIR\studio.exe End
-
-
- IfFileExists $PROGRAMFILES\Winamp\winamp.exe SelectNaturalWinamp2
- IfFileExists $PROGRAMFILES\Winamp3\winamp3.exe SelectNaturalWinamp3
- IfFileExists $PROGRAMFILES\Winamp3\studio.exe SelectNaturalWinamp3
-
-
-
- Goto End
-
- SelectNaturalWinamp3:
- strcpy $INSTDIR $PROGRAMFILES\Winamp3
- goto End
-
- SelectNaturalWinamp2:
- strcpy $INSTDIR $PROGRAMFILES\Winamp
- goto End
-
- End:
- FunctionEnd
- Function .onVerifyInstDir
- IfFileExists $INSTDIR\Winamp.exe DirOk
- IfFileExists $INSTDIR\Winamp3.exe DirOk
- IfFileExists $INSTDIR\Studio.exe DirOk
- Abort
-
- DirOk:
- FunctionEnd
-
-
- Function QueryWinampVisPath
-
-
-
-
-
- IfFileExists $INSTDIR\Winamp.exe CaseWinamp2
- IfFileExists $INSTDIR\Winamp3.exe CaseWinamp3
- IfFileExists $INSTDIR\Studio.exe CaseWinamp3
- goto CaseImpossible
-
- CaseWinamp2:
- StrCpy $1 $INSTDIR\Plugins\MilkDrop2
- ReadINIStr $8 $INSTDIR\winamp.ini Winamp VisDir
- StrCmp $8 "" End
- IfFileExists $8 0 End
- StrCpy $1 $8
- goto end
-
- CaseWinamp3:
- CaseImpossible:
- StrCpy $1 $INSTDIR\Plugins\MilkDrop2
- goto end
-
- End:
- FunctionEnd
- Section ""
- CloseWinamp2:
-
-
-
-
-
-
-
- FindWindow $R0 "winamp v1.x"
- StrCmp $R0 0 "" RequestCloseWinamp2
- goto Winamp2Closed
- RequestCloseWinamp2:
- MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "Winamp is currently running; please close it,$\rand then hit OK to continue..." \
- IDCANCEL WarnWinampStillOpen
- goto CloseWinamp2
- WarnWinampStillOpen:
- FindWindow $R0 "winamp v1.x"
- StrCmp $R0 0 "" WarnWinampStillOpen2
- goto Winamp2Closed
- WarnWinampStillOpen2:
- 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."
- goto Winamp2Closed
- Winamp2Closed:
-
-
- Call QueryWinampVisPath
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SetOutPath $1
- File "C:\program files\winamp\plugins\${PLUGIN_DLL}"
-
- SetOutPath $1\Milkdrop2\config
- File "C:\program files\winamp\plugins\milkdrop2\config\milk_msg.ini"
- File "C:\program files\winamp\plugins\milkdrop2\config\milk_img.ini"
-
- SetOutPath $1\Milkdrop2\data
- File "C:\program files\winamp\plugins\milkdrop2\data\vms_desktop.dll"
- File "C:\program files\winamp\plugins\milkdrop2\data\comp_ps.fx"
- File "C:\program files\winamp\plugins\milkdrop2\data\comp_vs.fx"
- File "C:\program files\winamp\plugins\milkdrop2\data\warp_ps.fx"
- File "C:\program files\winamp\plugins\milkdrop2\data\warp_vs.fx"
- File "C:\program files\winamp\plugins\milkdrop2\data\include.fx"
- SetOutPath $1\Milkdrop2\docs
- File "C:\program files\winamp\plugins\milkdrop2\docs\milkdrop.html"
- File "C:\program files\winamp\plugins\milkdrop2\docs\milkdrop_preset_authoring.html"
- File "C:\program files\winamp\plugins\milkdrop2\docs\q_and_t_vars.gif"
- SetOutPath $1\Milkdrop2\textures
- File "C:\program files\winamp\plugins\milkdrop2\textures\*.*"
-
- SetOutPath $1\Milkdrop2\presets
- File "C:\program files\winamp\plugins\milkdrop2\presets\*.milk"
-
- hmmm
- SetOutPath $1\MilkDrop2\presets\3d
- File "C:\program files\winamp\plugins\milkdrop2\presets\3d\*.milk"
-
- hmmm
- SetOutPath $1\MilkDrop2\presets\inverted
- File "C:\program files\winamp\plugins\milkdrop2\presets\inverted\*.milk"
-
-
-
-
-
-
- IfFileExists $INSTDIR\Winamp.exe UninstWinamp2
- IfFileExists $INSTDIR\Winamp3.exe UninstWinamp3
- IfFileExists $INSTDIR\Studio.exe UninstWinamp3
- goto UninstDone
- UninstWinamp3:
- WriteRegStr HKLM SOFTWARE\${PLUGIN_DLL}Winamp3 "Install_Dir" "$INSTDIR"
- WriteRegStr HKLM SOFTWARE\${PLUGIN_DLL}Winamp3 "Install_Plugins_Dir" $1
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp3" "DisplayName" "${PLUGIN_NAME} for Winamp 3 (remove only)"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp3" "UninstallString" '"$INSTDIR\uninst-${PLUGIN_DLL}.exe"'
- WriteUninstaller "$INSTDIR\uninst-${PLUGIN_DLL}.exe"
- CreateDirectory "$SMPROGRAMS\Winamp3\Vis Plugin Uninstallers"
- CreateShortCut "$SMPROGRAMS\Winamp3\Vis Plugin Uninstallers\Uninstall ${PLUGIN_NAME}.lnk" "$INSTDIR\uninst-${PLUGIN_DLL}.exe" "" "$INSTDIR\uninst-${PLUGIN_DLL}.exe" 0
- goto UninstDone
-
- UninstWinamp2:
- WriteRegStr HKLM SOFTWARE\${PLUGIN_DLL}Winamp "Install_Dir" "$INSTDIR"
- WriteRegStr HKLM SOFTWARE\${PLUGIN_DLL}Winamp "Install_Plugins_Dir" $1
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp" "DisplayName" "${PLUGIN_NAME} for Winamp 2x (remove only)"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp" "UninstallString" '"$INSTDIR\uninst-${PLUGIN_DLL}.exe"'
- WriteUninstaller "$INSTDIR\uninst-${PLUGIN_DLL}.exe"
- CreateDirectory "$SMPROGRAMS\Winamp\Vis Plugin Uninstallers"
- CreateShortCut "$SMPROGRAMS\Winamp\Vis Plugin Uninstallers\Uninstall ${PLUGIN_NAME}.lnk" "$INSTDIR\uninst-${PLUGIN_DLL}.exe" "" "$INSTDIR\uninst-${PLUGIN_DLL}.exe" 0
- goto UninstDone
-
- UninstDone:
- SectionEnd
- UninstallText "This will uninstall the ${PLUGIN_NAME} plugin. Hit next to continue."
- ShowUninstDetails Show
- Section "Uninstall"
-
-
- IfFileExists $INSTDIR\Winamp.exe UninstStep1Winamp2
- IfFileExists $INSTDIR\Winamp3.exe UninstStep1Winamp3
- IfFileExists $INSTDIR\Studio.exe UninstStep1Winamp3
- goto UninstScriptDone
- UninstStep1Winamp3:
- ReadRegStr $1 HKLM SOFTWARE\${PLUGIN_DLL}Winamp3 "Install_Plugins_Dir"
- goto UninstStep2
- UninstStep1Winamp2:
- ReadRegStr $1 HKLM SOFTWARE\${PLUGIN_DLL}Winamp "Install_Plugins_Dir"
- goto UninstStep2
- UninstStep2:
-
-
-
-
-
- Delete "$1\${PLUGIN_DLL}"
-
- Delete "$1\milkdrop.html"
- Delete "$1\milkdrop_preset_authoring.html"
- Delete "$1\q_and_t_vars.gif"
- MessageBox MB_YESNO|MB_ICONQUESTION \
- "Clear your saved settings?:$\r $1\milkdrop_config.ini$\r $1\milk_msg.ini$\r $1\milk_img.ini" \
- IDNO SaveSettings
- Delete "$1\milkdrop_config.ini"
- Delete "$1\milk_msg.ini"
- Delete "$1\milk_img.ini"
- SaveSettings:
- MessageBox MB_YESNO|MB_ICONQUESTION \
- "Delete all presets in these 3 directories?:$\r $1\milkdrop$\r $1\milkdrop\3d$\r $1\milkdrop\inverted" \
- IDNO SavePresets
-
- Delete "$1\milkdrop2\inverted\*.milk"
- Delete "$1\milkdrop2\3d\*.milk"
- Delete "$1\milkdrop2\*.milk"
- RMDir "$1\milkdrop2\inverted"
- RMDir "$1\milkdrop2\3d"
- RMDir "$1\milkdrop2"
-
- SavePresets:
-
-
-
-
-
- IfFileExists $INSTDIR\Winamp.exe UninstStep3Winamp2
- IfFileExists $INSTDIR\Winamp3.exe UninstStep3Winamp3
- IfFileExists $INSTDIR\Studio.exe UninstStep3Winamp3
- goto UninstScriptDone
-
- UninstStep3Winamp3:
- DeleteRegKey HKLM SOFTWARE\${PLUGIN_DLL}Winamp3
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp3"
- Delete $INSTDIR\uninst-${PLUGIN_DLL}.exe
- Delete "$SMPROGRAMS\Winamp3\Vis Plugin Uninstallers\Uninstall ${PLUGIN_NAME}.lnk"
- RMDir "$SMPROGRAMS\Winamp3\Vis Plugin Uninstallers"
- goto UninstScriptDone
- UninstStep3Winamp2:
- DeleteRegKey HKLM SOFTWARE\${PLUGIN_DLL}Winamp
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PLUGIN_DLL}Winamp"
- Delete $INSTDIR\uninst-${PLUGIN_DLL}.exe
- Delete "$SMPROGRAMS\Winamp\Vis Plugin Uninstallers\Uninstall ${PLUGIN_NAME}.lnk"
- RMDir "$SMPROGRAMS\Winamp\Vis Plugin Uninstallers"
- goto UninstScriptDone
- UninstScriptDone:
- SectionEnd
- Function .onInstSuccess
- IfFileExists $INSTDIR\Winamp.exe CaseWinamp2
- IfFileExists $INSTDIR\Winamp3.exe CaseWinamp3
- IfFileExists $INSTDIR\Studio.exe CaseWinamp3
- goto CaseImpossible
- CaseWinamp3:
- IfFileExists $INSTDIR\wacs\classicvis.wac ClassicVisOk
-
- MessageBox MB_YESNO|MB_ICONEXCLAMATION \
- "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?" \
- IDNO FailNoClassicVis
- ExecShell "open" "http://www.winamp.com/components3/detail.jhtml?componentId=122130"
- MessageBox MB_OK|MB_ICONINFORMATION \
- "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."
- goto end
- FailNoClassicVis:
- MessageBox MB_OK|MB_ICONSTOP "Installation failed."
- goto end
- ClassicVisOk:
- FindWindow $R0 "STUDIO"
- StrCmp $R0 0 "" DoneWinamp3
- MessageBox MB_YESNO|MB_ICONQUESTION \
- "${PLUGIN_NAME} was installed successfully.$\rWould you like to run Winamp 3 now?" \
- IDNO DoneWinamp3
-
-
- IfFileExists $INSTDIR\Winamp3.exe CaseWinamp3b
- Exec '"$INSTDIR\studio.exe"'
- goto DoneWinamp3
- CaseWinamp3b:
- Exec '"$INSTDIR\winamp3.exe"'
- goto DoneWinamp3
- DoneWinamp3:
- 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."
- goto end
-
- CaseWinamp2:
-
- WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_name" ${PLUGIN_DLL}
- WriteINIStr "$INSTDIR\Winamp.ini" "Winamp" "visplugin_num" "0"
- MessageBox MB_YESNO|MB_ICONQUESTION \
- "${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?" \
- IDNO end
- Exec '"$INSTDIR\Winamp.exe"'
- Goto end
-
- CaseImpossible:
- MessageBox MB_OK|MB_ICONEXCLAMATION "ERROR: unable to find winamp.exe (winamp2) or studio.exe/winamp3.exe (winamp3) in the install directory..."
- Goto end
-
- End:
- FunctionEnd
|