Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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