home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Programming / nsis-2.46-setup.exe / Contrib / zip2exe / Base.nsh next >
Encoding:
Text File  |  2007-12-01  |  1.9 KB  |  87 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.  
  9. !ifdef ZIP2EXE_COMPRESSOR_SOLID
  10.   !define SETCOMPRESSOR_SWITCH /SOLID
  11. !else
  12.   !define SETCOMPRESSOR_SWITCH
  13. !endif
  14.  
  15. !ifdef ZIP2EXE_COMPRESSOR_ZLIB
  16.   SetCompressor ${SETCOMPRESSOR_SWITCH} zlib
  17. !else ifdef ZIP2EXE_COMPRESSOR_BZIP2
  18.   SetCompressor ${SETCOMPRESSOR_SWITCH} bzip2
  19. !else ifdef ZIP2EXE_COMPRESSOR_LZMA
  20.   SetCompressor ${SETCOMPRESSOR_SWITCH} lzma
  21. !endif
  22.  
  23. !ifdef ZIP2EXE_INSTALLDIR
  24.  
  25.   InstallDir "${ZIP2EXE_INSTALLDIR}"
  26.  
  27.   Function zip2exe.SetOutPath
  28.     SetOutPath "$INSTDIR"
  29.   FunctionEnd
  30.  
  31. !else ifdef ZIP2EXE_INSTALLDIR_WINAMP
  32.  
  33.   InstallDir "$PROGRAMFILES\Winamp"
  34.   InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Winamp" "UninstallString"
  35.  
  36.   Function .onVerifyInstDir
  37.     IfFileExists $INSTDIR\winamp.exe WinampInstalled
  38.       Abort
  39.     WinampInstalled:
  40.   FunctionEnd
  41.  
  42.   !ifdef ZIP2EXE_INSTALLDIR_WINAMPMODE
  43.  
  44.     Var ZIP2EXE_TEMP1
  45.     Var ZIP2EXE_TEMP2
  46.  
  47.     Function zip2exe.SetOutPath
  48.        !ifdef ZIP2EXE_INSTALLDIR_SKINS
  49.          StrCpy $ZIP2EXE_TEMP1 "$INSTDIR\Skins"
  50.        !else
  51.          StrCpy $ZIP2EXE_TEMP1 "$INSTDIR\Plugins"
  52.        !endif
  53.        ReadINIStr $ZIP2EXE_TEMP2 "$INSTDIR\winamp.ini" "Winamp" "${ZIP2EXE_INSTALLDIR_WINAMPMODE}"
  54.          StrCmp $ZIP2EXE_TEMP2 "" End
  55.          IfFileExists $ZIP2EXE_TEMP2 0 End
  56.          StrCpy $ZIP2EXE_TEMP1 $ZIP2EXE_TEMP2
  57.        End:
  58.          SetOutPath $ZIP2EXE_TEMP1
  59.     FunctionEnd
  60.  
  61.   !else
  62.  
  63.     Function zip2exe.SetOutPath
  64.       !ifdef ZIP2EXE_INSTALLDIR_PLUGINS
  65.         SetOutPath "$INSTDIR\Plugins"
  66.       !else
  67.         SetOutPath "$INSTDIR"
  68.       !endif
  69.     FunctionEnd
  70.  
  71.   !endif
  72.  
  73. !endif
  74.  
  75. !macro SECTION_BEGIN
  76.  
  77.   Section ""
  78.   
  79.     Call zip2exe.SetOutPath
  80.   
  81. !macroend
  82.  
  83. !macro SECTION_END
  84.  
  85.   SectionEnd
  86.   
  87. !macroend