makensis.nsi 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  1. ;NSIS Setup Script
  2. ;--------------------------------
  3. !ifdef VER_MAJOR & VER_MINOR
  4. !define /ifndef VER_REVISION 0
  5. !define /ifndef VER_BUILD 0
  6. !endif
  7. !define /ifndef VERSION 'anonymous-build'
  8. ;--------------------------------
  9. ;Configuration
  10. !ifdef NSIS_MAKENSIS64
  11. !define BITS 64
  12. !define NAMESUFFIX " (64 bit)"
  13. !else
  14. !define BITS 32
  15. !define NAMESUFFIX ""
  16. !endif
  17. !ifndef OUTFILE
  18. !define OUTFILE "..\nsis${BITS}-${VERSION}-setup.exe"
  19. !searchreplace OUTFILE "${OUTFILE}" nsis32 nsis
  20. !endif
  21. OutFile "${OUTFILE}"
  22. Unicode true
  23. SetCompressor /SOLID lzma
  24. InstType "Full"
  25. InstType "Lite"
  26. InstType "Minimal"
  27. InstallDir $PROGRAMFILES${BITS}\NSIS
  28. InstallDirRegKey HKLM Software\NSIS ""
  29. RequestExecutionLevel admin
  30. ;--------------------------------
  31. ;Header Files
  32. !include "MUI2.nsh"
  33. !include "Sections.nsh"
  34. !include "LogicLib.nsh"
  35. !include "Memento.nsh"
  36. !include "WordFunc.nsh"
  37. ;--------------------------------
  38. ;Definitions
  39. !define SHCNE_ASSOCCHANGED 0x8000000
  40. !define SHCNF_IDLIST 0
  41. ;--------------------------------
  42. ;Configuration
  43. ;Names
  44. Name "NSIS"
  45. Caption "NSIS ${VERSION}${NAMESUFFIX} Setup"
  46. !define REG_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS"
  47. ;Memento Settings
  48. !define MEMENTO_REGISTRY_ROOT HKLM
  49. !define MEMENTO_REGISTRY_KEY "${REG_UNINST_KEY}"
  50. ;Interface Settings
  51. !define MUI_ABORTWARNING
  52. !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\nsis3-install.ico"
  53. !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\nsis3-uninstall.ico"
  54. !define MUI_HEADERIMAGE
  55. !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis3-branding.bmp"
  56. !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\nsis3-branding.bmp"
  57. !define MUI_COMPONENTSPAGE_SMALLDESC
  58. ;Pages
  59. !define MUI_WELCOMEPAGE_TITLE "Welcome to the NSIS ${VERSION} Setup Wizard"
  60. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of NSIS (Nullsoft Scriptable Install System) ${VERSION}, the next generation of the Windows installer and uninstaller system that doesn't suck and isn't huge.$\r$\n$\r$\nNSIS includes a Modern User Interface, LZMA compression, support for multiple languages and an easy plug-in system.$\r$\n$\r$\n$_CLICK"
  61. !insertmacro MUI_PAGE_WELCOME
  62. !insertmacro MUI_PAGE_LICENSE "..\COPYING"
  63. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  64. Page custom PageReinstall PageLeaveReinstall
  65. !endif
  66. !insertmacro MUI_PAGE_COMPONENTS
  67. !insertmacro MUI_PAGE_DIRECTORY
  68. !insertmacro MUI_PAGE_INSTFILES
  69. !define MUI_FINISHPAGE_LINK "Visit the NSIS site for the latest news, FAQs and support"
  70. !define MUI_FINISHPAGE_LINK_LOCATION "http://nsis.sf.net/"
  71. !define MUI_FINISHPAGE_RUN "$INSTDIR\NSIS.exe"
  72. !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  73. !define MUI_FINISHPAGE_SHOWREADME
  74. !define MUI_FINISHPAGE_SHOWREADME_TEXT "Show release notes"
  75. !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowReleaseNotes
  76. !insertmacro MUI_PAGE_FINISH
  77. !insertmacro MUI_UNPAGE_CONFIRM
  78. !insertmacro MUI_UNPAGE_INSTFILES
  79. ;--------------------------------
  80. ;Languages
  81. !insertmacro MUI_LANGUAGE "English"
  82. ;--------------------------------
  83. ;Version information
  84. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  85. VIProductVersion ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD}
  86. VIAddVersionKey "FileVersion" "${VERSION}"
  87. VIAddVersionKey "FileDescription" "NSIS Setup"
  88. VIAddVersionKey "LegalCopyright" "http://nsis.sf.net/License"
  89. !endif
  90. ;--------------------------------
  91. ;Installer Sections
  92. !macro InstallPlugin pi
  93. !ifdef NSIS_MAKENSIS64
  94. File "/oname=$InstDir\Plugins\amd64-unicode\${pi}.dll" ..\Plugins\amd64-unicode\${pi}.dll
  95. !else
  96. File "/oname=$InstDir\Plugins\x86-ansi\${pi}.dll" ..\Plugins\x86-ansi\${pi}.dll
  97. File "/oname=$InstDir\Plugins\x86-unicode\${pi}.dll" ..\Plugins\x86-unicode\${pi}.dll
  98. !endif
  99. !macroend
  100. !macro InstallStub stub
  101. !ifdef NSIS_MAKENSIS64
  102. File ..\Stubs\${stub}-amd64-unicode
  103. !else
  104. File ..\Stubs\${stub}-x86-ansi
  105. File ..\Stubs\${stub}-x86-unicode
  106. !endif
  107. !macroend
  108. ${MementoSection} "NSIS Core Files (required)" SecCore
  109. SetDetailsPrint textonly
  110. DetailPrint "Installing NSIS Core Files..."
  111. SetDetailsPrint listonly
  112. SectionIn 1 2 3 RO
  113. SetOutPath $INSTDIR
  114. RMDir /r $SMPROGRAMS\NSIS
  115. IfFileExists $INSTDIR\nsisconf.nsi "" +2
  116. Rename $INSTDIR\nsisconf.nsi $INSTDIR\nsisconf.nsh
  117. SetOverwrite off
  118. File ..\nsisconf.nsh
  119. SetOverwrite on
  120. File ..\makensis.exe
  121. File ..\makensisw.exe
  122. File ..\COPYING
  123. File ..\NSIS.chm
  124. !searchparse /file "..\NSIS.chm" "ITSF" VALIDATE_CHM
  125. File ..\NSIS.exe
  126. !if /FileExists "..\NSIS.exe.manifest"
  127. File "..\NSIS.exe.manifest"
  128. !endif
  129. SetOutPath $INSTDIR\Bin
  130. File ..\Bin\makensis.exe
  131. !ifdef USE_NEW_ZLIB
  132. File ..\Bin\zlib.dll
  133. !else
  134. File ..\Bin\zlib1.dll
  135. !endif
  136. SetOutPath $INSTDIR\Stubs
  137. File ..\Stubs\uninst
  138. !insertmacro InstallStub bzip2
  139. !insertmacro InstallStub bzip2_solid
  140. !insertmacro InstallStub lzma
  141. !insertmacro InstallStub lzma_solid
  142. !insertmacro InstallStub zlib
  143. !insertmacro InstallStub zlib_solid
  144. SetOutPath $INSTDIR\Include
  145. File ..\Include\WinMessages.nsh
  146. File ..\Include\Sections.nsh
  147. File ..\Include\Library.nsh
  148. File ..\Include\UpgradeDLL.nsh
  149. File ..\Include\LogicLib.nsh
  150. File ..\Include\StrFunc.nsh
  151. File ..\Include\Colors.nsh
  152. File ..\Include\FileFunc.nsh
  153. File ..\Include\TextFunc.nsh
  154. File ..\Include\WordFunc.nsh
  155. File ..\Include\WinVer.nsh
  156. File ..\Include\x64.nsh
  157. File ..\Include\Memento.nsh
  158. File ..\Include\LangFile.nsh
  159. File ..\Include\InstallOptions.nsh
  160. File ..\Include\MultiUser.nsh
  161. File ..\Include\VB6RunTime.nsh
  162. File ..\Include\Util.nsh
  163. File ..\Include\WinCore.nsh
  164. SetOutPath $INSTDIR\Include\Win
  165. File ..\Include\Win\WinDef.nsh
  166. File ..\Include\Win\WinError.nsh
  167. File ..\Include\Win\WinNT.nsh
  168. File ..\Include\Win\WinUser.nsh
  169. File ..\Include\Win\COM.nsh
  170. File ..\Include\Win\Propkey.nsh
  171. SetOutPath $INSTDIR\Docs\StrFunc
  172. File ..\Docs\StrFunc\StrFunc.txt
  173. SetOutPath $INSTDIR\Docs\MultiUser
  174. File ..\Docs\MultiUser\Readme.html
  175. SetOutPath $INSTDIR\Docs\makensisw
  176. File ..\Docs\makensisw\*.txt
  177. SetOutPath $INSTDIR\Menu
  178. File ..\Menu\*.html
  179. SetOutPath $INSTDIR\Menu\images
  180. File ..\Menu\images\header.gif
  181. File ..\Menu\images\line.gif
  182. File ..\Menu\images\site.gif
  183. Delete $INSTDIR\makensis.htm
  184. Delete $INSTDIR\Docs\*.html
  185. Delete $INSTDIR\Docs\style.css
  186. RMDir $INSTDIR\Docs
  187. SetOutPath $INSTDIR\Bin
  188. File ..\Bin\LibraryLocal.exe
  189. File ..\Bin\RegTool.bin
  190. CreateDirectory $INSTDIR\Plugins\x86-ansi
  191. CreateDirectory $INSTDIR\Plugins\x86-unicode
  192. !ifdef NSIS_MAKENSIS64
  193. CreateDirectory $INSTDIR\Plugins\amd64-unicode
  194. !endif
  195. !insertmacro InstallPlugin TypeLib
  196. ReadRegStr $R0 HKCR ".nsi" ""
  197. StrCmp $R0 "NSISFile" 0 +2
  198. DeleteRegKey HKCR "NSISFile"
  199. WriteRegStr HKCR ".nsi" "" "NSIS.Script"
  200. WriteRegStr HKCR ".nsi" "PerceivedType" "text"
  201. WriteRegStr HKCR "NSIS.Script" "" "NSIS Script File"
  202. WriteRegStr HKCR "NSIS.Script\DefaultIcon" "" "$INSTDIR\makensisw.exe,1"
  203. ReadRegStr $R0 HKCR "NSIS.Script\shell\open\command" ""
  204. ${If} $R0 == ""
  205. WriteRegStr HKCR "NSIS.Script\shell" "" "open"
  206. WriteRegStr HKCR "NSIS.Script\shell\open\command" "" 'notepad.exe "%1"'
  207. ${EndIf}
  208. WriteRegStr HKCR "NSIS.Script\shell\compile" "" "Compile NSIS Script"
  209. WriteRegStr HKCR "NSIS.Script\shell\compile\command" "" '"$INSTDIR\makensisw.exe" "%1"'
  210. WriteRegStr HKCR "NSIS.Script\shell\compile-compressor" "" "Compile NSIS Script (Choose Compressor)"
  211. WriteRegStr HKCR "NSIS.Script\shell\compile-compressor\command" "" '"$INSTDIR\makensisw.exe" /ChooseCompressor "%1"'
  212. ReadRegStr $R0 HKCR ".nsh" ""
  213. StrCmp $R0 "NSHFile" 0 +2
  214. DeleteRegKey HKCR "NSHFile"
  215. WriteRegStr HKCR ".nsh" "" "NSIS.Header"
  216. WriteRegStr HKCR ".nsh" "PerceivedType" "text"
  217. WriteRegStr HKCR "NSIS.Header" "" "NSIS Header File"
  218. WriteRegStr HKCR "NSIS.Header\DefaultIcon" "" "$INSTDIR\makensisw.exe,2"
  219. ReadRegStr $R0 HKCR "NSIS.Header\shell\open\command" ""
  220. ${If} $R0 == ""
  221. WriteRegStr HKCR "NSIS.Header\shell" "" "open"
  222. WriteRegStr HKCR "NSIS.Header\shell\open\command" "" 'notepad.exe "%1"'
  223. ${EndIf}
  224. System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, p0, p0)'
  225. ${MementoSectionEnd}
  226. ${MementoSection} "Script Examples" SecExample
  227. SetDetailsPrint textonly
  228. DetailPrint "Installing Script Examples..."
  229. SetDetailsPrint listonly
  230. SectionIn 1 2
  231. SetOutPath $INSTDIR\Examples
  232. File ..\Examples\makensis.nsi
  233. File ..\Examples\example1.nsi
  234. File ..\Examples\example2.nsi
  235. File ..\Examples\viewhtml.nsi
  236. File ..\Examples\waplugin.nsi
  237. File ..\Examples\bigtest.nsi
  238. File ..\Examples\primes.nsi
  239. File ..\Examples\rtest.nsi
  240. File ..\Examples\gfx.nsi
  241. File ..\Examples\one-section.nsi
  242. File ..\Examples\languages.nsi
  243. File ..\Examples\Library.nsi
  244. File ..\Examples\VersionInfo.nsi
  245. File ..\Examples\UserVars.nsi
  246. File ..\Examples\LogicLib.nsi
  247. File ..\Examples\silent.nsi
  248. File ..\Examples\StrFunc.nsi
  249. File ..\Examples\FileFunc.nsi
  250. File ..\Examples\FileFunc.ini
  251. File ..\Examples\FileFuncTest.nsi
  252. File ..\Examples\TextFunc.nsi
  253. File ..\Examples\TextFunc.ini
  254. File ..\Examples\TextFuncTest.nsi
  255. File ..\Examples\WordFunc.nsi
  256. File ..\Examples\WordFunc.ini
  257. File ..\Examples\WordFuncTest.nsi
  258. File ..\Examples\Memento.nsi
  259. File ..\Examples\unicode.nsi
  260. SetOutPath $INSTDIR\Examples\Plugin
  261. File ..\Examples\Plugin\exdll.c
  262. File ..\Examples\Plugin\exdll.dpr
  263. File ..\Examples\Plugin\exdll.dsp
  264. File ..\Examples\Plugin\exdll.dsw
  265. File ..\Examples\Plugin\exdll_with_unit.dpr
  266. File ..\Examples\Plugin\exdll-vs2008.sln
  267. File ..\Examples\Plugin\exdll-vs2008.vcproj
  268. File ..\Examples\Plugin\extdll.inc
  269. File ..\Examples\Plugin\nsis.pas
  270. SetOutPath $INSTDIR\Examples\Plugin\nsis
  271. File ..\Examples\Plugin\nsis\pluginapi.h
  272. File /nonfatal ..\Examples\Plugin\nsis\pluginapi*.lib
  273. File ..\Examples\Plugin\nsis\api.h
  274. File ..\Examples\Plugin\nsis\nsis_tchar.h
  275. ${MementoSectionEnd}
  276. !ifndef NO_STARTMENUSHORTCUTS
  277. ${MementoSection} "Start Menu and Desktop Shortcuts" SecShortcuts
  278. SetDetailsPrint textonly
  279. DetailPrint "Installing Start Menu and Desktop Shortcuts..."
  280. SetDetailsPrint listonly
  281. !else
  282. ${MementoSection} "Desktop Shortcut" SecShortcuts
  283. SetDetailsPrint textonly
  284. DetailPrint "Installing Desktop Shortcut..."
  285. SetDetailsPrint listonly
  286. !endif
  287. SectionIn 1 2
  288. SetOutPath $INSTDIR
  289. !ifndef NO_STARTMENUSHORTCUTS
  290. CreateShortcut "$SMPROGRAMS\NSIS${NAMESUFFIX}.lnk" "$INSTDIR\NSIS.exe"
  291. !endif
  292. CreateShortcut "$DESKTOP\NSIS${NAMESUFFIX}.lnk" "$INSTDIR\NSIS.exe"
  293. ${MementoSectionEnd}
  294. SectionGroup "User Interfaces" SecInterfaces
  295. ${MementoSection} "Modern User Interface" SecInterfacesModernUI
  296. SetDetailsPrint textonly
  297. DetailPrint "Installing User Interfaces | Modern User Interface..."
  298. SetDetailsPrint listonly
  299. SectionIn 1 2
  300. SetOutPath "$INSTDIR\Examples\Modern UI"
  301. File "..\Examples\Modern UI\Basic.nsi"
  302. File "..\Examples\Modern UI\HeaderBitmap.nsi"
  303. File "..\Examples\Modern UI\MultiLanguage.nsi"
  304. File "..\Examples\Modern UI\StartMenu.nsi"
  305. File "..\Examples\Modern UI\WelcomeFinish.nsi"
  306. SetOutPath "$INSTDIR\Contrib\Modern UI"
  307. File "..\Contrib\Modern UI\System.nsh"
  308. File "..\Contrib\Modern UI\ioSpecial.ini"
  309. SetOutPath "$INSTDIR\Docs\Modern UI"
  310. File "..\Docs\Modern UI\Readme.html"
  311. File "..\Docs\Modern UI\Changelog.txt"
  312. File "..\Docs\Modern UI\License.txt"
  313. SetOutPath "$INSTDIR\Docs\Modern UI\images"
  314. File "..\Docs\Modern UI\images\header.gif"
  315. File "..\Docs\Modern UI\images\screen1.png"
  316. File "..\Docs\Modern UI\images\screen2.png"
  317. File "..\Docs\Modern UI\images\open.gif"
  318. File "..\Docs\Modern UI\images\closed.gif"
  319. SetOutPath $INSTDIR\Contrib\UIs
  320. File "..\Contrib\UIs\modern.exe"
  321. File "..\Contrib\UIs\modern_headerbmp.exe"
  322. File "..\Contrib\UIs\modern_headerbmpr.exe"
  323. File "..\Contrib\UIs\modern_nodesc.exe"
  324. File "..\Contrib\UIs\modern_smalldesc.exe"
  325. SetOutPath $INSTDIR\Include
  326. File "..\Include\MUI.nsh"
  327. SetOutPath "$INSTDIR\Contrib\Modern UI 2"
  328. File "..\Contrib\Modern UI 2\Deprecated.nsh"
  329. File "..\Contrib\Modern UI 2\Interface.nsh"
  330. File "..\Contrib\Modern UI 2\Localization.nsh"
  331. File "..\Contrib\Modern UI 2\MUI2.nsh"
  332. File "..\Contrib\Modern UI 2\Pages.nsh"
  333. SetOutPath "$INSTDIR\Contrib\Modern UI 2\Pages"
  334. File "..\Contrib\Modern UI 2\Pages\Components.nsh"
  335. File "..\Contrib\Modern UI 2\Pages\Directory.nsh"
  336. File "..\Contrib\Modern UI 2\Pages\Finish.nsh"
  337. File "..\Contrib\Modern UI 2\Pages\InstallFiles.nsh"
  338. File "..\Contrib\Modern UI 2\Pages\License.nsh"
  339. File "..\Contrib\Modern UI 2\Pages\StartMenu.nsh"
  340. File "..\Contrib\Modern UI 2\Pages\UninstallConfirm.nsh"
  341. File "..\Contrib\Modern UI 2\Pages\Welcome.nsh"
  342. SetOutPath "$INSTDIR\Docs\Modern UI 2"
  343. File "..\Docs\Modern UI 2\Readme.html"
  344. File "..\Docs\Modern UI 2\License.txt"
  345. SetOutPath "$INSTDIR\Docs\Modern UI 2\images"
  346. File "..\Docs\Modern UI 2\images\header.gif"
  347. File "..\Docs\Modern UI 2\images\screen1.png"
  348. File "..\Docs\Modern UI 2\images\screen2.png"
  349. File "..\Docs\Modern UI 2\images\open.gif"
  350. File "..\Docs\Modern UI 2\images\closed.gif"
  351. SetOutPath $INSTDIR\Include
  352. File "..\Include\MUI2.nsh"
  353. ${MementoSectionEnd}
  354. ${MementoSection} "Default User Interface" SecInterfacesDefaultUI
  355. SetDetailsPrint textonly
  356. DetailPrint "Installing User Interfaces | Default User Interface..."
  357. SetDetailsPrint listonly
  358. SectionIn 1
  359. SetOutPath "$INSTDIR\Contrib\UIs"
  360. File "..\Contrib\UIs\default.exe"
  361. ${MementoSectionEnd}
  362. ${MementoSection} "Tiny User Interface" SecInterfacesTinyUI
  363. SetDetailsPrint textonly
  364. DetailPrint "Installing User Interfaces | Tiny User Interface..."
  365. SetDetailsPrint listonly
  366. SectionIn 1
  367. SetOutPath "$INSTDIR\Contrib\UIs"
  368. File "..\Contrib\UIs\sdbarker_tiny.exe"
  369. ${MementoSectionEnd}
  370. SectionGroupEnd
  371. ${MementoSection} "Graphics" SecGraphics
  372. SetDetailsPrint textonly
  373. DetailPrint "Installing Graphics..."
  374. SetDetailsPrint listonly
  375. SectionIn 1
  376. Delete $INSTDIR\Contrib\Icons\*.ico
  377. Delete $INSTDIR\Contrib\Icons\*.bmp
  378. RMDir $INSTDIR\Contrib\Icons
  379. SetOutPath $INSTDIR\Contrib\Graphics
  380. File /r "..\Contrib\Graphics\*.ico"
  381. File /r "..\Contrib\Graphics\*.bmp"
  382. ${MementoSectionEnd}
  383. ${MementoSection} "Language Files" SecLangFiles
  384. SetDetailsPrint textonly
  385. DetailPrint "Installing Language Files..."
  386. SetDetailsPrint listonly
  387. SectionIn 1
  388. SetOutPath "$INSTDIR\Contrib\Language files"
  389. File "..\Contrib\Language files\*.nlf"
  390. SetOutPath $INSTDIR\Bin
  391. File ..\Bin\MakeLangID.exe
  392. !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
  393. mui:
  394. SetOutPath "$INSTDIR\Contrib\Language files"
  395. File "..\Contrib\Language files\*.nsh"
  396. nomui:
  397. ${MementoSectionEnd}
  398. SectionGroup "Tools" SecTools
  399. ${MementoSection} "Zip2Exe" SecToolsZ2E
  400. SetDetailsPrint textonly
  401. DetailPrint "Installing Tools | Zip2Exe..."
  402. SetDetailsPrint listonly
  403. SectionIn 1
  404. SetOutPath $INSTDIR\Bin
  405. File ..\Bin\zip2exe.exe
  406. SetOutPath $INSTDIR\Contrib\zip2exe
  407. File ..\Contrib\zip2exe\Base.nsh
  408. File ..\Contrib\zip2exe\Modern.nsh
  409. File ..\Contrib\zip2exe\Classic.nsh
  410. ${MementoSectionEnd}
  411. SectionGroupEnd
  412. SectionGroup "Plug-ins" SecPluginsPlugins
  413. ${MementoSection} "Banner" SecPluginsBanner
  414. SetDetailsPrint textonly
  415. DetailPrint "Installing Plug-ins | Banner..."
  416. SetDetailsPrint listonly
  417. SectionIn 1
  418. !insertmacro InstallPlugin Banner
  419. SetOutPath $INSTDIR\Docs\Banner
  420. File ..\Docs\Banner\Readme.txt
  421. SetOutPath $INSTDIR\Examples\Banner
  422. File ..\Examples\Banner\Example.nsi
  423. ${MementoSectionEnd}
  424. ${MementoSection} "Language DLL" SecPluginsLangDLL
  425. SetDetailsPrint textonly
  426. DetailPrint "Installing Plug-ins | Language DLL..."
  427. SetDetailsPrint listonly
  428. SectionIn 1
  429. !insertmacro InstallPlugin LangDLL
  430. ${MementoSectionEnd}
  431. ${MementoSection} "nsExec" SecPluginsnsExec
  432. SetDetailsPrint textonly
  433. DetailPrint "Installing Plug-ins | nsExec..."
  434. SetDetailsPrint listonly
  435. SectionIn 1
  436. !insertmacro InstallPlugin nsExec
  437. SetOutPath $INSTDIR\Docs\nsExec
  438. File ..\Docs\nsExec\nsExec.txt
  439. SetOutPath $INSTDIR\Examples\nsExec
  440. File ..\Examples\nsExec\test.nsi
  441. ${MementoSectionEnd}
  442. ${MementoSection} "Splash" SecPluginsSplash
  443. SetDetailsPrint textonly
  444. DetailPrint "Installing Plug-ins | Splash..."
  445. SetDetailsPrint listonly
  446. SectionIn 1
  447. !insertmacro InstallPlugin splash
  448. SetOutPath $INSTDIR\Docs\Splash
  449. File ..\Docs\Splash\splash.txt
  450. SetOutPath $INSTDIR\Examples\Splash
  451. File ..\Examples\Splash\Example.nsi
  452. ${MementoSectionEnd}
  453. ${MementoSection} "AdvSplash" SecPluginsSplashT
  454. SetDetailsPrint textonly
  455. DetailPrint "Installing Plug-ins | AdvSplash..."
  456. SetDetailsPrint listonly
  457. SectionIn 1
  458. !insertmacro InstallPlugin advsplash
  459. SetOutPath $INSTDIR\Docs\AdvSplash
  460. File ..\Docs\AdvSplash\advsplash.txt
  461. SetOutPath $INSTDIR\Examples\AdvSplash
  462. File ..\Examples\AdvSplash\Example.nsi
  463. ${MementoSectionEnd}
  464. ${MementoSection} "BgImage" SecPluginsBgImage
  465. SetDetailsPrint textonly
  466. DetailPrint "Installing Plug-ins | BgImage..."
  467. SetDetailsPrint listonly
  468. SectionIn 1
  469. !insertmacro InstallPlugin BgImage
  470. SetOutPath $INSTDIR\Docs\BgImage
  471. File ..\Docs\BgImage\BgImage.txt
  472. SetOutPath $INSTDIR\Examples\BgImage
  473. File ..\Examples\BgImage\Example.nsi
  474. ${MementoSectionEnd}
  475. ${MementoSection} "InstallOptions" SecPluginsIO
  476. SetDetailsPrint textonly
  477. DetailPrint "Installing Plug-ins | InstallOptions..."
  478. SetDetailsPrint listonly
  479. SectionIn 1
  480. !insertmacro InstallPlugin InstallOptions
  481. SetOutPath $INSTDIR\Docs\InstallOptions
  482. File ..\Docs\InstallOptions\Readme.html
  483. File ..\Docs\InstallOptions\Changelog.txt
  484. SetOutPath $INSTDIR\Examples\InstallOptions
  485. File ..\Examples\InstallOptions\test.ini
  486. File ..\Examples\InstallOptions\test.nsi
  487. File ..\Examples\InstallOptions\testimgs.ini
  488. File ..\Examples\InstallOptions\testimgs.nsi
  489. File ..\Examples\InstallOptions\testlink.ini
  490. File ..\Examples\InstallOptions\testlink.nsi
  491. File ..\Examples\InstallOptions\testnotify.ini
  492. File ..\Examples\InstallOptions\testnotify.nsi
  493. ${MementoSectionEnd}
  494. ${MementoSection} "nsDialogs" SecPluginsDialogs
  495. SetDetailsPrint textonly
  496. DetailPrint "Installing Plug-ins | nsDialogs..."
  497. SetDetailsPrint listonly
  498. SectionIn 1
  499. !insertmacro InstallPlugin nsDialogs
  500. SetOutPath $INSTDIR\Examples\nsDialogs
  501. File ..\Examples\nsDialogs\example.nsi
  502. File ..\Examples\nsDialogs\InstallOptions.nsi
  503. File ..\Examples\nsDialogs\timer.nsi
  504. File ..\Examples\nsDialogs\welcome.nsi
  505. SetOutPath $INSTDIR\Include
  506. File ..\Include\nsDialogs.nsh
  507. SetOutPath $INSTDIR\Docs\nsDialogs
  508. File ..\Docs\nsDialogs\Readme.html
  509. ${MementoSectionEnd}
  510. ${MementoSection} "Math" SecPluginsMath
  511. SetDetailsPrint textonly
  512. DetailPrint "Installing Plug-ins | Math..."
  513. SetDetailsPrint listonly
  514. SectionIn 1
  515. !insertmacro InstallPlugin Math
  516. SetOutPath $INSTDIR\Docs\Math
  517. File ..\Docs\Math\Math.txt
  518. SetOutPath $INSTDIR\Examples\Math
  519. File ..\Examples\Math\math.nsi
  520. File ..\Examples\Math\mathtest.txt
  521. File ..\Examples\Math\mathtest.nsi
  522. File ..\Examples\Math\mathtest.ini
  523. ${MementoSectionEnd}
  524. ${MementoSection} "NSISdl" SecPluginsNSISDL
  525. SetDetailsPrint textonly
  526. DetailPrint "Installing Plug-ins | NSISdl..."
  527. SetDetailsPrint listonly
  528. SectionIn 1
  529. !insertmacro InstallPlugin nsisdl
  530. SetOutPath $INSTDIR\Docs\NSISdl
  531. File ..\Docs\NSISdl\ReadMe.txt
  532. File ..\Docs\NSISdl\License.txt
  533. ${MementoSectionEnd}
  534. ${MementoSection} "System" SecPluginsSystem
  535. SetDetailsPrint textonly
  536. DetailPrint "Installing Plug-ins | System..."
  537. SetDetailsPrint listonly
  538. SectionIn 1
  539. !insertmacro InstallPlugin System
  540. SetOutPath $INSTDIR\Docs\System
  541. File ..\Docs\System\System.html
  542. File ..\Docs\System\WhatsNew.txt
  543. SetOutPath $INSTDIR\Examples\System
  544. File ..\Examples\System\Resource.dll
  545. File ..\Examples\System\SysFunc.nsh
  546. File ..\Examples\System\System.nsh
  547. File ..\Examples\System\System.nsi
  548. ${MementoSectionEnd}
  549. ${MementoSection} "StartMenu" SecPluginsStartMenu
  550. SetDetailsPrint textonly
  551. DetailPrint "Installing Plug-ins | StartMenu..."
  552. SetDetailsPrint listonly
  553. SectionIn 1
  554. !insertmacro InstallPlugin StartMenu
  555. SetOutPath $INSTDIR\Docs\StartMenu
  556. File ..\Docs\StartMenu\Readme.txt
  557. SetOutPath $INSTDIR\Examples\StartMenu
  558. File ..\Examples\StartMenu\Example.nsi
  559. ${MementoSectionEnd}
  560. ${MementoSection} "UserInfo" SecPluginsUserInfo
  561. SetDetailsPrint textonly
  562. DetailPrint "Installing Plug-ins | UserInfo..."
  563. SetDetailsPrint listonly
  564. SectionIn 1
  565. !insertmacro InstallPlugin UserInfo
  566. SetOutPath $INSTDIR\Examples\UserInfo
  567. File ..\Examples\UserInfo\UserInfo.nsi
  568. ${MementoSectionEnd}
  569. ${MementoSection} "Dialer" SecPluginsDialer
  570. SetDetailsPrint textonly
  571. DetailPrint "Installing Plug-ins | Dialer..."
  572. SetDetailsPrint listonly
  573. SectionIn 1
  574. !insertmacro InstallPlugin Dialer
  575. SetOutPath $INSTDIR\Docs\Dialer
  576. File ..\Docs\Dialer\Dialer.txt
  577. ${MementoSectionEnd}
  578. ${MementoSection} "VPatch" SecPluginsVPatch
  579. SetDetailsPrint textonly
  580. DetailPrint "Installing Plug-ins | VPatch..."
  581. SetDetailsPrint listonly
  582. SectionIn 1
  583. !insertmacro InstallPlugin VPatch
  584. SetOutPath $INSTDIR\Examples\VPatch
  585. File ..\Examples\VPatch\example.nsi
  586. File ..\Examples\VPatch\oldfile.txt
  587. File ..\Examples\VPatch\newfile.txt
  588. File ..\Examples\VPatch\patch.pat
  589. SetOutPath $INSTDIR\Docs\VPatch
  590. File ..\Docs\VPatch\Readme.html
  591. SetOutPath $INSTDIR\Bin
  592. File ..\Bin\GenPat.exe
  593. SetOutPath $INSTDIR\Include
  594. File ..\Include\VPatchLib.nsh
  595. ${MementoSectionEnd}
  596. ${MementoSectionDone}
  597. SectionGroupEnd
  598. Section -post
  599. ; When Modern UI is installed:
  600. ; * Always install the English language file
  601. ; * Always install default icons / bitmaps
  602. ${If} ${SectionIsSelected} ${SecInterfacesModernUI}
  603. SetDetailsPrint textonly
  604. DetailPrint "Configuring Modern UI..."
  605. SetDetailsPrint listonly
  606. ${If} ${SectionIsSelected} ${SecLangFiles}
  607. SetOutPath "$INSTDIR\Contrib\Language files"
  608. File "..\Contrib\Language files\English.nlf"
  609. File "..\Contrib\Language files\English.nsh"
  610. ${EndIf}
  611. ${If} ${SectionIsSelected} ${SecGraphics}
  612. SetOutPath $INSTDIR\Contrib\Graphics\Checks
  613. File "..\Contrib\Graphics\Checks\modern.bmp"
  614. SetOutPath $INSTDIR\Contrib\Graphics\Icons
  615. File "..\Contrib\Graphics\Icons\modern-install.ico"
  616. File "..\Contrib\Graphics\Icons\modern-uninstall.ico"
  617. SetOutPath $INSTDIR\Contrib\Graphics\Header
  618. File "..\Contrib\Graphics\Header\nsis.bmp"
  619. SetOutPath $INSTDIR\Contrib\Graphics\Wizard
  620. File "..\Contrib\Graphics\Wizard\win.bmp"
  621. ${EndIf}
  622. ${EndIf}
  623. SetDetailsPrint textonly
  624. DetailPrint "Creating Registry Keys..."
  625. SetDetailsPrint listonly
  626. SetOutPath $INSTDIR
  627. WriteRegStr HKLM "Software\NSIS" "" $INSTDIR
  628. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  629. WriteRegDword HKLM "Software\NSIS" "VersionMajor" "${VER_MAJOR}"
  630. WriteRegDword HKLM "Software\NSIS" "VersionMinor" "${VER_MINOR}"
  631. WriteRegDword HKLM "Software\NSIS" "VersionRevision" "${VER_REVISION}"
  632. WriteRegDword HKLM "Software\NSIS" "VersionBuild" "${VER_BUILD}"
  633. !endif
  634. WriteRegExpandStr HKLM "${REG_UNINST_KEY}" "UninstallString" '"$INSTDIR\uninst-nsis.exe"'
  635. WriteRegExpandStr HKLM "${REG_UNINST_KEY}" "InstallLocation" "$INSTDIR"
  636. WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayName" "Nullsoft Install System${NAMESUFFIX}"
  637. WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayIcon" "$INSTDIR\uninst-nsis.exe,0"
  638. WriteRegStr HKLM "${REG_UNINST_KEY}" "DisplayVersion" "${VERSION}"
  639. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  640. WriteRegDWORD HKLM "${REG_UNINST_KEY}" "VersionMajor" "${VER_MAJOR}"
  641. WriteRegDWORD HKLM "${REG_UNINST_KEY}" "VersionMinor" "${VER_MINOR}"
  642. !endif
  643. WriteRegStr HKLM "${REG_UNINST_KEY}" "URLInfoAbout" "http://nsis.sourceforge.net/"
  644. WriteRegStr HKLM "${REG_UNINST_KEY}" "HelpLink" "http://nsis.sourceforge.net/Support"
  645. WriteRegDWORD HKLM "${REG_UNINST_KEY}" "NoModify" "1"
  646. WriteRegDWORD HKLM "${REG_UNINST_KEY}" "NoRepair" "1"
  647. WriteUninstaller $INSTDIR\uninst-nsis.exe
  648. ${MementoSectionSave}
  649. SetDetailsPrint both
  650. SectionEnd
  651. ;--------------------------------
  652. ;Descriptions
  653. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  654. !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core files required to use NSIS (compiler etc.)"
  655. !insertmacro MUI_DESCRIPTION_TEXT ${SecExample} "Example installation scripts that show you how to use NSIS"
  656. !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} "Adds icons to your start menu and your desktop for easy access"
  657. !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfaces} "User interface designs that can be used to change the installer look and feel"
  658. !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesModernUI} "A modern user interface like the wizards of recent Windows versions"
  659. !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesDefaultUI} "The default NSIS user interface which you can customize to make your own UI"
  660. !insertmacro MUI_DESCRIPTION_TEXT ${SecInterfacesTinyUI} "A tiny version of the default user interface"
  661. !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} "Tools that help you with NSIS development"
  662. !insertmacro MUI_DESCRIPTION_TEXT ${SecToolsZ2E} "A utility that converts a ZIP file to a NSIS installer"
  663. !insertmacro MUI_DESCRIPTION_TEXT ${SecGraphics} "Icons, checkbox images and other graphics"
  664. !insertmacro MUI_DESCRIPTION_TEXT ${SecLangFiles} "Language files used to support multiple languages in an installer"
  665. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsPlugins} "Useful plugins that extend NSIS's functionality"
  666. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBanner} "Plugin that lets you show a banner before installation starts"
  667. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsLangDLL} "Plugin that lets you add a language select dialog to your installer"
  668. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsnsExec} "Plugin that executes console programs and prints its output in the NSIS log window or hides it"
  669. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplash} "Splash screen add-on that lets you add a splash screen to an installer"
  670. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSplashT} "Splash screen add-on with transparency support that lets you add a splash screen to an installer"
  671. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsSystem} "Plugin that lets you call Win32 API or external DLLs"
  672. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsMath} "Plugin that lets you evaluate complicated mathematical expressions"
  673. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialer} "Plugin that provides internet connection functions"
  674. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsIO} "Plugin that lets you add custom pages to an installer"
  675. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsDialogs} "Plugin that lets you add custom pages to an installer"
  676. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsStartMenu} "Plugin that lets the user select the start menu folder"
  677. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsBgImage} "Plugin that lets you show a persistent background image plugin and play sounds"
  678. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsUserInfo} "Plugin that that gives you the user name and the user account type"
  679. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsNSISDL} "Plugin that lets you create a web based installer"
  680. !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsVPatch} "Plugin that lets you create patches to upgrade older files"
  681. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  682. ;--------------------------------
  683. ;Installer Functions
  684. Function .onInit
  685. ${MementoSectionRestore}
  686. FunctionEnd
  687. !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  688. Var ReinstallPageCheck
  689. Function PageReinstall
  690. ReadRegStr $R0 HKLM "Software\NSIS" ""
  691. ReadRegStr $R1 HKLM "${REG_UNINST_KEY}" "UninstallString"
  692. ${IfThen} "$R0$R1" == "" ${|} Abort ${|}
  693. StrCpy $R4 "older"
  694. ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMajor"
  695. ReadRegDWORD $R1 HKLM "Software\NSIS" "VersionMinor"
  696. ReadRegDWORD $R2 HKLM "Software\NSIS" "VersionRevision"
  697. ReadRegDWORD $R3 HKLM "Software\NSIS" "VersionBuild"
  698. ${IfThen} $R0 = 0 ${|} StrCpy $R4 "unknown" ${|} ; Anonymous builds have no version number
  699. StrCpy $R0 $R0.$R1.$R2.$R3
  700. ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0
  701. ${If} $R0 == 0
  702. StrCpy $R1 "NSIS ${VERSION} is already installed. Select the operation you want to perform and click Next to continue."
  703. StrCpy $R2 "Add/Reinstall components"
  704. StrCpy $R3 "Uninstall NSIS"
  705. !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
  706. StrCpy $R0 "2"
  707. ${ElseIf} $R0 == 1
  708. StrCpy $R1 "An $R4 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."
  709. StrCpy $R2 "Uninstall before installing"
  710. StrCpy $R3 "Do not uninstall"
  711. !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
  712. StrCpy $R0 "1"
  713. ${ElseIf} $R0 == 2
  714. StrCpy $R1 "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."
  715. StrCpy $R2 "Uninstall before installing"
  716. StrCpy $R3 "Do not uninstall"
  717. !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
  718. StrCpy $R0 "1"
  719. ${Else}
  720. Abort
  721. ${EndIf}
  722. nsDialogs::Create 1018
  723. Pop $R4
  724. ${NSD_CreateLabel} 0 0 100% 24u $R1
  725. Pop $R1
  726. ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2
  727. Pop $R2
  728. ${NSD_OnClick} $R2 PageReinstallUpdateSelection
  729. ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3
  730. Pop $R3
  731. ${NSD_OnClick} $R3 PageReinstallUpdateSelection
  732. ${If} $ReinstallPageCheck != 2
  733. SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0
  734. ${Else}
  735. SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0
  736. ${EndIf}
  737. ${NSD_SetFocus} $R2
  738. nsDialogs::Show
  739. FunctionEnd
  740. Function PageReinstallUpdateSelection
  741. Pop $R1
  742. ${NSD_GetState} $R2 $R1
  743. ${If} $R1 == ${BST_CHECKED}
  744. StrCpy $ReinstallPageCheck 1
  745. ${Else}
  746. StrCpy $ReinstallPageCheck 2
  747. ${EndIf}
  748. FunctionEnd
  749. Function PageLeaveReinstall
  750. ${NSD_GetState} $R2 $R1
  751. StrCmp $R0 "1" 0 +2 ; Existing install is not the same version?
  752. StrCmp $R1 "1" reinst_uninstall reinst_done
  753. StrCmp $R1 "1" reinst_done ; Same version, skip to add/reinstall components?
  754. reinst_uninstall:
  755. ReadRegStr $R1 HKLM "${REG_UNINST_KEY}" "UninstallString"
  756. ;Run uninstaller
  757. HideWindow
  758. ClearErrors
  759. ExecWait '$R1 _?=$INSTDIR' $0
  760. BringToFront
  761. ${IfThen} ${Errors} ${|} StrCpy $0 2 ${|} ; ExecWait failed, set fake exit code
  762. ${If} $0 <> 0
  763. ${OrIf} ${FileExists} "$INSTDIR\Bin\makensis.exe"
  764. ${If} $0 = 1 ; User aborted uninstaller?
  765. StrCmp $R0 "2" 0 +2 ; Is the existing install the same version?
  766. Quit ; ...yes, already installed, we are done
  767. Abort
  768. ${EndIf}
  769. MessageBox MB_ICONEXCLAMATION "Unable to uninstall!"
  770. Abort
  771. ${Else}
  772. StrCpy $0 $R1 1
  773. ${IfThen} $0 == '"' ${|} StrCpy $R1 $R1 -1 1 ${|} ; Strip quotes from UninstallString
  774. Delete $R1
  775. RMDir $INSTDIR
  776. ${EndIf}
  777. reinst_done:
  778. FunctionEnd
  779. !endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  780. Function ShowReleaseNotes
  781. StrCpy $0 $WINDIR\hh.exe
  782. ${IfNotThen} ${FileExists} $0 ${|} SearchPath $0 hh.exe ${|}
  783. ${If} ${FileExists} $0
  784. Exec '"$0" mk:@MSITStore:$INSTDIR\NSIS.chm::/SectionF.1.html'
  785. ${Else}
  786. ExecShell "" "http://nsis.sourceforge.net/Docs/AppendixF.html#F.1"
  787. ${EndIf}
  788. FunctionEnd
  789. ;--------------------------------
  790. ;Uninstaller Section
  791. Section Uninstall
  792. SetDetailsPrint textonly
  793. DetailPrint "Uninstalling NSI Development Shell Extensions..."
  794. SetDetailsPrint listonly
  795. IfFileExists $INSTDIR\Bin\makensis.exe nsis_installed
  796. MessageBox MB_YESNO "It does not appear that NSIS is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?" IDYES nsis_installed
  797. Abort "Uninstall aborted by user"
  798. nsis_installed:
  799. SetDetailsPrint textonly
  800. DetailPrint "Deleting Registry Keys..."
  801. SetDetailsPrint listonly
  802. !macro AssocDeleteFileExtAndProgId _hkey _dotext _pid
  803. ReadRegStr $R0 ${_hkey} "Software\Classes\${_dotext}" ""
  804. StrCmp $R0 "${_pid}" 0 +2
  805. DeleteRegKey ${_hkey} "Software\Classes\${_dotext}"
  806. DeleteRegKey ${_hkey} "Software\Classes\${_pid}"
  807. !macroend
  808. !insertmacro AssocDeleteFileExtAndProgId HKLM ".nsi" "NSIS.Script"
  809. !insertmacro AssocDeleteFileExtAndProgId HKLM ".nsh" "NSIS.Header"
  810. System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, p0, p0)'
  811. DeleteRegKey HKLM "${REG_UNINST_KEY}"
  812. DeleteRegKey HKLM "Software\NSIS"
  813. SetDetailsPrint textonly
  814. DetailPrint "Deleting Files..."
  815. SetDetailsPrint listonly
  816. Delete "$SMPROGRAMS\NSIS${NAMESUFFIX}.lnk"
  817. Delete "$DESKTOP\NSIS${NAMESUFFIX}.lnk"
  818. Delete $INSTDIR\makensis.exe
  819. Delete $INSTDIR\makensisw.exe
  820. Delete $INSTDIR\NSIS.exe
  821. Delete $INSTDIR\NSIS.exe.manifest
  822. Delete $INSTDIR\license.txt
  823. Delete $INSTDIR\COPYING
  824. Delete $INSTDIR\uninst-nsis.exe
  825. Delete $INSTDIR\nsisconf.nsi
  826. Delete $INSTDIR\nsisconf.nsh
  827. Delete $INSTDIR\NSIS.chm
  828. RMDir /r $INSTDIR\Bin
  829. RMDir /r $INSTDIR\Contrib
  830. RMDir /r $INSTDIR\Docs
  831. RMDir /r $INSTDIR\Examples
  832. RMDir /r $INSTDIR\Include
  833. RMDir /r $INSTDIR\Menu
  834. RMDir /r $INSTDIR\Plugins
  835. RMDir /r $INSTDIR\Stubs
  836. RMDir $INSTDIR
  837. SetDetailsPrint both
  838. SectionEnd