1 # This installer requires a version of NSIS with NSISdl support (any recent one),
2 # plus the ZipDLL plugin.
3 Name "J-Ben ${version}"
4 OutFile "..\archives\${version}\J-Ben_${version}_Installer.exe"
5 InstallDir $PROGRAMFILES\J
-Ben
6 InstallDirRegKey HKLM \
7 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
10 LicenseData ..\J
-Ben\COPYING
11 LicenseForceSelection checkbox
17 UninstPage uninstConfirm
21 # I am deliberately being very specific on which files are installed
22 # and uninstalled. This allows us to easily copy/paste from the
23 # installer section to the uninstaller, ensuring we ONLY remove the files
24 # we installed. It's ugly, I know, but the script suggested to automate
25 # this is ugly enough by itself.
29 File "..\J-Ben\README"
30 File "..\J-Ben\CHANGELOG"
31 File "..\J-Ben\CREDITS"
32 File "..\J-Ben\DEDICATION"
33 File "..\J-Ben\COPYING"
34 # The following folders will always be added/removed in full,
35 # so using File /r (and RMDir /r on uninstall) is acceptable.
36 File /r
"..\J-Ben\bin"
37 File /r
"..\J-Ben\etc"
38 File /r
"..\J-Ben\kpengine_data"
39 File /r
"..\J-Ben\lib"
40 File /r
"..\J-Ben\license"
41 File /r
"..\J-Ben\share"
43 # Program Files\J-Ben\dicts
44 SetOutPath "$INSTDIR\dicts"
45 File "..\J-Ben\dicts\README"
47 # Program Files\J-Ben\sods
48 SetOutPath "$INSTDIR\sods"
49 File "..\J-Ben\sods\README"
51 # Write registry settings and make uninstaller
53 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
56 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
57 "UninstallString" "$INSTDIR\uninstall.exe"
59 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
60 "InstallLocation" "$INSTDIR"
62 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben" \
63 "DisplayIcon" "$INSTDIR\jben.exe"
64 WriteUninstaller "$INSTDIR\uninstall.exe"
67 SectionGroup
"Dictionary Files"
69 SetOutPath "$INSTDIR\dicts"
70 File "..\J-Ben\dicts\edict2.gz"
73 SetOutPath "$INSTDIR\dicts"
74 File "..\J-Ben\dicts\kanjidic.gz"
76 Section /o
"KANJIDIC2 (Download)"
77 SetOutPath "$INSTDIR\dicts"
78 NSISdl::download
http://www
.vultaire
.net
/software
/jben
/files
/dicts
/kanjidic2
.xml
.gz kanjidic2
.xml
.gz
80 StrCmp $R0 "success" +2
81 MessageBox MB_OK "The installer was unable to download KANJIDIC2. Installation will continue, but the program may not work properly."
85 SectionGroup
"Stroke Order Diagrams (Download)"
86 Section /o
"KanjiCafe.com SODs"
87 SetOutPath "$INSTDIR\sods"
88 NSISdl::download
http://www
.vultaire
.net
/software
/jben
/files
/sods
/sod
-utf8
-hex
.zip sod
-utf8
-hex
.zip
90 StrCmp $R0 "success" +3
91 MessageBox MB_OK "The installer was unable to download the KanjiCafe.com SODs. Installation will continue without them."
93 ZipDLL::extractall
"sod-utf8-hex.zip" "$INSTDIR\sods"
94 Delete "sod-utf8-hex.zip"
96 Section /o
"KanjiCafe.com Animated SODs"
97 SetOutPath "$INSTDIR\sods"
98 NSISdl::download
http://www
.vultaire
.net
/software
/jben
/files
/sods
/soda
-utf8
-hex
.zip soda
-utf8
-hex
.zip
100 StrCmp $R0 "success" +3
101 MessageBox MB_OK "The installer was unable to download the KanjiCafe.com animated SODs. Installation will continue without them."
103 ZipDLL::extractall
"soda-utf8-hex.zip" "$INSTDIR\sods"
104 Delete "soda-utf8-hex.zip"
108 Section "Documentation"
109 # Program Files\J-Ben
110 SetOutPath "$INSTDIR"
111 # The following folders will always be added/removed in full,
112 # so using File /r (and RMDir /r on uninstall) is acceptable.
113 File /r
"..\J-Ben\doc"
116 Section /o
"Source code (Download)"
117 SetOutPath "$INSTDIR\src"
118 NSISdl::download
http://www
.vultaire
.net
/software
/jben
/files
/${version}/jben
-${version}-source
.zip source
.zip
120 StrCmp $R0 "success" +3
121 MessageBox MB_OK "The installer was unable to download the J-Ben source code package. Installation will continue without it."
123 ZipDLL::extractall
"source.zip" "$INSTDIR\src"
127 SectionGroup
"Shortcuts"
128 Section "Create Start Menu Shortcuts"
129 SetOutPath "$INSTDIR\bin"
130 CreateDirectory "$SMPROGRAMS\J-Ben"
131 CreateShortcut
"$SMPROGRAMS\J-Ben\J-Ben.lnk" "$INSTDIR\bin\jben.exe"
132 CreateShortcut
"$SMPROGRAMS\J-Ben\Uninstall J-Ben.lnk" "$INSTDIR\uninstall.exe"
135 Section "Create Desktop Shortcut"
136 SetOutPath "$INSTDIR\bin"
137 CreateShortcut
"$DESKTOP\J-Ben.lnk" "$INSTDIR\bin\jben.exe"
141 Section "un.J-Ben Core"
142 # Program Files\J-Ben
143 SetOutPath "$INSTDIR"
149 RMDir /r
"$INSTDIR\bin"
150 RMDir /r
"$INSTDIR\etc"
151 RMDir /r
"$INSTDIR\kpengine_data"
152 RMDir /r
"$INSTDIR\lib"
153 RMDir /r
"$INSTDIR\license"
154 RMDir /r
"$INSTDIR\share"
156 Delete "dicts\README"
157 RMDir "$INSTDIR\dicts"
159 RMDir "$INSTDIR\sods"
161 Delete "uninstall.exe"
162 SetOutPath "$INSTDIR\.."
166 "Software\Microsoft\Windows\CurrentVersion\Uninstall\J-Ben"
169 SectionGroup
"un.Dictionaries"
171 SetOutPath "$INSTDIR"
172 Delete "dicts\edict2.gz"
173 RMDir "$INSTDIR\dicts"
174 SetOutPath "$INSTDIR\.."
177 Section "un.KANJIDIC"
178 SetOutPath "$INSTDIR"
179 Delete "dicts\kanjidic.gz"
180 RMDir "$INSTDIR\dicts"
181 SetOutPath "$INSTDIR\.."
184 Section "un.KANJIDIC2"
185 SetOutPath "$INSTDIR"
186 Delete "dicts\kanjidic2.xmlgz"
187 RMDir "$INSTDIR\dicts"
188 SetOutPath "$INSTDIR\.."
193 SectionGroup
"un.Stroke Order Diagrams"
194 Section "un.KanjiCafe.com SODs"
195 SetOutPath "$INSTDIR\sods"
196 RMDir /r
"$INSTDIR\sods\sod-utf8-hex"
197 SetOutPath "$INSTDIR"
198 RMDir "$INSTDIR\sods"
199 SetOutPath "$INSTDIR\.."
202 Section "un.KanjiCafe.com Animated SODs"
203 SetOutPath "$INSTDIR\sods"
204 RMDir /r
"$INSTDIR\sods\soda-utf8-hex"
205 SetOutPath "$INSTDIR"
206 RMDir "$INSTDIR\sods"
207 SetOutPath "$INSTDIR\.."
212 Section "un.J-Ben Documentation"
213 # Program Files\J-Ben
214 SetOutPath "$INSTDIR"
215 # The following folders will always be added/removed in full,
216 # so using File /r (and RMDir /r on uninstall) is acceptable.
217 RMDir /r
"$INSTDIR\doc"
219 SetOutPath "$INSTDIR\.."
223 Section "un.Start Menu and Desktop Shortcuts"
224 Delete "$SMPROGRAMS\J-Ben\J-Ben.lnk"
225 Delete "$SMPROGRAMS\J-Ben\Uninstall J-Ben.lnk"
226 RMDir "$SMPROGRAMS\J-Ben"
227 Delete "$DESKTOP\J-Ben.lnk"
230 Section "un.Source code"
231 SetOutPath "$INSTDIR"
232 RMDir /r
"$INSTDIR\src"
233 SetOutPath "$INSTDIR\.."