home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Contrib / zip2exe / Base.nsh next >
Encoding:
Text File  |  2003-11-25  |  1.7 KB  |  80 lines

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