You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

setup.nsi 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. Name Bitcoin
  2. RequestExecutionLevel highest
  3. SetCompressor /SOLID lzma
  4. # General Symbol Definitions
  5. !define REGKEY "SOFTWARE\$(^Name)"
  6. !define VERSION 0.6.0
  7. !define COMPANY "Bitcoin project"
  8. !define URL http://www.bitcoin.org/
  9. # MUI Symbol Definitions
  10. !define MUI_ICON "../share/pixmaps/bitcoin.ico"
  11. !define MUI_WELCOMEFINISHPAGE_BITMAP "../share/pixmaps/nsis-wizard.bmp"
  12. !define MUI_HEADERIMAGE
  13. !define MUI_HEADERIMAGE_RIGHT
  14. !define MUI_HEADERIMAGE_BITMAP "../share/pixmaps/nsis-header.bmp"
  15. !define MUI_FINISHPAGE_NOAUTOCLOSE
  16. !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
  17. !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
  18. !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
  19. !define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin
  20. !define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin-qt.exe
  21. !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
  22. !define MUI_UNWELCOMEFINISHPAGE_BITMAP "../share/pixmaps/nsis-wizard.bmp"
  23. !define MUI_UNFINISHPAGE_NOAUTOCLOSE
  24. # Included files
  25. !include Sections.nsh
  26. !include MUI2.nsh
  27. # Variables
  28. Var StartMenuGroup
  29. # Installer pages
  30. !insertmacro MUI_PAGE_WELCOME
  31. !insertmacro MUI_PAGE_DIRECTORY
  32. !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
  33. !insertmacro MUI_PAGE_INSTFILES
  34. !insertmacro MUI_PAGE_FINISH
  35. !insertmacro MUI_UNPAGE_CONFIRM
  36. !insertmacro MUI_UNPAGE_INSTFILES
  37. # Installer languages
  38. !insertmacro MUI_LANGUAGE English
  39. # Installer attributes
  40. OutFile bitcoin-0.6.0-win32-setup.exe
  41. InstallDir $PROGRAMFILES\Bitcoin
  42. CRCCheck on
  43. XPStyle on
  44. BrandingText " "
  45. ShowInstDetails show
  46. VIProductVersion 0.6.0.0
  47. VIAddVersionKey ProductName Bitcoin
  48. VIAddVersionKey ProductVersion "${VERSION}"
  49. VIAddVersionKey CompanyName "${COMPANY}"
  50. VIAddVersionKey CompanyWebsite "${URL}"
  51. VIAddVersionKey FileVersion "${VERSION}"
  52. VIAddVersionKey FileDescription ""
  53. VIAddVersionKey LegalCopyright ""
  54. InstallDirRegKey HKCU "${REGKEY}" Path
  55. ShowUninstDetails show
  56. # Installer sections
  57. Section -Main SEC0000
  58. SetOutPath $INSTDIR
  59. SetOverwrite on
  60. File ../release/bitcoin-qt.exe
  61. File /oname=license.txt ../COPYING
  62. File /oname=readme.txt ../doc/README_windows.txt
  63. SetOutPath $INSTDIR\daemon
  64. File ../src/bitcoind.exe
  65. SetOutPath $INSTDIR\src
  66. File /r /x *.exe /x *.o ../src\*.*
  67. SetOutPath $INSTDIR
  68. WriteRegStr HKCU "${REGKEY}\Components" Main 1
  69. SectionEnd
  70. Section -post SEC0001
  71. WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
  72. SetOutPath $INSTDIR
  73. WriteUninstaller $INSTDIR\uninstall.exe
  74. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  75. CreateDirectory $SMPROGRAMS\$StartMenuGroup
  76. CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin-qt.exe
  77. CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
  78. !insertmacro MUI_STARTMENU_WRITE_END
  79. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
  80. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
  81. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
  82. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
  83. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
  84. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
  85. WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
  86. WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
  87. # bitcoin: URI handling disabled for 0.6.0
  88. # WriteRegStr HKCR "bitcoin" "URL Protocol" ""
  89. # WriteRegStr HKCR "bitcoin" "" "URL:Bitcoin"
  90. # WriteRegStr HKCR "bitcoin\DefaultIcon" "" $INSTDIR\bitcoin-qt.exe
  91. # WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "$$1"'
  92. SectionEnd
  93. # Macro for selecting uninstaller sections
  94. !macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
  95. Push $R0
  96. ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
  97. StrCmp $R0 1 0 next${UNSECTION_ID}
  98. !insertmacro SelectSection "${UNSECTION_ID}"
  99. GoTo done${UNSECTION_ID}
  100. next${UNSECTION_ID}:
  101. !insertmacro UnselectSection "${UNSECTION_ID}"
  102. done${UNSECTION_ID}:
  103. Pop $R0
  104. !macroend
  105. # Uninstaller sections
  106. Section /o -un.Main UNSEC0000
  107. Delete /REBOOTOK $INSTDIR\bitcoin-qt.exe
  108. Delete /REBOOTOK $INSTDIR\license.txt
  109. Delete /REBOOTOK $INSTDIR\readme.txt
  110. RMDir /r /REBOOTOK $INSTDIR\daemon
  111. RMDir /r /REBOOTOK $INSTDIR\src
  112. DeleteRegValue HKCU "${REGKEY}\Components" Main
  113. SectionEnd
  114. Section -un.post UNSEC0001
  115. DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
  116. Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk"
  117. Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk"
  118. Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
  119. Delete /REBOOTOK $INSTDIR\uninstall.exe
  120. Delete /REBOOTOK $INSTDIR\debug.log
  121. Delete /REBOOTOK $INSTDIR\db.log
  122. DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
  123. DeleteRegValue HKCU "${REGKEY}" Path
  124. DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
  125. DeleteRegKey /IfEmpty HKCU "${REGKEY}"
  126. DeleteRegKey HKCR "bitcoin"
  127. RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
  128. RmDir /REBOOTOK $INSTDIR
  129. Push $R0
  130. StrCpy $R0 $StartMenuGroup 1
  131. StrCmp $R0 ">" no_smgroup
  132. no_smgroup:
  133. Pop $R0
  134. SectionEnd
  135. # Installer functions
  136. Function .onInit
  137. InitPluginsDir
  138. FunctionEnd
  139. # Uninstaller functions
  140. Function un.onInit
  141. ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
  142. !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
  143. !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
  144. FunctionEnd