1 # Auto-generated by EclipseNSIS Script Wizard
\r
6 RequestExecutionLevel highest
\r
8 # General Symbol Definitions
\r
9 !define REGKEY "SOFTWARE\$(^Name)"
\r
10 !define VERSION 0.3.10
\r
11 !define COMPANY "Bitcoin project"
\r
12 !define URL http://www.bitcoin.org/
\r
14 # MUI Symbol Definitions
\r
15 !define MUI_ICON "src\rc\bitcoin.ico"
\r
16 !define MUI_FINISHPAGE_NOAUTOCLOSE
\r
17 !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
\r
18 !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
\r
19 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
\r
20 !define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin
\r
21 !define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin.exe
\r
22 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
\r
23 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
\r
26 !include Sections.nsh
\r
33 !insertmacro MUI_PAGE_WELCOME
\r
34 !insertmacro MUI_PAGE_DIRECTORY
\r
35 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
\r
36 !insertmacro MUI_PAGE_INSTFILES
\r
37 !insertmacro MUI_PAGE_FINISH
\r
38 !insertmacro MUI_UNPAGE_CONFIRM
\r
39 !insertmacro MUI_UNPAGE_INSTFILES
\r
41 # Installer languages
\r
42 !insertmacro MUI_LANGUAGE English
\r
44 # Installer attributes
\r
45 OutFile bitcoin-0.3.10-win32-setup.exe
\r
46 InstallDir $PROGRAMFILES\Bitcoin
\r
49 ShowInstDetails show
\r
50 VIProductVersion 0.3.10.0
\r
51 VIAddVersionKey ProductName Bitcoin
\r
52 VIAddVersionKey ProductVersion "${VERSION}"
\r
53 VIAddVersionKey CompanyName "${COMPANY}"
\r
54 VIAddVersionKey CompanyWebsite "${URL}"
\r
55 VIAddVersionKey FileVersion "${VERSION}"
\r
56 VIAddVersionKey FileDescription ""
\r
57 VIAddVersionKey LegalCopyright ""
\r
58 InstallDirRegKey HKCU "${REGKEY}" Path
\r
59 ShowUninstDetails show
\r
61 # Installer sections
\r
62 Section -Main SEC0000
\r
70 SetOutPath $INSTDIR\daemon
\r
72 SetOutPath $INSTDIR\locale
\r
74 SetOutPath $INSTDIR\src
\r
77 WriteRegStr HKCU "${REGKEY}\Components" Main 1
\r
80 Section -post SEC0001
\r
81 WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
\r
83 WriteUninstaller $INSTDIR\uninstall.exe
\r
84 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
\r
85 CreateDirectory $SMPROGRAMS\$StartMenuGroup
\r
86 CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin.exe
\r
87 CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
\r
88 !insertmacro MUI_STARTMENU_WRITE_END
\r
89 WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
\r
90 WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
\r
91 WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
\r
92 WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
\r
93 WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
\r
94 WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
\r
95 WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
\r
96 WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
\r
99 # Macro for selecting uninstaller sections
\r
100 !macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
\r
102 ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
\r
103 StrCmp $R0 1 0 next${UNSECTION_ID}
\r
104 !insertmacro SelectSection "${UNSECTION_ID}"
\r
105 GoTo done${UNSECTION_ID}
\r
106 next${UNSECTION_ID}:
\r
107 !insertmacro UnselectSection "${UNSECTION_ID}"
\r
108 done${UNSECTION_ID}:
\r
112 # Uninstaller sections
\r
113 Section /o -un.Main UNSEC0000
\r
114 Delete /REBOOTOK $INSTDIR\bitcoin.exe
\r
115 Delete /REBOOTOK $INSTDIR\libeay32.dll
\r
116 Delete /REBOOTOK $INSTDIR\mingwm10.dll
\r
117 Delete /REBOOTOK $INSTDIR\license.txt
\r
118 Delete /REBOOTOK $INSTDIR\readme.txt
\r
119 RMDir /r /REBOOTOK $INSTDIR\daemon
\r
120 RMDir /r /REBOOTOK $INSTDIR\locale
\r
121 RMDir /r /REBOOTOK $INSTDIR\src
\r
122 DeleteRegValue HKCU "${REGKEY}\Components" Main
\r
125 Section -un.post UNSEC0001
\r
126 DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
\r
127 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk"
\r
128 Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk"
\r
129 Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
\r
130 Delete /REBOOTOK $INSTDIR\uninstall.exe
\r
131 Delete /REBOOTOK $INSTDIR\debug.log
\r
132 Delete /REBOOTOK $INSTDIR\db.log
\r
133 DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
\r
134 DeleteRegValue HKCU "${REGKEY}" Path
\r
135 DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
\r
136 DeleteRegKey /IfEmpty HKCU "${REGKEY}"
\r
137 RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
\r
138 RmDir /REBOOTOK $INSTDIR
\r
140 StrCpy $R0 $StartMenuGroup 1
\r
141 StrCmp $R0 ">" no_smgroup
\r
146 # Installer functions
\r
151 # Uninstaller functions
\r
153 ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
\r
154 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
\r
155 !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
\r