webdev.nsi 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. !include "MUI2.nsh"
  2. ; This is where all projects live. Ensure this is the correct relative path.
  3. !ifndef PROJECTS
  4. !define PROJECTS '..\..'
  5. !endif
  6. !ifndef FILES_PATH
  7. !define FILES_PATH '..\..\output\winamp'
  8. !endif
  9. ;------------------------
  10. SetCompressor /SOLID /FINAL lzma
  11. SetCompressorDictSize 16
  12. FileBufSize 64
  13. RequestExecutionLevel admin
  14. Name "Winamp Web Development"
  15. OutFile "wa_webdev.exe"
  16. InstallDir $PROGRAMFILES\Winamp
  17. InstProgressFlags smooth
  18. XPStyle on
  19. ShowInstDetails hide
  20. AutoCloseWindow true
  21. LangString IDS_CLOSE_WINAMP ${LANG_ENGLISH} "You must close Winamp before you can continue.$\r$\n - After you have closed Winamp, select Retry.$\r$\n - If you wish to try to install anyway, select Ignore.$\r$\n - If you wish to abort the installation, select Abort."
  22. LangString IDS_USER_ABORT ${LANG_ENGLISH} "User action: Abort Installation"
  23. LangString IDS_USER_IGNORE ${LANG_ENGLISH} "User action: Ignore File"
  24. LangString IDS_PAGE_FINISH_TEXT ${LANG_ENGLISH} "To use the plugin, reopen Winamp and go to the WebDev Platform view in the Media Library."
  25. LangString IDS_PAGE_FINISH_RUN ${LANG_ENGLISH} "Launch Winamp after the installer closes"
  26. LangString IDS_FILE_PROBE ${LANG_ENGLISH} "Probing access: $OUTDIR\$0"
  27. !define MUI_ICON ".\resources\install.ico"
  28. !define MUI_UNICON ".\resources\uninstall.ico"
  29. !define MUI_ABORTWARNING
  30. !define MUI_HEADERIMAGE
  31. !define MUI_HEADERIMAGE_BITMAP ".\resources\header.bmp"
  32. !define MUI_WELCOMEFINISHPAGE_BITMAP ".\resources\welcome.bmp"
  33. !define MUI_UNWELCOMEFINISHPAGE_BITMAP ".\resources\welcome.bmp"
  34. !insertmacro MUI_PAGE_WELCOME
  35. ; detect Winamp path from uninstall string if available
  36. InstallDirRegKey HKLM \
  37. "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" \
  38. "UninstallString"
  39. !insertmacro MUI_PAGE_DIRECTORY
  40. !insertmacro MUI_PAGE_INSTFILES
  41. !define MUI_FINISHPAGE_TEXT $(IDS_PAGE_FINISH_TEXT)
  42. !define MUI_FINISHPAGE_RUN
  43. !define MUI_FINISHPAGE_RUN_TEXT $(IDS_PAGE_FINISH_RUN)
  44. !define MUI_FINISHPAGE_RUN_FUNCTION FinishPage_Run
  45. !insertmacro MUI_PAGE_FINISH
  46. !insertmacro MUI_LANGUAGE "English"
  47. !include "FileFunc.nsh"
  48. !define WriteWinampFile "!insertmacro WriteWinampFile"
  49. !macro WriteWinampFile filePath
  50. Push $0
  51. ${GetFileName} "${filePath}" $0
  52. DetailPrint $(IDS_FILE_PROBE)
  53. ${Do}
  54. ClearErrors
  55. Delete "$OUTDIR\$0"
  56. ${If} ${Errors}
  57. SetErrors
  58. IfSilent done_${filePath}
  59. MessageBox MB_DEFBUTTON2|MB_ABORTRETRYIGNORE|MB_ICONEXCLAMATION $(IDS_CLOSE_WINAMP) IDABORT done_${filePath} IDRETRY +4
  60. ClearErrors
  61. DetailPrint $(IDS_USER_IGNORE)
  62. Goto macroend_${filePath}
  63. ${EndIf}
  64. ${LoopWhile} ${Errors}
  65. done_${filePath}:
  66. ${If} ${Errors}
  67. Abort $(IDS_USER_ABORT)
  68. ${Else}
  69. File ${filePath}
  70. ${EndIf}
  71. macroend_${filePath}:
  72. Pop $0
  73. !macroend
  74. Function FinishPage_Run
  75. HideWindow
  76. Exec "$INSTDIR\winamp.exe"
  77. Sleep 500
  78. FunctionEnd
  79. Section ""
  80. SetOutPath $INSTDIR\Plugins
  81. ${WriteWinampFile} "${FILES_PATH}\Plugins\ml_webdev.dll"
  82. SetOutPath $INSTDIR\System
  83. ${WriteWinampFile} "${FILES_PATH}\System\omBrowser.w5s"
  84. SectionEnd