home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / nastroje / d23456 / NSIS.EXE / makensis.nsi < prev    next >
Text File  |  2001-06-03  |  8KB  |  253 lines

  1. !ifdef NO_COMPRESSION
  2. SetCompress off
  3. SetDatablockOptimize off
  4. !endif
  5.  
  6. !ifdef NO_CRC
  7. CRCCheck off
  8. !endif
  9.  
  10. Name "NSIS"
  11. Caption "Nullsoft Install System - Setup"
  12. OutFile nsis144.exe
  13.  
  14. #BGGradient 000000 800000 FFFFFF
  15. #InstallColors FF8080 000000
  16.  
  17. LicenseText "You must read the following license before installing:"
  18. LicenseData license.txt
  19. ComponentText "This will install the Nullsoft Install System v1.44 on your computer:"
  20. InstType Normal
  21. InstType "Full (w/ Source Code)"
  22. AutoCloseWindow false
  23. ShowInstDetails show
  24. DirText "Please select a location to install NSIS (or use the default):"
  25. SetOverwrite on
  26. SetDateSave on
  27. !ifdef HAVE_UPX
  28.   !packhdr tmp.dat "upx\upx --best --compress-icons=1 tmp.dat"
  29. !endif
  30.  
  31. InstallDir $PROGRAMFILES\NSIS
  32. InstallDirRegKey HKLM SOFTWARE\NSIS ""
  33.  
  34. Section "NSIS development system (required)"
  35.   SectionIn 1 2
  36.   SetOutPath $INSTDIR
  37.   File makensis.exe
  38.   File makensis.htm
  39.   File nsisconf.nsi
  40.   File makensis.nsi
  41.   File example1.nsi
  42.   File example2.nsi
  43.   File viewhtml.nsi
  44.   File waplugin.nsi
  45.   File bigtest.nsi
  46.   File uglytest.nsi
  47.   File license.txt
  48.   File bitmap1.bmp
  49.   File bitmap2.bmp
  50.   File main.ico
  51.   File uninst.ico
  52. SectionEnd
  53.  
  54. Section "NSI Development Shell Extensions"
  55.   SectionIn 1 2
  56.  
  57.   ; back up old value of .nsi
  58.   ReadRegStr $1 HKCR ".nsi" ""
  59.   StrCmp $1 "" Label1
  60.     StrCmp $1 "NSISFile" Label1
  61.     WriteRegStr HKCR ".nsi" "backup_val" $1
  62. Label1:
  63.  
  64.   WriteRegStr HKCR ".nsi" "" "NSISFile"
  65.   WriteRegStr HKCR "NSISFile" "" "NSI Script File"
  66.   WriteRegStr HKCR "NSISFile\shell" "" "open"
  67.   WriteRegStr HKCR "NSISFile\DefaultIcon" "" $INSTDIR\makensis.exe,0
  68.   WriteRegStr HKCR "NSISFile\shell\open\command" "" 'notepad.exe "%1"'
  69.   WriteRegStr HKCR "NSISFile\shell\compile" "" "Compile NSI"
  70.   WriteRegStr HKCR "NSISFile\shell\compile\command" "" '"$INSTDIR\makensis.exe" /CD /PAUSE "%1"'
  71. SectionEnd
  72.  
  73. Section "NSIS Start Menu Group"
  74.   SectionIn 1 2
  75.   SetOutPath $SMPROGRAMS\NSIS
  76.   CreateShortCut "$SMPROGRAMS\NSIS\NSIS Home Page.lnk" \
  77.                  "http://www.nullsoft.com/free/nsis/"
  78.   CreateShortCut "$SMPROGRAMS\NSIS\Uninstall NSIS.lnk" \
  79.                  "$INSTDIR\uninst-nsis.exe"
  80.   CreateShortCut "$SMPROGRAMS\NSIS\NSIS Documentation.lnk" \
  81.                  "$INSTDIR\makensis.htm"
  82.   CreateShortCut "$SMPROGRAMS\NSIS\NSIS Program Directory.lnk" \
  83.                  "$INSTDIR"
  84.   CreateShortCut "$SMPROGRAMS\NSIS\NSI Online Template Generator.lnk" \
  85.                  "http://www.firehose.net/free/nsis/makensitemplate.phtml"
  86. SectionEnd
  87.  
  88. Section "MakeNSIS Desktop Icon"
  89.   SectionIn 1 2
  90.   SetOutPath $INSTDIR
  91.   CreateShortCut "$DESKTOP\MakeNSIS.lnk" "$INSTDIR\Makensis.exe" '/CD /PAUSE'
  92. SectionEnd
  93.  
  94. Section "Splash screen support"
  95.   SectionIn 1 2
  96.   SetOutPath $INSTDIR
  97.   File splash.exe
  98.   File splash.txt
  99.   IfFileExists $SMPROGRAMS\NSIS 0 NoShortCuts
  100.     CreateShortCut "$SMPROGRAMS\NSIS\Splash Screen Help.lnk" \
  101.                    "$INSTDIR\splash.txt"
  102.   NoShortCuts:
  103. SectionEnd
  104.  
  105. Section "ZIP2EXE converter"
  106.   SectionIn 1 2
  107.   SetOutPath $INSTDIR
  108.   File zip2exe.exe
  109.   IfFileExists $SMPROGRAMS\NSIS 0 NoShortCuts
  110.     CreateShortCut "$SMPROGRAMS\NSIS\ZIP2EXE converter.lnk" \
  111.                    "$INSTDIR\zip2exe.exe"
  112.   NoShortCuts:
  113. SectionEnd
  114.  
  115.  
  116. !ifndef NO_SOURCE
  117. SectionDivider
  118.  
  119. Section "NSIS Source Code"
  120.   SectionIn 2
  121.   SetOutPath $INSTDIR\Source
  122.   File Source\*.cpp
  123.   File Source\*.h
  124.   File Source\script1.rc
  125.   File Source\makenssi.dsp
  126.   File Source\makenssi.dsw
  127.   File Source\icon.ico
  128.   SetOutPath $INSTDIR\Source\zlib
  129.   File Source\zlib\*.*
  130.   SetOutPath $INSTDIR\Source\exehead
  131.   File Source\exehead\*.c
  132.   File Source\exehead\*.h
  133.   File Source\exehead\resource.rc
  134.   File Source\exehead\exehead.dsp
  135.   File Source\exehead\exehead.dsw
  136.   File Source\exehead\nsis.ico
  137.   File Source\exehead\uninst.ico
  138.   File Source\exehead\bitmap1.bmp
  139.   File Source\exehead\bitmap2.bmp
  140.   File Source\exehead\bin2h.exe
  141.   SetOutPath $INSTDIR\Source\Splash
  142.   File Source\Splash\splash.c
  143.   File Source\Splash\splash.dsp
  144.   File Source\Splash\splash.dsw
  145.   SetOutPath $INSTDIR\Source\zip2exe
  146.   File Source\zip2exe\*.cpp
  147.   File Source\zip2exe\*.ico
  148.   File Source\zip2exe\*.h
  149.   File Source\zip2exe\*.rc
  150.   File Source\zip2exe\*.dsw
  151.   File Source\zip2exe\*.dsp
  152.   SetOutPath $INSTDIR\Source\zip2exe\zlib
  153.   File Source\zip2exe\zlib\*.*
  154.   IfFileExists $SMPROGRAMS\NSIS 0 NoSourceShortCuts
  155.     CreateShortCut "$SMPROGRAMS\NSIS\MakeNSIS project workspace.lnk" \
  156.                    "$INSTDIR\source\makenssi.dsw"
  157.     CreateShortCut "$SMPROGRAMS\NSIS\ZIP2EXE project workspace.lnk" \
  158.                    "$INSTDIR\source\zip2exe\zip2exe.dsw"
  159.     CreateShortCut "$SMPROGRAMS\NSIS\Splash project workspace.lnk" \
  160.                    "$INSTDIR\source\splash\splash.dsw"
  161.   NoSourceShortCuts:
  162. SectionEnd
  163.  
  164. !endif
  165.  
  166. Section -post
  167.   SetOutPath $INSTDIR
  168.  
  169.   ; since the installer is now created last (in 1.2+), this makes sure 
  170.   ; that any old installer that is readonly is overwritten.
  171.   Delete $INSTDIR\uninst-nsis.exe 
  172.  
  173.   WriteRegStr HKLM SOFTWARE\NSIS "" $INSTDIR
  174.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" \
  175.                    "DisplayName" "NSIS Development Kit (remove only)"
  176.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" \
  177.                    "UninstallString" '"$INSTDIR\uninst-nsis.exe"'
  178.   ExecShell open '$INSTDIR'
  179.   Sleep 500
  180.   BringToFront
  181. SectionEnd
  182.  
  183. Function .onInstSuccess
  184.   MessageBox MB_YESNO|MB_ICONQUESTION \
  185.              "Setup has completed. View readme file now?" \
  186.              IDNO NoReadme
  187.     ExecShell open '$INSTDIR\makensis.htm'
  188.   NoReadme:
  189. FunctionEnd
  190.  
  191. !ifndef NO_UNINST
  192. UninstallText "This will uninstall NSIS from your system:"
  193. UninstallExeName uninst-nsis.exe
  194.  
  195. Section Uninstall
  196.   ReadRegStr $1 HKCR ".nsi" ""
  197.   StrCmp $1 "NSISFile" 0 NoOwn ; only do this if we own it
  198.     ReadRegStr $1 HKCR ".nsi" "backup_val"
  199.     StrCmp $1 "" 0 RestoreBackup ; if backup == "" then delete the whole key
  200.       DeleteRegKey HKCR ".nsi"
  201.     Goto NoOwn
  202.     RestoreBackup:
  203.       WriteRegStr HKCR ".nsi" "" $1
  204.       DeleteRegValue HKCR ".nsi" "backup_val"
  205.   NoOwn:
  206.  
  207.   DeleteRegKey HKCR "NSISFile"
  208.   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
  209.   DeleteRegKey HKLM SOFTWARE\NSIS
  210.   Delete $SMPROGRAMS\NSIS\*.lnk
  211.   RMDir $SMPROGRAMS\NSIS
  212.   Delete $DESKTOP\MakeNSIS.lnk
  213.   Delete $INSTDIR\makensis.exe
  214.   Delete $INSTDIR\zip2exe.exe
  215.   Delete $INSTDIR\splash.txt
  216.   Delete $INSTDIR\splash.exe
  217.   Delete $INSTDIR\makensis.htm
  218.   Delete $INSTDIR\makensis.rtf
  219.   Delete $INSTDIR\uninst-nsis.exe
  220.   Delete $INSTDIR\nsisconf.nsi
  221.   Delete $INSTDIR\makensis.nsi
  222.   Delete $INSTDIR\example1.nsi
  223.   Delete $INSTDIR\example2.nsi
  224.   Delete $INSTDIR\waplugin.nsi
  225.   Delete $INSTDIR\viewhtml.nsi
  226.   Delete $INSTDIR\bigtest.nsi
  227.   Delete $INSTDIR\uglytest.nsi
  228.   Delete $INSTDIR\spin.nsi
  229.   Delete $INSTDIR\wafull.nsi
  230.   Delete $INSTDIR\main.ico
  231.   Delete $INSTDIR\makensis-license.txt
  232.   Delete $INSTDIR\license.txt
  233.   Delete $INSTDIR\uninst.ico
  234.   Delete $INSTDIR\bitmap1.bmp
  235.   Delete $INSTDIR\bitmap2.bmp
  236.   RMDir /r $INSTDIR\Source
  237.   RMDir $INSTDIR
  238.  
  239.   ; if $INSTDIR was removed, skip these next ones
  240.   IfFileExists $INSTDIR 0 Removed 
  241.     MessageBox MB_YESNO|MB_ICONQUESTION \
  242.       "Remove all files in your NSIS directory? (If you have anything\
  243.  you created that you want to keep, click No)" IDNO Removed
  244.     Delete $INSTDIR\*.* ; this would be skipped if the user hits no
  245.     RMDir /r $INSTDIR
  246.     IfFileExists $INSTDIR 0 Removed 
  247.       MessageBox MB_OK|MB_ICONEXCLAMATION \
  248.                  "Note: $INSTDIR could not be removed."
  249.   Removed:
  250. SectionEnd
  251.  
  252. !endif
  253.