1
0

inst.nsi 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. Name "CDDB2 test, beta 1"
  2. ; The file to write
  3. OutFile "cddb2.exe"
  4. InstallDir $PROGRAMFILES\Winamp
  5. InstallDirRegKey HKLM \
  6. "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
  7. "UninstallString"
  8. ; The text to prompt the user to enter a directory
  9. DirText "Please select your Winamp path below (you will be able to proceed when Winamp is detected):"
  10. DirShow hide
  11. ; automatically close the installer when done.
  12. AutoCloseWindow true
  13. ; hide the "show details" box
  14. ShowInstDetails nevershow
  15. BGGradient 000000 308030 FFFFFF
  16. InstallColors FF8080 000000
  17. InstProgressFlags smooth colored
  18. Function .onInit
  19. MessageBox MB_YESNO|MB_ICONQUESTION "Install CDDB2 update test?" IDYES update
  20. MessageBox MB_OK|MB_ICONINFORMATION "Install aborted."
  21. Abort
  22. update:
  23. FunctionEnd
  24. Function .onVerifyInstDir
  25. IfFileExists $INSTDIR\Winamp.exe Good
  26. Abort
  27. Good:
  28. FunctionEnd
  29. Function CloseWinamp
  30. Push $0
  31. loop:
  32. FindWindow $0 "Winamp v1.x"
  33. IntCmp $0 0 done
  34. SendMessage $0 16 0 0
  35. StrCpy $9 "yes"
  36. Sleep 100
  37. Goto loop
  38. done:
  39. Pop $0
  40. FunctionEnd
  41. Section "ThisNameIsIgnoredSoWhyBother?"
  42. StrCpy $9 "no"
  43. Call CloseWinamp
  44. SetOutPath $INSTDIR
  45. File "C:\program files\winamp\winamp.exe"
  46. SetOutPath $INSTDIR\Plugins
  47. UnRegDll $OUTDIR\cddbcontrolwinamp.dll
  48. UnRegDll $OUTDIR\cddbuiwinamp.dll
  49. File "C:\program files\winamp\plugins\in_cdda.dll"
  50. File "C:\program files\winamp\plugins\in_mp3.dll"
  51. File "cddbcontrolwinamp.dll"
  52. File "cddbuiwinamp.dll"
  53. RegDll $OUTDIR\cddbcontrolwinamp.dll
  54. RegDll $OUTDIR\cddbuiwinamp.dll
  55. DetailPrint Completed.
  56. SectionEnd
  57. Function .onInstSuccess
  58. MessageBox MB_OK|MB_ICONINFORMATION "Update installed."
  59. StrCmp $9 "no" nope
  60. Exec '"$INSTDIR\Winamp.exe"'
  61. nope:
  62. FunctionEnd
  63. ; eof