Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

setup.nsi 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. Name Bitcoin
  2. RequestExecutionLevel highest
  3. SetCompressor /SOLID lzma
  4. # General Symbol Definitions
  5. !define REGKEY "SOFTWARE\$(^Name)"
  6. !define VERSION 0.6.99
  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.99-win32-setup.exe
  41. InstallDir $PROGRAMFILES\Bitcoin
  42. CRCCheck on
  43. XPStyle on
  44. BrandingText " "
  45. ShowInstDetails show
  46. VIProductVersion 0.6.99.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. # Remove old wxwidgets-based-bitcoin executable and locales:
  70. Delete /REBOOTOK $INSTDIR\bitcoin.exe
  71. RMDir /r /REBOOTOK $INSTDIR\locale
  72. SectionEnd
  73. Section -post SEC0001
  74. WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
  75. SetOutPath $INSTDIR
  76. WriteUninstaller $INSTDIR\uninstall.exe
  77. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  78. CreateDirectory $SMPROGRAMS\$StartMenuGroup
  79. CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin-qt.exe
  80. CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
  81. !insertmacro MUI_STARTMENU_WRITE_END
  82. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
  83. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
  84. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
  85. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
  86. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
  87. WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
  88. WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
  89. WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
  90. # bitcoin: URI handling disabled for 0.6.0
  91. # WriteRegStr HKCR "bitcoin" "URL Protocol" ""
  92. # WriteRegStr HKCR "bitcoin" "" "URL:Bitcoin"
  93. # WriteRegStr HKCR "bitcoin\DefaultIcon" "" $INSTDIR\bitcoin-qt.exe
  94. # WriteRegStr HKCR "bitcoin\shell\open\command" "" '"$INSTDIR\bitcoin-qt.exe" "$$1"'
  95. SectionEnd
  96. # Macro for selecting uninstaller sections
  97. !macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
  98. Push $R0
  99. ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
  100. StrCmp $R0 1 0 next${UNSECTION_ID}
  101. !insertmacro SelectSection "${UNSECTION_ID}"
  102. GoTo done${UNSECTION_ID}
  103. next${UNSECTION_ID}:
  104. !insertmacro UnselectSection "${UNSECTION_ID}"
  105. done${UNSECTION_ID}:
  106. Pop $R0
  107. !macroend
  108. # Uninstaller sections
  109. Section /o -un.Main UNSEC0000
  110. Delete /REBOOTOK $INSTDIR\bitcoin-qt.exe
  111. Delete /REBOOTOK $INSTDIR\license.txt
  112. Delete /REBOOTOK $INSTDIR\readme.txt
  113. RMDir /r /REBOOTOK $INSTDIR\daemon
  114. RMDir /r /REBOOTOK $INSTDIR\src
  115. DeleteRegValue HKCU "${REGKEY}\Components" Main
  116. SectionEnd
  117. Section -un.post UNSEC0001
  118. DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
  119. Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk"
  120. Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk"
  121. Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
  122. Delete /REBOOTOK $INSTDIR\uninstall.exe
  123. Delete /REBOOTOK $INSTDIR\debug.log
  124. Delete /REBOOTOK $INSTDIR\db.log
  125. DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
  126. DeleteRegValue HKCU "${REGKEY}" Path
  127. DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
  128. DeleteRegKey /IfEmpty HKCU "${REGKEY}"
  129. DeleteRegKey HKCR "bitcoin"
  130. RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
  131. RmDir /REBOOTOK $INSTDIR
  132. Push $R0
  133. StrCpy $R0 $StartMenuGroup 1
  134. StrCmp $R0 ">" no_smgroup
  135. no_smgroup:
  136. Pop $R0
  137. SectionEnd
  138. # Installer functions
  139. Function .onInit
  140. InitPluginsDir
  141. FunctionEnd
  142. # Uninstaller functions
  143. Function un.onInit
  144. ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
  145. !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
  146. !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
  147. FunctionEnd