home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Examples / makensis.nsi < prev    next >
Text File  |  2004-02-06  |  46KB  |  1,464 lines

  1. ;NSIS Setup Script
  2. ;--------------------------------
  3.  
  4. !define VER_MAJOR 2
  5. !define VER_MINOR 0
  6. !define VER_REVISION 0
  7. !define VER_BUILD 18
  8.  
  9. !define VER_FILE "20"
  10. !define VER_DISPLAY "2.0"
  11.  
  12. ;--------------------------------
  13. ;Compile CVS Data Setup
  14.  
  15. !system '"${NSISDIR}\Bin\InstallCVSData.exe" nooverwrite'
  16. !echo "Compiling CVS Data Setup..."
  17. !system '"${NSISDIR}\makensis.exe" /V1 cvsdata.nsi' = 0
  18.  
  19. ;--------------------------------
  20. ;Configuration
  21.  
  22. OutFile ..\nsis${VER_FILE}.exe
  23. SetCompressor lzma
  24.  
  25. InstType "Full"
  26. InstType "Standard"
  27. InstType "Lite"
  28.  
  29. InstallDir $PROGRAMFILES\NSIS
  30. InstallDirRegKey HKLM Software\NSIS ""
  31.  
  32. ;--------------------------------
  33.  
  34. ;Header Files
  35.  
  36. !include "MUI.nsh"
  37. !include "Sections.nsh"
  38.  
  39. ;--------------------------------
  40. ;Configuration
  41.  
  42. ;Names
  43. Name "NSIS"
  44. Caption "NSIS ${VER_DISPLAY} Setup"
  45.  
  46. ;Interface Settings
  47. !define MUI_ABORTWARNING
  48.  
  49. !define MUI_HEADERIMAGE
  50. !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp"
  51.  
  52. !define MUI_COMPONENTSPAGE_SMALLDESC
  53.  
  54. ;Pages
  55. !define MUI_WELCOMEPAGE_TITLE "Welcome to the NSIS ${VER_DISPLAY} Setup Wizard"
  56. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of NSIS (Nullsoft Scriptable Install System) ${VER_DISPLAY}, the next generation of the Windows installer and uninstaller system that doesn't suck and isn't huge.\r\n\r\nNSIS 2 includes a new Modern User Interface, LZMA compression, support for multiple languages and an easy plug-in system.\r\n\r\n$_CLICK"
  57.  
  58. !insertmacro MUI_PAGE_WELCOME
  59. !insertmacro MUI_PAGE_LICENSE "..\license.txt"
  60. Page custom PageReinstall PageLeaveReinstall
  61. !insertmacro MUI_PAGE_COMPONENTS
  62. !insertmacro MUI_PAGE_DIRECTORY
  63. !insertmacro MUI_PAGE_INSTFILES
  64.  
  65. !define MUI_FINISHPAGE_LINK "Visit the NSIS website for the latest news, FAQs and support"
  66. !define MUI_FINISHPAGE_LINK_LOCATION "http://nsis.sf.net/"
  67.  
  68. !define MUI_FINISHPAGE_RUN "$INSTDIR\NSIS.exe"
  69. !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  70.  
  71. !insertmacro MUI_PAGE_FINISH
  72.  
  73. !insertmacro MUI_UNPAGE_CONFIRM
  74. !insertmacro MUI_UNPAGE_INSTFILES
  75.  
  76. ;--------------------------------
  77. ;Languages
  78.  
  79. !insertmacro MUI_LANGUAGE "English"
  80.  
  81. ;--------------------------------
  82. ;Reserve Files
  83.  
  84.   ;These files should be inserted before other files in the data block
  85.  
  86.   ReserveFile "makensis.ini"
  87.   !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
  88.  
  89. ;--------------------------------
  90. ;Installer Sections
  91.  
  92. Section "NSIS Core Files (required)" SecCore
  93.  
  94.   SetDetailsPrint textonly
  95.   DetailPrint "Installing NSIS Core Files..."
  96.   SetDetailsPrint listonly
  97.  
  98.   SectionIn 1 2 3 RO
  99.   SetOutPath $INSTDIR
  100.   RMDir /r $SMPROGRAMS\NSIS
  101.  
  102.   SetOverwrite on
  103.   Delete $INSTDIR\makensis-bz2.exe
  104.   File ..\makensis.exe
  105.   File ..\makensisw.exe
  106.   File ..\license.txt
  107.   File ..\NSIS.chm
  108.  
  109.   File ..\NSIS.exe
  110.   IfFileExists $INSTDIR\nsisconf.nsi "" +2
  111.   Rename $INSTDIR\nsisconf.nsi $INSTDIR\nsisconf.nsh
  112.   SetOverwrite off
  113.   File ..\nsisconf.nsh
  114.   SetOverwrite on
  115.  
  116.   SetOutPath $INSTDIR\Include
  117.   File ..\Include\WinMessages.nsh
  118.   File ..\Include\Sections.nsh
  119.   File ..\Include\UpgradeDLL.nsh
  120.   File ..\Include\LogicLib.nsh
  121.   File ..\Include\StrFunc.nsh
  122.   File ..\Include\StrFunc.txt
  123.  
  124.   SetOutPath $INSTDIR\Contrib\Makensisw
  125.   File ..\contrib\makensisw\*.txt
  126.  
  127.   SetOutPath $INSTDIR\Menu
  128.   File ..\Menu\*.html
  129.   SetOutPath $INSTDIR\Menu\images
  130.   File ..\Menu\images\*.gif
  131.  
  132.   Delete $INSTDIR\makensis.htm
  133.   Delete $INSTDIR\Docs\*.html
  134.   Delete $INSTDIR\Docs\style.css
  135.   RMDir $INSTDIR\Docs
  136.  
  137.   ReadRegStr $R0 HKCR ".nsi" ""
  138.   StrCmp $R0 "NSISFile" 0 +2
  139.     DeleteRegKey HKCR "NSISFile"
  140.  
  141.   WriteRegStr HKCR ".nsi" "" "NSIS.Script"
  142.   WriteRegStr HKCR "NSIS.Script" "" "NSIS Script File"
  143.   WriteRegStr HKCR "NSIS.Script\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
  144.   ReadRegStr $R0 HKCR "NSIS.Script\shell\open\command" ""
  145.   StrCmp $R0 "" 0 no_nsiopen
  146.     WriteRegStr HKCR "NSIS.Script\shell" "" "open"
  147.     WriteRegStr HKCR "NSIS.Script\shell\open\command" "" 'notepad.exe "%1"'
  148.   no_nsiopen:
  149.   WriteRegStr HKCR "NSIS.Script\shell\compile" "" "Compile NSIS Script"
  150.   WriteRegStr HKCR "NSIS.Script\shell\compile\command" "" '"$INSTDIR\makensisw.exe" "%1"'
  151.   WriteRegStr HKCR "NSIS.Script\shell\compile-compressor" "" "Compile NSIS Script (Choose Compressor)"
  152.   WriteRegStr HKCR "NSIS.Script\shell\compile-compressor\command" "" '"$INSTDIR\makensisw.exe" /ChooseCompressor "%1"'
  153.  
  154.   ReadRegStr $R0 HKCR ".nsh" ""
  155.   StrCmp $R0 "NSHFile" 0 +2
  156.     DeleteRegKey HKCR "NSHFile"
  157.  
  158.   WriteRegStr HKCR ".nsh" "" "NSIS.Header"
  159.   WriteRegStr HKCR "NSIS.Header" "" "NSIS Header File"
  160.   WriteRegStr HKCR "NSIS.Header\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
  161.   ReadRegStr $R0 HKCR "NSIS.Header\shell\open\command" ""
  162.   StrCmp $R0 "" 0 no_nshopen
  163.     WriteRegStr HKCR "NSIS.Header\shell" "" "open"
  164.     WriteRegStr HKCR "NSIS.Header\shell\open\command" "" 'notepad.exe "%1"'
  165.   no_nshopen:
  166.  
  167. SectionEnd
  168.  
  169. Section "Script Examples" SecExample
  170.  
  171.   SetDetailsPrint textonly
  172.   DetailPrint "Installing Script Examples..."
  173.   SetDetailsPrint listonly
  174.  
  175.   SectionIn 1 2 3
  176.   SetOutPath $INSTDIR\Examples
  177.   Delete $INSTDIR\functions.htm
  178.   File ..\Examples\cvsdata.nsi
  179.   File ..\Examples\makensis.nsi
  180.   File ..\Examples\makensis.ini
  181.   File ..\Examples\example1.nsi
  182.   File ..\Examples\example2.nsi
  183.   File ..\Examples\viewhtml.nsi
  184.   File ..\Examples\waplugin.nsi
  185.   File ..\Examples\bigtest.nsi
  186.   File ..\Examples\primes.nsi
  187.   File ..\Examples\rtest.nsi
  188.   File ..\Examples\gfx.nsi
  189.   File ..\Examples\one-section.nsi
  190.   File ..\Examples\languages.nsi
  191.   File ..\Examples\VersionInfo.nsi
  192.   File ..\Examples\UserVars.nsi
  193.   File ..\Examples\LogicLib.nsi
  194.   File ..\Examples\silent.nsi
  195.   File ..\Examples\StrFunc.nsi
  196. SectionEnd
  197.  
  198. !ifndef NO_STARTMENUSHORTCUTS
  199. Section "Start Menu and Desktop Shortcuts" SecShortcuts
  200.  
  201.   SetDetailsPrint textonly
  202.   DetailPrint "Installing Start Menu and Desktop Shortcuts..."
  203.   SetDetailsPrint listonly
  204.  
  205. !else
  206. Section "Desktop Shortcut" SecShortcuts
  207.  
  208.   SetDetailsPrint textonly
  209.   DetailPrint "Installing Desktop Shortcut..."
  210.   SetDetailsPrint listonly
  211.  
  212. !endif
  213.   SectionIn 1 2 3
  214.   SetOutPath $INSTDIR
  215. !ifndef NO_STARTMENUSHORTCUTS
  216.   CreateDirectory $SMPROGRAMS\NSIS
  217.  
  218.   CreateShortCut "$SMPROGRAMS\NSIS\NSIS Menu.lnk" "$INSTDIR\NSIS.exe" ""
  219.  
  220.   CreateShortCut "$SMPROGRAMS\NSIS\MakeNSISW (Compiler GUI).lnk" "$INSTDIR\makensisw.exe"
  221.  
  222.   IfFileExists "$INSTDIR\Bin\NSISUpdate.exe" "" +2
  223.     CreateShortCut "$SMPROGRAMS\NSIS\NSIS Update.lnk" "$INSTDIR\Bin\NSISUpdate.exe"
  224.  
  225.   CreateShortCut "$SMPROGRAMS\NSIS\NSIS Documentation.lnk" "$INSTDIR\NSIS.chm"
  226.   WriteINIStr "$SMPROGRAMS\NSIS\NSIS Site.url" "InternetShortcut" "URL" "http://nsis.sourceforge.net/"
  227.   CreateShortCut "$SMPROGRAMS\NSIS\Uninstall NSIS.lnk" "$INSTDIR\uninst-nsis.exe"
  228.  
  229. !endif
  230.  
  231.   CreateShortCut "$DESKTOP\Nullsoft Install System.lnk" "$INSTDIR\NSIS.exe"
  232.  
  233. SectionEnd
  234.  
  235. SubSection "User Interfaces" SecInterfaces
  236.  
  237. Section "Modern User Interface" SecInterfacesModernUI
  238.  
  239.   SetDetailsPrint textonly
  240.   DetailPrint "Installing User Interfaces | Modern User Interface..."
  241.   SetDetailsPrint listonly
  242.  
  243.   SectionIn 1 2 3
  244.  
  245.   SetOutPath "$INSTDIR\Examples\Modern UI"
  246.   File "..\Examples\Modern UI\Basic.nsi"
  247.   File "..\Examples\Modern UI\HeaderBitmap.nsi"
  248.   File "..\Examples\Modern UI\MultiLanguage.nsi"
  249.   File "..\Examples\Modern UI\InstallOptions.nsi"
  250.   File "..\Examples\Modern UI\ioA.ini"
  251.   File "..\Examples\Modern UI\ioB.ini"
  252.   File "..\Examples\Modern UI\ioC.ini"
  253.   File "..\Examples\Modern UI\StartMenu.nsi"
  254.   File "..\Examples\Modern UI\WelcomeFinish.nsi"
  255.  
  256.   SetOutPath "$INSTDIR\Contrib\Modern UI"
  257.   File "..\Contrib\Modern UI\System.nsh"
  258.   File "..\Contrib\Modern UI\Readme.html"
  259.   File "..\Contrib\Modern UI\Changelog.txt"
  260.   File "..\Contrib\Modern UI\License.txt"
  261.   File "..\Contrib\Modern UI\ioSpecial.ini"
  262.   
  263.   SetOutPath "$INSTDIR\Contrib\Modern UI\images"
  264.   File "..\Contrib\Modern UI\images\header.gif"
  265.   File "..\Contrib\Modern UI\images\screen1.png"
  266.   File "..\Contrib\Modern UI\images\screen2.png"
  267.   File "..\Contrib\Modern UI\images\open.gif"
  268.   File "..\Contrib\Modern UI\images\closed.gif"
  269.  
  270.   SetOutPath $INSTDIR\Contrib\UIs
  271.   File "..\Contrib\UIs\modern.exe"
  272.   File "..\Contrib\UIs\modern_headerbmp.exe"
  273.   File "..\Contrib\UIs\modern_headerbmpr.exe"
  274.   File "..\Contrib\UIs\modern_nodesc.exe"
  275.   File "..\Contrib\UIs\modern_smalldesc.exe"
  276.  
  277.   Delete "$INSTDIR\Contrib\Modern UI\Readme.jpg"
  278.   Delete "$INSTDIR\Contrib\Modern UI\ioSpecial3.ini"
  279.   Delete "$INSTDIR\Contrib\UIs\modern2.exe"
  280.   Delete "$INSTDIR\Contrib\UIs\modern3.exe"
  281.  
  282.   SetOutPath $INSTDIR\Include
  283.   File "..\Include\MUI.nsh"
  284.  
  285. SectionEnd
  286.  
  287. Section "Default User Interface" SecInterfacesDefaultUI
  288.  
  289.   SetDetailsPrint textonly
  290.   DetailPrint "Installing User Interfaces | Default User Interface..."
  291.   SetDetailsPrint listonly
  292.  
  293.   SectionIn 1 2
  294.  
  295.   SetOutPath "$INSTDIR\Contrib\UIs"
  296.   File "..\Contrib\UIs\default.exe"
  297.  
  298. SectionEnd
  299.  
  300. Section "Tiny User Interface" SecInterfacesTinyUI
  301.  
  302.   SetDetailsPrint textonly
  303.   DetailPrint "Installing User Interfaces | Tiny User Interface..."
  304.   SetDetailsPrint listonly
  305.  
  306.   SectionIn 1 2
  307.  
  308.   SetOutPath "$INSTDIR\Contrib\UIs"
  309.   File "..\Contrib\UIs\sdbarker_tiny.exe"
  310.  
  311. SectionEnd
  312.  
  313. SubSectionEnd
  314.  
  315. Section "Graphics" SecGraphics
  316.  
  317.   SetDetailsPrint textonly
  318.   DetailPrint "Installing Graphics..."
  319.   SetDetailsPrint listonly
  320.  
  321.   SectionIn 1 2
  322.  
  323.   Delete $INSTDIR\Contrib\Icons\*.ico
  324.   Delete $INSTDIR\Contrib\Icons\*.bmp
  325.   RMDir $INSTDIR\Contrib\Icons
  326.   SetOutPath $INSTDIR\Contrib\Graphics
  327.   File /r "..\Contrib\Graphics\*.ico"
  328.   File /r "..\Contrib\Graphics\*.bmp"
  329. SectionEnd
  330.  
  331. Section "Language Files" SecLangFiles
  332.  
  333.   SetDetailsPrint textonly
  334.   DetailPrint "Installing Language Files..."
  335.   SetDetailsPrint listonly
  336.  
  337.   SectionIn 1 2
  338.  
  339.   SetOutPath "$INSTDIR\Contrib\Language files"
  340.   File "..\Contrib\Language files\*.nlf"
  341.  
  342.   SetOutPath $INSTDIR\Bin
  343.   File ..\Bin\MakeLangID.exe
  344.  
  345.   !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
  346.   mui:
  347.     SetOutPath "$INSTDIR\Contrib\Modern UI\Language files"
  348.     File "..\Contrib\Modern UI\Language files\*.nsh"
  349.   nomui:
  350.  
  351. SectionEnd
  352.  
  353. SubSection "Tools" SecTools
  354.  
  355. Section "NSIS Update" SecToolsUpdate
  356.  
  357.   SetDetailsPrint textonly
  358.   DetailPrint "Installing Tools | NSIS Update..."
  359.   SetDetailsPrint listonly
  360.  
  361.   SectionIn 1 2
  362.  
  363.   SetOutPath $INSTDIR\Bin
  364.   File ..\Bin\NSISUpdate.exe
  365.   File ..\Bin\InstallCVSData.exe
  366.  
  367.   IfFileExists "$INSTDIR\CVS\Root" 0 +2
  368.     Exec '"$INSTDIR\Bin\InstallCVSData.exe"'
  369.  
  370. SectionEnd
  371.  
  372. Section "Zip2Exe" SecToolsZ2E
  373.  
  374.   SetDetailsPrint textonly
  375.   DetailPrint "Installing Tools | Zip2Exe..."
  376.   SetDetailsPrint listonly
  377.  
  378.   SectionIn 1 2
  379.  
  380.   SetOutPath $INSTDIR\Bin
  381.   File ..\Bin\zip2exe.exe
  382.   SetOutPath $INSTDIR\Contrib\zip2exe
  383.   File ..\Contrib\zip2exe\Base.nsh
  384.   File ..\Contrib\zip2exe\Modern.nsh
  385.   File ..\Contrib\zip2exe\Classic.nsh
  386.  
  387. SectionEnd
  388.  
  389. SubSectionEnd
  390.  
  391. SubSection "Plug-ins" SecPluginsPlugins
  392.  
  393. Section "Banner" SecPluginsBanner
  394.  
  395.   SetDetailsPrint textonly
  396.   DetailPrint "Installing Plug-ins | Banner..."
  397.   SetDetailsPrint listonly
  398.  
  399.   SectionIn 1 2
  400.  
  401.   SetOutPath $INSTDIR\Plugins
  402.   File ..\Plugins\Banner.dll
  403.   SetOutPath $INSTDIR\Contrib\Banner
  404.   File ..\Contrib\Banner\Readme.txt
  405.   File ..\Contrib\Banner\Example.nsi
  406. SectionEnd
  407.  
  408. Section "Language DLL" SecPluginsLangDLL
  409.  
  410.   SetDetailsPrint textonly
  411.   DetailPrint "Installing Plug-ins | Language DLL..."
  412.   SetDetailsPrint listonly
  413.  
  414.   SectionIn 1 2
  415.   SetOutPath $INSTDIR\Plugins
  416.   File ..\Plugins\LangDLL.dll
  417. SectionEnd
  418.  
  419. Section "nsExec" SecPluginsnsExec
  420.  
  421.   SetDetailsPrint textonly
  422.   DetailPrint "Installing Plug-ins | nsExec..."
  423.   SetDetailsPrint listonly
  424.  
  425.   SectionIn 1 2
  426.  
  427.   SetOutPath $INSTDIR\Plugins
  428.   File ..\Plugins\nsExec.dll
  429.   SetOutPath $INSTDIR\Contrib\nsExec
  430.   File ..\Contrib\nsExec\*.txt
  431.   File ..\Contrib\nsExec\*.nsi
  432. SectionEnd
  433.  
  434. Section "Splash" SecPluginsSplash
  435.  
  436.   SetDetailsPrint textonly
  437.   DetailPrint "Installing Plug-ins | Splash..."
  438.   SetDetailsPrint listonly
  439.  
  440.   SectionIn 1 2
  441.  
  442.   SetOutPath $INSTDIR\Plugins
  443.   File ..\Plugins\splash.dll
  444.   SetOutPath $INSTDIR\Contrib\Splash
  445.   File ..\Contrib\splash\splash.txt
  446.   File ..\Contrib\splash\Example.nsi
  447. SectionEnd
  448.  
  449. Section "AdvSplash" SecPluginsSplashT
  450.  
  451.   SetDetailsPrint textonly
  452.   DetailPrint "Installing Plug-ins | AdvSplash..."
  453.   SetDetailsPrint listonly
  454.  
  455.   SectionIn 1 2
  456.  
  457.   SetOutPath $INSTDIR\Plugins
  458.   File ..\Plugins\advsplash.dll
  459.   SetOutPath $INSTDIR\Contrib\AdvSplash
  460.   File ..\Contrib\AdvSplash\advsplash.txt
  461.   File ..\Contrib\AdvSplash\Example.nsi
  462. SectionEnd
  463.  
  464. Section "BgImage" SecPluginsBgImage
  465.  
  466.   SetDetailsPrint textonly
  467.   DetailPrint "Installing Plug-ins | BgImage..."
  468.   SetDetailsPrint listonly
  469.  
  470.   SectionIn 1 2
  471.  
  472.   SetOutPath $INSTDIR\Plugins
  473.   File ..\Plugins\BgImage.dll
  474.   SetOutPath $INSTDIR\Contrib\BgImage
  475.   File ..\Contrib\BgImage\BgImage.txt
  476.   File ..\Contrib\BgImage\Example.nsi
  477. SectionEnd
  478.  
  479. Section "InstallOptions" SecPluginsIO
  480.  
  481.   SetDetailsPrint textonly
  482.   DetailPrint "Installing Plug-ins | InstallOptions..."
  483.   SetDetailsPrint listonly
  484.  
  485.   SectionIn 1 2
  486.  
  487.   SetOutPath $INSTDIR\Plugins
  488.   File ..\Plugins\InstallOptions.dll
  489.   SetOutPath $INSTDIR\Contrib\InstallOptions
  490.   File ..\Contrib\InstallOptions\Readme.html
  491.   File ..\Contrib\InstallOptions\Changelog.txt
  492.   File ..\contrib\installoptions\test.ini
  493.   File ..\contrib\installoptions\test.nsi
  494.   File ..\contrib\installoptions\testlink.ini
  495.   File ..\contrib\installoptions\testlink.nsi
  496.   File ..\contrib\installoptions\testnotify.ini
  497.   File ..\contrib\installoptions\testnotify.nsi
  498. SectionEnd
  499.  
  500. Section "Math" SecPluginsMath
  501.  
  502.   SetDetailsPrint textonly
  503.   DetailPrint "Installing Plug-ins | Math..."
  504.   SetDetailsPrint listonly
  505.  
  506.   SectionIn 1 2
  507.  
  508.   SetOutPath $INSTDIR\Plugins
  509.   File ..\Plugins\Math.dll
  510.   SetOutPath $INSTDIR\Contrib\Math
  511.   File ..\Contrib\Math\Math.txt
  512.   File ..\Contrib\Math\Math.nsi
  513.   File ..\Contrib\Math\MathTest.txt
  514.   File ..\Contrib\Math\MathTest.nsi
  515.   File ..\Contrib\Math\MathTest.ini
  516.  
  517. SectionEnd
  518.  
  519. Section "NSISdl" SecPluginsNSISDL
  520.  
  521.   SetDetailsPrint textonly
  522.   DetailPrint "Installing Plug-ins | NSISdl..."
  523.   SetDetailsPrint listonly
  524.  
  525.   SectionIn 1 2
  526.  
  527.   SetOutPath $INSTDIR\Plugins
  528.   File ..\Plugins\nsisdl.dll
  529.   SetOutPath $INSTDIR\Contrib\NSISdl
  530.   File ..\contrib\NSISdl\ReadMe.txt
  531.   File ..\contrib\NSISdl\License.txt
  532. SectionEnd
  533.  
  534. Section "System" SecPluginsSystem
  535.  
  536.   SetDetailsPrint textonly
  537.   DetailPrint "Installing Plug-ins | System..."
  538.   SetDetailsPrint listonly
  539.  
  540.   SectionIn 1 2
  541.  
  542.   SetOutPath $INSTDIR\Plugins
  543.   File ..\Plugins\System.dll
  544.   SetOutPath $INSTDIR\Contrib\System
  545.   File ..\Contrib\System\*.dll
  546.   File ..\Contrib\System\*.nsh
  547.   File ..\Contrib\System\*.nsi
  548.   File ..\Contrib\System\*.txt
  549. SectionEnd
  550.  
  551. Section "StartMenu" SecPluginsStartMenu
  552.  
  553.   SetDetailsPrint textonly
  554.   DetailPrint "Installing Plug-ins | StartMenu..."
  555.   SetDetailsPrint listonly
  556.  
  557.   SectionIn 1 2
  558.  
  559.   SetOutPath $INSTDIR\Plugins
  560.   File ..\Plugins\StartMenu.dll
  561.   SetOutPath $INSTDIR\Contrib\StartMenu
  562.   File ..\Contrib\StartMenu\Example.nsi
  563.   File ..\Contrib\StartMenu\Readme.txt
  564. SectionEnd
  565.  
  566. Section "UserInfo" SecPluginsUserInfo
  567.  
  568.   SetDetailsPrint textonly
  569.   DetailPrint "Installing Plug-ins | UserInfo..."
  570.   SetDetailsPrint listonly
  571.  
  572.   SectionIn 1 2
  573.  
  574.   SetOutPath $INSTDIR\Plugins
  575.   File ..\Plugins\UserInfo.dll
  576.   SetOutPath $INSTDIR\Contrib\UserInfo
  577.   File ..\Contrib\UserInfo\UserInfo.nsi
  578. SectionEnd
  579.  
  580. Section "Dialer" SecPluginsDialer
  581.  
  582.   SetDetailsPrint textonly
  583.   DetailPrint "Installing Plug-ins | Dialer..."
  584.   SetDetailsPrint listonly
  585.  
  586.   SectionIn 1 2
  587.  
  588.   SetOutPath $INSTDIR\Plugins
  589.   File ..\Plugins\Dialer.dll
  590.   SetOutPath $INSTDIR\Contrib\Dialer
  591.   File ..\Contrib\Dialer\Dialer.txt
  592. SectionEnd
  593.  
  594. Section "VPatch" SecPluginsVPatch
  595.  
  596.   SetDetailsPrint textonly
  597.   DetailPrint "Installing Plug-ins | VPatch..."
  598.   SetDetailsPrint listonly
  599.  
  600.   SectionIn 1 2
  601.  
  602.   SetOutPath $INSTDIR\Plugins
  603.   File ..\Plugins\VPatch.dll
  604.   SetOutPath $INSTDIR\Contrib\VPatch
  605.   File ..\Contrib\VPatch\GenPat.exe
  606.   File ..\Contrib\VPatch\Readme.html
  607.   File ..\Contrib\VPatch\example.nsi
  608.   File ..\Contrib\VPatch\oldfile.txt
  609.   File ..\Contrib\VPatch\newfile.txt
  610.   File ..\Contrib\VPatch\patch.pat
  611. SectionEnd
  612.  
  613. SubSectionEnd
  614.  
  615. SubSection "Source code" SecSrc
  616.  
  617. Section "NSIS Source Code" SecSrcNSIS
  618.  
  619.   SetDetailsPrint textonly
  620.   DetailPrint "Installing Source Code | NSIS Source Code..."
  621.   SetDetailsPrint listonly
  622.  
  623.   SectionIn 1
  624.  
  625.   # makensis
  626.   SetOutPath $INSTDIR\Source
  627.   File ..\Source\*.cpp
  628.   File ..\Source\*.c
  629.   File ..\Source\*.h
  630.   ; outdated - File ..\Source\Makefile
  631.   File ..\Source\makenssi.dsp
  632.   File ..\Source\makenssi.dsw
  633.   # zlib
  634.   SetOutPath $INSTDIR\Source\zlib
  635.   File ..\Source\zlib\*.*
  636.   # bzip2
  637.   SetOutPath $INSTDIR\Source\bzip2
  638.   File ..\Source\bzip2\*.*
  639.   # lzma
  640.   SetOutPath $INSTDIR\Source\7zip
  641.   File ..\Source\7zip\*.*
  642.   SetOutPath $INSTDIR\Source\7zip\Common
  643.   File ..\Source\7zip\Common\*.*
  644.   SetOutPath $INSTDIR\Source\7zip\7zip
  645.   File ..\Source\7zip\7zip\*.*
  646.   SetOutPath $INSTDIR\Source\7zip\7zip\Compress\LZ
  647.   File ..\Source\7zip\7zip\Compress\LZ\*.*
  648.   SetOutPath $INSTDIR\Source\7zip\7zip\Compress\LZ\BinTree
  649.   File ..\Source\7zip\7zip\Compress\LZ\BinTree\*.*
  650.   SetOutPath $INSTDIR\Source\7zip\7zip\Compress\LZMA
  651.   File ..\Source\7zip\7zip\Compress\LZMA\*.*
  652.   SetOutPath $INSTDIR\Source\7zip\7zip\Compress\LZMA_SMALL
  653.   File ..\Source\7zip\7zip\Compress\LZMA_SMALL\*.*
  654.   SetOutPath $INSTDIR\Source\7zip\7zip\Compress\RangeCoder
  655.   File ..\Source\7zip\7zip\Compress\RangeCoder\*.*
  656.   SetOutPath $INSTDIR\Source\7zip\7zip\Common
  657.   File ..\Source\7zip\7zip\Common\*.*
  658.   # exehead
  659.   SetOutPath $INSTDIR\Source\exehead
  660.   File ..\Source\exehead\*.c
  661.   File ..\Source\exehead\*.h
  662.   File ..\Source\exehead\resource.rc
  663.   File ..\Source\exehead\*.dsp
  664.   ; outdated - File ..\Source\exehead\Makefile
  665.   File ..\Source\exehead\nsis.ico
  666.   File ..\Source\exehead\uninst.ico
  667.   File ..\Source\exehead\bitmap1.bmp
  668.   File ..\Source\exehead\bin2h.exe
  669. SectionEnd
  670.  
  671. Section "ExDLL Source (required)" SecSrcEx
  672.  
  673.   ;required for other plugins sources
  674.   ;text changes in .onSelChange
  675.  
  676.   SetDetailsPrint textonly
  677.   DetailPrint "Installing Source Code | ExDLL Source..."
  678.   SetDetailsPrint listonly
  679.  
  680.   SectionIn 1
  681.  
  682.   SetOutPath $INSTDIR\Contrib\ExDLL
  683.   File ..\Contrib\exdll\exdll.c
  684.   File ..\Contrib\exdll\exdll.h
  685.   File ..\Contrib\exdll\exdll.dsp
  686.   File ..\Contrib\exdll\exdll.dsw
  687.   File ..\Contrib\exdll\exdll.dpr
  688.   File ..\Contrib\exdll\exdll_with_unit.dpr
  689.   File ..\Contrib\exdll\nsis.pas
  690.   File ..\Contrib\exdll\extdll.inc
  691.  
  692. SectionEnd
  693.  
  694. Section "Zip2Exe Source" SecToolsZ2ES
  695.  
  696.   SetDetailsPrint textonly
  697.   DetailPrint "Installing Source Code | Zip2exe Source..."
  698.   SetDetailsPrint listonly
  699.  
  700.   SectionIn 1
  701.  
  702.   RMDir /r $INSTDIR\Source\Zip2Exe
  703.   SetOutPath $INSTDIR\Contrib\zip2exe
  704.   File ..\Contrib\zip2exe\*.cpp
  705.   File ..\Contrib\zip2exe\*.ico
  706.   File ..\Contrib\zip2exe\*.h
  707.   File ..\Contrib\zip2exe\*.rc
  708.   File ..\Contrib\zip2exe\*.dsw
  709.   File ..\Contrib\zip2exe\*.dsp
  710.   File ..\Contrib\zip2exe\*.xml
  711.   SetOutPath $INSTDIR\Contrib\zip2exe\zlib
  712.   File ..\Contrib\zip2exe\zlib\*.*
  713. SectionEnd
  714.  
  715. SubSection "Tools" SecToolsS
  716.  
  717. Section "MakeNSISW Source" SecSrcMNW
  718.  
  719.   SetDetailsPrint textonly
  720.   DetailPrint "Installing Source Code | MakeNSISW Source..."
  721.   SetDetailsPrint listonly
  722.  
  723.   SectionIn 1
  724.  
  725.   SetOutPath $INSTDIR\Contrib\Makensisw
  726.   File ..\Contrib\Makensisw\*.cpp
  727.   File ..\Contrib\Makensisw\*.xml
  728.   File ..\Contrib\Makensisw\*.h
  729.   File ..\Contrib\Makensisw\*.dsw
  730.   File ..\Contrib\Makensisw\*.dsp
  731.   File ..\Contrib\Makensisw\*.rc
  732.   File ..\Contrib\Makensisw\*.bmp
  733.   File ..\Contrib\Makensisw\*.ico
  734.   File ..\Contrib\Makensisw\*.psp
  735.   #File ..\Contrib\Makensisw\Makefile
  736. SectionEnd
  737.  
  738. Section "UI Holder Source" SecSrcUIHolder
  739.  
  740.   SetDetailsPrint textonly
  741.   DetailPrint "Installing Source Code | UI Holder..."
  742.   SetDetailsPrint listonly
  743.  
  744.   SectionIn 1
  745.  
  746.   SetOutPath "$INSTDIR\Contrib\UIs\UI Holder"
  747.   File "..\Contrib\UIs\UI Holder\*.h"
  748.   File "..\Contrib\UIs\UI Holder\*.cpp"
  749.   File "..\Contrib\UIs\UI Holder\*.rc"
  750.   File "..\Contrib\UIs\UI Holder\*.dsw"
  751.   File "..\Contrib\UIs\UI Holder\*.dsp"
  752. SectionEnd
  753.  
  754. SubSectionEnd
  755.  
  756. SubSection "Plug-ins" SecPluginsPluginsS
  757.  
  758. Section "Banner Source" SecPluginsBannerS
  759.  
  760.   SetDetailsPrint textonly
  761.   DetailPrint "Installing Source Code | Plug-ins | Banner Source..."
  762.   SetDetailsPrint listonly
  763.  
  764.   SectionIn 1
  765.  
  766.   SetOutPath $INSTDIR\Contrib\Banner
  767.   File ..\Contrib\Banner\Banner.dsw
  768.   File ..\Contrib\Banner\Banner.dsp
  769.   File ..\Contrib\Banner\Banner.c
  770. SectionEnd
  771.  
  772. Section "Language DLL Source" SecPluginsLangDLLS
  773.  
  774.   SetDetailsPrint textonly
  775.   DetailPrint "Installing Source Code | Plug-ins | Language DLL Source..."
  776.   SetDetailsPrint listonly
  777.  
  778.   SectionIn 1
  779.  
  780.   SetOutPath $INSTDIR\Contrib\LangDLL
  781.   File ..\Contrib\LangDLL\LangDLL.c
  782.   File ..\Contrib\LangDLL\resource.h
  783.   File ..\Contrib\LangDLL\resource.rc
  784.   File ..\Contrib\LangDLL\LangDLL.dsw
  785.   File ..\Contrib\LangDLL\LangDLL.dsp
  786. SectionEnd
  787.  
  788. Section "nsExec Source" SecPluginsnsExecS
  789.  
  790.   SetDetailsPrint textonly
  791.   DetailPrint "Installing Source Code | Plug-ins | nsExec Source..."
  792.   SetDetailsPrint listonly
  793.  
  794.   SectionIn 1
  795.  
  796.   SetOutPath $INSTDIR\Contrib\nsExec
  797.   File ..\Contrib\nsExec\*.c
  798.   File ..\Contrib\nsExec\*.dsw
  799.   File ..\Contrib\nsExec\*.dsp
  800. SectionEnd
  801.  
  802. Section "Splash Source" SecPluginsSplashS
  803.  
  804.   SetDetailsPrint textonly
  805.   DetailPrint "Installing Source Code | Plug-ins | Splash Source..."
  806.   SetDetailsPrint listonly
  807.  
  808.   SectionIn 1
  809.  
  810.   SetOutPath $INSTDIR\Contrib\Splash
  811.   File ..\Contrib\Splash\splash.c
  812.   File ..\Contrib\Splash\splash.dsp
  813.   File ..\Contrib\Splash\splash.dsw
  814. SectionEnd
  815.  
  816. Section "AdvSplash Source" SecPluginsSplashTS
  817.  
  818.   SetDetailsPrint textonly
  819.   DetailPrint "Installing Source Code | Plug-ins | AdvSplash Source..."
  820.   SetDetailsPrint listonly
  821.  
  822.   SectionIn 1
  823.  
  824.   SetOutPath $INSTDIR\Contrib\AdvSplash
  825.   File ..\Contrib\AdvSplash\*.c
  826.   File ..\Contrib\AdvSplash\*.dsw
  827.   File ..\Contrib\AdvSplash\*.dsp
  828. SectionEnd
  829.  
  830. Section "BgImage Source" SecPluginsBgImageS
  831.  
  832.   SetDetailsPrint textonly
  833.   DetailPrint "Installing Source Code | Plug-ins | BgImage Source..."
  834.   SetDetailsPrint listonly
  835.  
  836.   SectionIn 1
  837.  
  838.   SetOutPath $INSTDIR\Contrib\BgImage
  839.   File ..\Contrib\BgImage\BgImage.cpp
  840.   File ..\Contrib\BgImage\BgImage.dsw
  841.   File ..\Contrib\BgImage\BgImage.dsp
  842. SectionEnd
  843.  
  844. Section "InstallOptions Source" SecPluginsIOS
  845.  
  846.   SetDetailsPrint textonly
  847.   DetailPrint "Installing Source Code | Plug-ins | InstallOptions Source..."
  848.   SetDetailsPrint listonly
  849.  
  850.   SectionIn 1
  851.  
  852.   SetOutPath $INSTDIR\Contrib\InstallOptions
  853.   File ..\contrib\installoptions\io.dsp
  854.   File ..\contrib\installoptions\io.dsw
  855.   File ..\contrib\installoptions\InstallerOptions.cpp
  856.   File ..\contrib\installoptions\*.rc
  857.   File ..\contrib\installoptions\*.h
  858. SectionEnd
  859.  
  860. Section "Math Source" SecPluginsMathS
  861.  
  862.   SetDetailsPrint textonly
  863.   DetailPrint "Installing Source Code | Plug-ins | Math Source..."
  864.   SetDetailsPrint listonly
  865.  
  866.   SectionIn 1
  867.  
  868.   SetOutPath $INSTDIR\Contrib\Math\Source
  869.   File ..\contrib\Math\Source\*.c
  870.   File ..\contrib\Math\Source\*.h
  871.   File ..\contrib\Math\Source\*.sln
  872.   File ..\contrib\Math\Source\*.lib
  873.   File ..\contrib\Math\Source\*.vcproj
  874. SectionEnd
  875.  
  876. Section "NSISdl Source" SecPluginsNSISDLS
  877.  
  878.   SetDetailsPrint textonly
  879.   DetailPrint "Installing Source Code | Plug-ins | NSISdl Source..."
  880.   SetDetailsPrint listonly
  881.  
  882.   SectionIn 1
  883.  
  884.   SetOutPath $INSTDIR\Contrib\NSISdl
  885.   File ..\contrib\NSISdl\nsisdl.dsw
  886.   File ..\contrib\NSISdl\nsisdl.dsp
  887.   File ..\contrib\NSISdl\*.cpp
  888.   File ..\contrib\NSISdl\*.h
  889. SectionEnd
  890.  
  891. Section "System Source" SecPluginsSystemS
  892.  
  893.   SetDetailsPrint textonly
  894.   DetailPrint "Installing Source Code | Plug-ins | System Source..."
  895.   SetDetailsPrint listonly
  896.  
  897.   SectionIn 1
  898.  
  899.   SetOutPath $INSTDIR\Contrib\System\Source
  900.   File ..\contrib\System\Source\*.c
  901.   File ..\contrib\System\Source\*.h
  902.   File ..\contrib\System\Source\*.sln
  903.   File ..\contrib\System\Source\*.obj
  904.   File ..\contrib\System\Source\*.vcproj
  905. SectionEnd
  906.  
  907. Section "StartMenu Source" SecPluginsStartMenuS
  908.  
  909.   SetDetailsPrint textonly
  910.   DetailPrint "Installing Source Code | Plug-ins | StartMenu Source..."
  911.   SetDetailsPrint listonly
  912.  
  913.   SectionIn 1
  914.   SetOutPath $INSTDIR\Contrib\StartMenu
  915.   File ..\Contrib\StartMenu\StartMenu.c
  916.   File ..\Contrib\StartMenu\StartMenu.dsp
  917.   File ..\Contrib\StartMenu\StartMenu.dsw
  918.   File ..\Contrib\StartMenu\StartMenu.rc
  919.   File ..\Contrib\StartMenu\resource.h
  920. SectionEnd
  921.  
  922. Section "UserInfo Source" SecPluginsUserInfoS
  923.  
  924.   SetDetailsPrint textonly
  925.   DetailPrint "Installing Source Code | Plug-ins | UserInfo Source..."
  926.   SetDetailsPrint listonly
  927.  
  928.   SectionIn 1
  929.  
  930.   SetOutPath $INSTDIR\Contrib\UserInfo
  931.   File ..\Contrib\UserInfo\UserInfo.c
  932.   File ..\Contrib\UserInfo\UserInfo.dsp
  933.   File ..\Contrib\UserInfo\UserInfo.dsw
  934. SectionEnd
  935.  
  936. Section "Dialer Source" SecPluginsDialerS
  937.  
  938.   SetDetailsPrint textonly
  939.   DetailPrint "Installing Source Code | Plug-ins | Dialer Source..."
  940.   SetDetailsPrint listonly
  941.  
  942.   SectionIn 1
  943.  
  944.   SetOutPath $INSTDIR\Contrib\Dialer
  945.   File ..\Contrib\Dialer\dialer.c
  946.   File ..\Contrib\Dialer\dialer.dsp
  947.   File ..\Contrib\Dialer\dialer.dsw
  948. SectionEnd
  949.  
  950. Section "VPatch Source" SecPluginsVPatchS
  951.  
  952.   SetDetailsPrint textonly
  953.   DetailPrint "Installing Source Code | Plug-ins | VPatch Source..."
  954.   SetDetailsPrint listonly
  955.  
  956.   SectionIn 1
  957.  
  958.   SetOutPath $INSTDIR\Contrib\VPatch\Source
  959.   File ..\Contrib\VPatch\Source\*.bpg
  960.  
  961.   SetOutPath $INSTDIR\Contrib\VPatch\Source\GenPat
  962.   File ..\Contrib\VPatch\Source\GenPat\*.pas
  963.   File ..\Contrib\VPatch\Source\GenPat\*.dpr
  964.  
  965.   SetOutPath $INSTDIR\Contrib\VPatch\Source\Plugin
  966.   File ..\Contrib\VPatch\Source\Plugin\*.c
  967.   File ..\Contrib\VPatch\Source\Plugin\*.dsw
  968.   File ..\Contrib\VPatch\Source\Plugin\*.dsp
  969.  
  970.   SetOutPath $INSTDIR\Contrib\VPatch\Source\GUI
  971.   File ..\Contrib\VPatch\Source\GUI\*.pas
  972.   File ..\Contrib\VPatch\Source\GUI\*.dpr
  973.   File ..\Contrib\VPatch\Source\GUI\*.dfm
  974.   File ..\Contrib\VPatch\Source\GUI\*.dof
  975.   File ..\Contrib\VPatch\Source\GUI\*.res
  976.  
  977. SectionEnd
  978.  
  979. SubSectionEnd ; plugins
  980.  
  981. SubSectionEnd
  982.  
  983. Section -post
  984.  
  985.   ; When Modern UI is installed:
  986.   ; * Always install the English language file
  987.   ; * Always install default icons / bitmaps
  988.  
  989.   !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
  990.  
  991.     mui:
  992.  
  993.     SetDetailsPrint textonly
  994.     DetailPrint "Configurating Modern UI..."
  995.     SetDetailsPrint listonly
  996.  
  997.     !insertmacro SectionFlagIsSet ${SecLangFiles} ${SF_SELECTED} langfiles nolangfiles
  998.  
  999.       nolangfiles:
  1000.  
  1001.       SetOutPath "$INSTDIR\Contrib\Language files"
  1002.       File "..\Contrib\Language files\English.nlf"
  1003.       SetOutPath "$INSTDIR\Contrib\Modern UI\Language files"
  1004.       File "..\Contrib\Modern UI\Language files\Default.nsh"
  1005.       File "..\Contrib\Modern UI\Language files\English.nsh"
  1006.  
  1007.     langfiles:
  1008.  
  1009.     !insertmacro SectionFlagIsSet ${SecGraphics} ${SF_SELECTED} graphics nographics
  1010.  
  1011.       nographics:
  1012.  
  1013.       SetOutPath $INSTDIR\Contrib\Graphics
  1014.       SetOutPath $INSTDIR\Contrib\Graphics\Checks
  1015.       File "..\Contrib\Graphics\Checks\modern.bmp"
  1016.       SetOutPath $INSTDIR\Contrib\Graphics\Icons
  1017.       File "..\Contrib\Graphics\Icons\modern-install.ico"
  1018.       File "..\Contrib\Graphics\Icons\modern-uninstall.ico"
  1019.       SetOutPath $INSTDIR\Contrib\Graphics\Header
  1020.       File "..\Contrib\Graphics\Header\nsis.bmp"
  1021.       SetOutPath $INSTDIR\Contrib\Graphics\Wizard
  1022.       File "..\Contrib\Graphics\Wizard\win.bmp"
  1023.  
  1024.     graphics:
  1025.  
  1026.   nomui:
  1027.  
  1028.   SetDetailsPrint textonly
  1029.   DetailPrint "Creating Registry Keys..."
  1030.   SetDetailsPrint listonly
  1031.  
  1032.   SetOutPath $INSTDIR
  1033.  
  1034.   WriteRegStr HKLM "Software\NSIS" "" $INSTDIR
  1035.   WriteRegDword HKLM "Software\NSIS" "VersionMajor" "${VER_MAJOR}"
  1036.   WriteRegDword HKLM "Software\NSIS" "VersionMinor" "${VER_MINOR}"
  1037.   WriteRegDword HKLM "Software\NSIS" "VersionRevision" "${VER_REVISION}"
  1038.   WriteRegDword HKLM "Software\NSIS" "VersionBuild" "${VER_BUILD}"
  1039.  
  1040.   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "UninstallString" '"$INSTDIR\uninst-nsis.exe"'
  1041.   WriteRegExpandStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "InstallLocation" "$INSTDIR"
  1042.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayName" "Nullsoft Install System"
  1043.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayIcon" "$INSTDIR\NSIS.exe,0"
  1044.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "DisplayVersion" "${VER_DISPLAY}"
  1045.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "VersionMajor" "${VER_MAJOR}"
  1046.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "VersionMinor" "${VER_MINOR}.${VER_REVISION}"
  1047.   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "URLInfoAbout" "http://nsis.sourceforge.net/"
  1048.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "NoModify" "1"
  1049.   WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "NoRepair" "1"
  1050.  
  1051. !ifndef NO_STARTMENUSHORTCUTS
  1052.   IfFileExists $SMPROGRAMS\NSIS "" no_startshortcuts
  1053.  
  1054.   SetDetailsPrint textonly
  1055.   DetailPrint "Creating Shortcuts..."
  1056.   SetDetailsPrint listonly
  1057.  
  1058.   IfFileExists $INSTDIR\Examples 0 +2
  1059.     CreateShortCut "$SMPROGRAMS\NSIS\NSIS Examples Directory.lnk" "$INSTDIR\Examples"
  1060.  
  1061.   IfFileExists "$INSTDIR\Source" 0 +2
  1062.     CreateShortCut "$SMPROGRAMS\NSIS\MakeNSIS project workspace.lnk" "$INSTDIR\source\makenssi.dsw"
  1063.  
  1064.   CreateDirectory $SMPROGRAMS\NSIS\Contrib\Source
  1065.  
  1066.   ; MakeNSISW
  1067.   CreateDirectory $SMPROGRAMS\NSIS\Contrib
  1068.     CreateShortCut "$SMPROGRAMS\NSIS\Contrib\MakeNSISW readme.lnk" "$INSTDIR\contrib\MakeNsisw\readme.txt"
  1069.  
  1070.   Push "MakeNSISW"
  1071.   Call AddWorkspaceToStartMenu
  1072.  
  1073.   ; ExDLL
  1074.   Push "ExDLL"
  1075.   Call AddWorkspaceToStartMenu
  1076.  
  1077.   ; InstallOptions
  1078.   Push "InstallOptions\Readme.html"
  1079.   Push "InstallOptions Readme"
  1080.   Call AddContribToStartMenu
  1081.  
  1082.   Push "InstallOptions\io.dsw"
  1083.   Push "Source\InstallOptions project workspace"
  1084.   Call AddContribToStartMenu
  1085.  
  1086.   ; ZIP2EXE
  1087.   IfFileExists "$INSTDIR\Bin\zip2exe.exe" 0 +2
  1088.     CreateShortCut "$SMPROGRAMS\NSIS\Contrib\Zip2Exe (create SFX).lnk" "$INSTDIR\Bin\zip2exe.exe"
  1089.  
  1090.   Push ZIP2EXE
  1091.   Call AddWorkspaceToStartMenu
  1092.  
  1093.   ; Modern UI
  1094.   Push "Modern UI\Readme.html"
  1095.   Push "Modern UI Readme"
  1096.   Call AddContribToStartMenu
  1097.  
  1098.   ; Splash
  1099.   Push Splash
  1100.   Call AddReadmeToStartMenu
  1101.  
  1102.   Push Splash
  1103.   Call AddWorkspaceToStartMenu
  1104.  
  1105.   ; Advanced splash
  1106.   Push AdvSplash
  1107.   Call AddReadmeToStartMenu
  1108.  
  1109.   Push AdvSplash
  1110.   Call AddWorkspaceToStartMenu
  1111.  
  1112.   ; Math
  1113.   Push Math
  1114.   Call AddReadmeToStartMenu
  1115.  
  1116.   Push "Math\Source\Math.sln"
  1117.   Push "Source\Math project workspace"
  1118.   Call AddContribToStartMenu
  1119.  
  1120.   ; NSISdl
  1121.   Push NSISdl
  1122.   Call AddReadmeToStartMenu
  1123.  
  1124.   Push NSISdl
  1125.   Call AddWorkspaceToStartMenu
  1126.  
  1127.   ; UserInfo
  1128.   Push UserInfo
  1129.   Call AddWorkspaceToStartMenu
  1130.  
  1131.   ; nsExec
  1132.   Push nsExec
  1133.   Call AddReadmeToStartMenu
  1134.  
  1135.   Push nsExec
  1136.   Call AddWorkspaceToStartMenu
  1137.  
  1138.   ; LangDLL
  1139.   Push LangDLL
  1140.   Call AddWorkspaceToStartMenu
  1141.  
  1142.   ; StartMenu
  1143.   Push StartMenu
  1144.   Call AddReadmeToStartMenu
  1145.  
  1146.   Push StartMenu
  1147.   Call AddWorkspaceToStartMenu
  1148.  
  1149.   ; BgImage
  1150.   Push BgImage
  1151.   Call AddReadmeToStartMenu
  1152.  
  1153.   Push BgImage
  1154.   Call AddWorkspaceToStartMenu
  1155.  
  1156.   ; Banner
  1157.   Push Banner
  1158.   Call AddReadmeToStartMenu
  1159.  
  1160.   Push Banner
  1161.   Call AddWorkspaceToStartMenu
  1162.  
  1163.   ; System
  1164.   Push System
  1165.   Call AddReadmeToStartMenu
  1166.  
  1167.   Push System\Source\System.sln
  1168.   Push "Source\System project workspace"
  1169.   Call AddContribToStartMenu
  1170.  
  1171.   ; VPatch
  1172.   Push "VPatch\Readme.html"
  1173.   Push "VPatch Readme"
  1174.   Call AddContribToStartMenu
  1175.  
  1176.   no_startshortcuts:
  1177. !endif
  1178.  
  1179.   ; will only be removed if empty
  1180.   SetDetailsPrint none
  1181.   RMDir $INSTDIR\Contrib\Source
  1182.   SetDetailsPrint lastused
  1183.  
  1184.   WriteUninstaller $INSTDIR\uninst-nsis.exe
  1185.  
  1186.   SetDetailsPrint both
  1187.  
  1188. SectionEnd
  1189.  
  1190. ;--------------------------------
  1191. ;Descriptions
  1192.  
  1193. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  1194.   !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core files required to use NSIS (compiler etc.)"
  1195.   !insertmacro MUI_DESCRIPTION_TEXT ${SecExample} "Example installation scripts that show you how to use NSIS"
  1196.   !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "Adds icons to your start menu and your desktop for easy access"
  1197.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfaces} "User interface designs that can be used to change the installer look and feel"
  1198.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesModernUI} "A modern user interface like the wizards of recent Windows versions"
  1199.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesDefaultUI} "The default NSIS user interface which you can customize to make your own UI"
  1200.   !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesTinyUI} "A tiny version of the default user interface"
  1201.   !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} "Tools that help you with NSIS development"
  1202.   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsS} "Source code to tools that help you with NSIS development"
  1203.   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsUpdate} "A tool that lets you check for new NSIS releases and download the latest development files"
  1204.   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} "A utility that converts a ZIP file to a NSIS installer"
  1205.   !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2ES} "Source code to a utility that converts a ZIP file to a NSIS installer"
  1206.   !insertmacro MUI_DESCRIPTION_TEXT ${SecGraphics} "Icons, checkbox images and other graphics"
  1207.   !insertmacro MUI_DESCRIPTION_TEXT ${SecLangFiles} "Language files used to support multiple languages in an installer"
  1208.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} "Useful plugins that extend NSIS's functionality"
  1209.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPluginsS} "Source code for plugins"
  1210.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} "Plugin that lets you show a banner before installation starts"
  1211.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBannerS} "Source code to plugin that lets you show a banner before installation starts"
  1212.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLangDLL} "Plugin that lets you add a language select dialog to your installer"
  1213.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLangDLLS} "Source code to plugin that lets you add a language select dialog to your installer"
  1214.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsnsExec} "Plugin that executes console programs and prints its output in the NSIS log window or hides it"
  1215.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsnsExecS} "Source code to plugin that executes console programs and prints its output in the NSIS log window or hides it"
  1216.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplash} "Splash screen add-on that lets you add a splash screen to an installer"
  1217.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashS} "Source code to splash screen add-on that lets you add a splash screen to an installer"
  1218.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashT} "Splash screen add-on with transparency support that lets you add a splash screen to an installer"
  1219.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashTS} "Source code to splash screen add-on with transparency support that lets you add a splash screen to an installer"
  1220.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSystem} "Plugin that lets you call Win32 API or external DLLs"
  1221.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSystemS} "Source code to plugin that lets you call Win32 API or external DLLs"
  1222.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsMath} "Plugin that lets you evaluate complicated mathematical expressions"
  1223.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsMathS} "Source code to plugin that lets you evaluate complicated mathematical expressions"
  1224.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialer} "Plugin that provides internet connection functions"
  1225.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialerS} "Source code to plugin that provides internet connection functions"
  1226.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsIO} "Plugin that lets you add custom pages to an installer"
  1227.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsIOS} "Source code to plugin that lets you add custom pages to an installer"
  1228.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsStartMenu} "Plugin that lets the user select the start menu folder"
  1229.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsStartMenuS} "Source code to plugin that lets the user select the start menu folder"
  1230.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBgImage} "Plugin that lets you show a persistent background image plugin and play sounds"
  1231.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBgImageS} "Source code to plugin that lets you show a persistent background image plugin and play sounds"
  1232.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsUserInfo} "Plugin that that gives you the user name and the user account type"
  1233.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsUserInfoS} "Source code to plugin that that gives you the user name and the user account type"
  1234.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsNSISDL} "Plugin that lets you create a web based installer"
  1235.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsNSISDLS} "Source code to plugin that lets you create a web based installer"
  1236.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsVPatch} "Plugin that lets you create patches to upgrade older files"
  1237.   !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsVPatchS} "Source code to plugin that lets you create patches to upgrade older files"
  1238.   !insertmacro MUI_DESCRIPTION_TEXT ${SecSrc} "Source code to NSIS and all related files"
  1239.   !insertmacro MUI_DESCRIPTION_TEXT ${SecSrcNSIS} "Source code to NSIS"
  1240.   !insertmacro MUI_DESCRIPTION_TEXT ${SecSrcEx} "Example DLL plugin source in C and plugin function header"
  1241.   !insertmacro MUI_DESCRIPTION_TEXT ${SecSrcUIHolder} "Source code to the UI Holder where you can put your recources in to preview your user interface"
  1242.   !insertmacro MUI_DESCRIPTION_TEXT ${SecSrcMNW} "Source code to MakeNSISW (compiler interface)"
  1243. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  1244.  
  1245. ;--------------------------------
  1246. ;Installer Functions
  1247.  
  1248. Function .onInit
  1249.  
  1250.   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "makensis.ini"
  1251.  
  1252. FunctionEnd
  1253.  
  1254. Function PageReinstall
  1255.  
  1256.   ReadRegStr $R0 HKLM "Software\NSIS" ""
  1257.  
  1258.   StrCmp $R0 "" 0 +2
  1259.     Abort
  1260.  
  1261.   ;Detect version
  1262.     ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMajor"
  1263.     IntCmp $R0 ${VER_MAJOR} minor_check new_version older_version
  1264.   minor_check:
  1265.     ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMinor"
  1266.     IntCmp $R0 ${VER_MINOR} revision_check new_version older_version
  1267.   revision_check:
  1268.     ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionRevision"
  1269.     IntCmp $R0 ${VER_REVISION} build_check new_version older_version
  1270.   build_check:
  1271.     ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionBuild"
  1272.     IntCmp $R0 ${VER_BUILD} same_version new_version older_version
  1273.  
  1274.   new_version:
  1275.  
  1276.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 1" "Text" "An older version of NSIS is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
  1277.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 2" "Text" "Uninstall before installing"
  1278.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 3" "Text" "Do not uninstall"
  1279.    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
  1280.    StrCpy $R0 "1"
  1281.    Goto reinst_start
  1282.  
  1283.   older_version:
  1284.  
  1285.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 1" "Text" "A newer version of NSIS is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
  1286.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 2" "Text" "Uninstall before installing"
  1287.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 3" "Text" "Do not uninstall"
  1288.    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
  1289.    StrCpy $R0 "1"
  1290.    Goto reinst_start
  1291.  
  1292.   same_version:
  1293.  
  1294.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 1" "Text" "NSIS ${VER_DISPLAY} is already installed. Select the operation you want to perform and click Next to continue."
  1295.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 2" "Text" "Add/Reinstall components"
  1296.    !insertmacro MUI_INSTALLOPTIONS_WRITE "makensis.ini" "Field 3" "Text" "Uninstall NSIS"
  1297.    !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
  1298.    StrCpy $R0 "2"
  1299.  
  1300.   reinst_start:
  1301.  
  1302.   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "makensis.ini"
  1303.  
  1304. FunctionEnd
  1305.  
  1306. Function PageLeaveReinstall
  1307.  
  1308.   !insertmacro MUI_INSTALLOPTIONS_READ $R1 "makensis.ini" "Field 2" "State"
  1309.  
  1310.   StrCmp $R0 "1" 0 +2
  1311.     StrCmp $R1 "1" reinst_uninstall reinst_done
  1312.  
  1313.   StrCmp $R0 "2" 0 +3
  1314.     StrCmp $R1 "1" reinst_done reinst_uninstall
  1315.  
  1316.   reinst_uninstall:
  1317.   ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS" "UninstallString"
  1318.  
  1319.   ;Run uninstaller
  1320.   HideWindow
  1321.  
  1322.     ClearErrors
  1323.     ExecWait '$R1 _?=$INSTDIR'
  1324.  
  1325.     IfErrors no_remove_uninstaller
  1326.     IfFileExists "$INSTDIR\makensis.exe" no_remove_uninstaller
  1327.  
  1328.       Delete $R1
  1329.       RMDir $INSTDIR
  1330.  
  1331.     no_remove_uninstaller:
  1332.  
  1333.   StrCmp $R0 "2" 0 +2
  1334.     Quit
  1335.  
  1336.   BringToFront
  1337.  
  1338.   reinst_done:
  1339.  
  1340. FunctionEnd
  1341.  
  1342. !macro secSelected SEC
  1343.   SectionGetFlags ${SEC} $R7
  1344.   IntOp $R7 $R7 & ${SF_SELECTED}
  1345.   IntCmp $R7 ${SF_SELECTED} 0 +2 +2
  1346.     IntOp $R0 $R0 + 1
  1347. !macroend
  1348.  
  1349. Function .onSelChange
  1350.   ;Plugins are linked to ExDLL
  1351.   StrCpy $R0 0
  1352.   !insertmacro secSelected ${SecPluginsSplashTS}
  1353.   !insertmacro secSelected ${SecPluginsBannerS}
  1354.   !insertmacro secSelected ${SecPluginsBgImageS}
  1355.   !insertmacro secSelected ${SecPluginsIOS}
  1356.   !insertmacro secSelected ${SecPluginsLangDLLS}
  1357.   !insertmacro secSelected ${SecPluginsnsExecS}
  1358.   !insertmacro secSelected ${SecPluginsNSISdlS}
  1359.   !insertmacro secSelected ${SecPluginsSplashS}
  1360.   !insertmacro secSelected ${SecPluginsStartMenuS}
  1361.   !insertmacro secSelected ${SecPluginsUserInfoS}
  1362.   !insertmacro secSelected ${SecPluginsDialerS}
  1363.   SectionGetFlags ${SecSrcEx} $R7
  1364.   StrCmp $R0 0 notRequired
  1365.     IntOp $R7 $R7 | ${SF_SELECTED}
  1366.     SectionSetFlags ${SecSrcEx} $R7
  1367.     SectionSetText ${SecSrcEx} "ExDLL Source (required)"
  1368.     Goto done
  1369.   notRequired:
  1370.     SectionSetText ${SecSrcEx} "ExDLL Source"
  1371.   done:
  1372. FunctionEnd
  1373.  
  1374. !ifndef NO_STARTMENUSHORTCUTS
  1375. Function AddContribToStartMenu
  1376.   Pop $0 ; link
  1377.   Pop $1 ; file
  1378.   IfFileExists $INSTDIR\Contrib\$1 0 +2
  1379.     CreateShortCut $SMPROGRAMS\NSIS\Contrib\$0.lnk $INSTDIR\Contrib\$1
  1380. FunctionEnd
  1381.  
  1382. Function AddWorkspaceToStartMenu
  1383.   Pop $0
  1384.   IfFileExists $INSTDIR\Contrib\$0\$0.dsw 0 done
  1385.     Push $0\$0.dsw
  1386.     Push "Source\$0 project workspace"
  1387.     Call AddContribToStartMenu
  1388.   done:
  1389. FunctionEnd
  1390.  
  1391. Function AddReadmeToStartMenu
  1392.   Pop $0
  1393.   IfFileExists $INSTDIR\Contrib\$0\$0.txt 0 +3
  1394.     Push $0\$0.txt
  1395.     Goto create
  1396.   IfFileExists $INSTDIR\Contrib\$0\Readme.txt 0 done
  1397.     Push $0\Readme.txt
  1398.   create:
  1399.     Push "$0 Readme"
  1400.     Call AddContribToStartMenu
  1401.   done:
  1402. FunctionEnd
  1403. !endif
  1404.  
  1405. ;--------------------------------
  1406. ;Uninstaller Section
  1407.  
  1408. Section Uninstall
  1409.  
  1410.   SetDetailsPrint textonly
  1411.   DetailPrint "Uninstalling NSI Development Shell Extensions..."
  1412.   SetDetailsPrint listonly
  1413.  
  1414.   IfFileExists $INSTDIR\makensis.exe nsis_installed
  1415.     MessageBox MB_YESNO "It does not appear that NSIS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES nsis_installed
  1416.     Abort "Uninstall aborted by user"
  1417.   nsis_installed:
  1418.  
  1419.   SetDetailsPrint textonly
  1420.   DetailPrint "Deleting Registry Keys..."
  1421.   SetDetailsPrint listonly
  1422.  
  1423.   ReadRegStr $R0 HKCR ".nsi" ""
  1424.   StrCmp $R0 "NSIS.Script" 0 +2
  1425.     DeleteRegKey HKCR ".nsi"
  1426.  
  1427.   ReadRegStr $R0 HKCR ".nsh" ""
  1428.   StrCmp $R0 "NSIS.Header" 0 +2
  1429.     DeleteRegKey HKCR ".nsh"
  1430.  
  1431.   DeleteRegKey HKCR "NSIS.Script"
  1432.   DeleteRegKey HKCR "NSIS.Header"
  1433.  
  1434.   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
  1435.   DeleteRegKey HKLM "Software\NSIS"
  1436.  
  1437.   SetDetailsPrint textonly
  1438.   DetailPrint "Deleting Files..."
  1439.   SetDetailsPrint listonly
  1440.  
  1441.   RMDir /r $SMPROGRAMS\NSIS
  1442.   Delete "$DESKTOP\Nullsoft Install System.lnk"
  1443.   Delete $INSTDIR\makensis.exe
  1444.   Delete $INSTDIR\makensisw.exe
  1445.   Delete $INSTDIR\NSIS.exe
  1446.   Delete $INSTDIR\license.txt
  1447.   Delete $INSTDIR\uninst-nsis.exe
  1448.   Delete $INSTDIR\nsisconf.nsi
  1449.   Delete $INSTDIR\nsisconf.nsh
  1450.   Delete $INSTDIR\NSIS.chm
  1451.   RMDIR /r $INSTDIR\CVS
  1452.   RMDir /r $INSTDIR\Contrib
  1453.   RMDir /r $INSTDIR\Menu
  1454.   RMDir /r $INSTDIR\Source
  1455.   RMDir /r $INSTDIR\Bin
  1456.   RMDir /r $INSTDIR\Plugins
  1457.   RMDir /r $INSTDIR\Examples
  1458.   RMDir /r $INSTDIR\Include
  1459.   RMDir $INSTDIR
  1460.  
  1461.   SetDetailsPrint both
  1462.  
  1463. SectionEnd
  1464.