Base.nsh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ;Change this file to customize zip2exe generated installers
  2. Name "${ZIP2EXE_NAME}"
  3. OutFile "${ZIP2EXE_OUTFILE}"
  4. AllowRootDirInstall true
  5. !ifdef ZIP2EXE_COMPRESSOR_SOLID
  6. !define SETCOMPRESSOR_SWITCH /SOLID
  7. !else
  8. !define SETCOMPRESSOR_SWITCH
  9. !endif
  10. !ifdef ZIP2EXE_COMPRESSOR_ZLIB
  11. SetCompressor ${SETCOMPRESSOR_SWITCH} zlib
  12. !else ifdef ZIP2EXE_COMPRESSOR_BZIP2
  13. SetCompressor ${SETCOMPRESSOR_SWITCH} bzip2
  14. !else ifdef ZIP2EXE_COMPRESSOR_LZMA
  15. SetCompressor ${SETCOMPRESSOR_SWITCH} lzma
  16. !endif
  17. !ifdef ZIP2EXE_INSTALLDIR
  18. InstallDir "${ZIP2EXE_INSTALLDIR}"
  19. Function zip2exe.SetOutPath
  20. SetOutPath "$INSTDIR"
  21. FunctionEnd
  22. !else ifdef ZIP2EXE_INSTALLDIR_WINAMP
  23. InstallDir "$PROGRAMFILES\Winamp"
  24. InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" "UninstallString"
  25. Function .onVerifyInstDir
  26. IfFileExists $INSTDIR\winamp.exe WinampInstalled
  27. Abort
  28. WinampInstalled:
  29. FunctionEnd
  30. !ifdef ZIP2EXE_INSTALLDIR_WINAMPMODE
  31. Var ZIP2EXE_TEMP1
  32. Var ZIP2EXE_TEMP2
  33. Function zip2exe.SetOutPath
  34. !ifdef ZIP2EXE_INSTALLDIR_SKINS
  35. StrCpy $ZIP2EXE_TEMP1 "$INSTDIR\Skins"
  36. !else
  37. StrCpy $ZIP2EXE_TEMP1 "$INSTDIR\Plugins"
  38. !endif
  39. ReadINIStr $ZIP2EXE_TEMP2 "$INSTDIR\winamp.ini" "Winamp" "${ZIP2EXE_INSTALLDIR_WINAMPMODE}"
  40. StrCmp $ZIP2EXE_TEMP2 "" End
  41. IfFileExists $ZIP2EXE_TEMP2 0 End
  42. StrCpy $ZIP2EXE_TEMP1 $ZIP2EXE_TEMP2
  43. End:
  44. SetOutPath $ZIP2EXE_TEMP1
  45. FunctionEnd
  46. !else
  47. Function zip2exe.SetOutPath
  48. !ifdef ZIP2EXE_INSTALLDIR_PLUGINS
  49. SetOutPath "$INSTDIR\Plugins"
  50. !else
  51. SetOutPath "$INSTDIR"
  52. !endif
  53. FunctionEnd
  54. !endif
  55. !endif
  56. !macro SECTION_BEGIN
  57. Section ""
  58. Call zip2exe.SetOutPath
  59. !macroend
  60. !macro SECTION_END
  61. SectionEnd
  62. !macroend