summaryrefslogtreecommitdiff
path: root/nsis/sylpheed.nsi
diff options
context:
space:
mode:
authorSimeon Simeonov2018-02-26 11:23:00 +0100
committerSimeon Simeonov2018-02-26 11:23:00 +0100
commit0b3cbf57875fd692e4ba0b336fefa4bee1ed00dc (patch)
treeaf916a30553c78ce9d4f2d8658656a175c5b6921 /nsis/sylpheed.nsi
Initial commit for sylpheed 3.7.0
Diffstat (limited to 'nsis/sylpheed.nsi')
-rw-r--r--nsis/sylpheed.nsi568
1 files changed, 568 insertions, 0 deletions
diff --git a/nsis/sylpheed.nsi b/nsis/sylpheed.nsi
new file mode 100644
index 0000000..86ae32a
--- /dev/null
+++ b/nsis/sylpheed.nsi
@@ -0,0 +1,568 @@
1; Script generated by the HM NIS Edit Script Wizard.
2; Modified by Ikuya Awashiro <ikuya@fruitsbasket.info>
3; Modified by Hiroyuki Yamamoto <hiro-y@kcn.ne.jp>
4
5; This script requires NsProcess plugin:
6; http://nsis.sourceforge.net/NsProcess_plugin
7
8!include "sylpheed-defs.nsh"
9
10SetCompressor /SOLID lzma
11
12!include "nsProcess.nsh"
13!include "Memento.nsh"
14
15; MUI 1.67 compatible ------
16!include "MUI.nsh"
17!include "Sections.nsh"
18!include "LogicLib.nsh"
19
20; MUI Settings
21!define MUI_ABORTWARNING
22!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-blue.ico"
23!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-blue.ico"
24
25; Welcome page
26!insertmacro MUI_PAGE_WELCOME
27; License page
28!define MUI_LICENSEPAGE_RADIOBUTTONS
29!insertmacro MUI_PAGE_LICENSE $(license)
30; Components page
31!insertmacro MUI_PAGE_COMPONENTS
32; Directory page
33!insertmacro MUI_PAGE_DIRECTORY
34; Instfiles page
35!insertmacro MUI_PAGE_INSTFILES
36; Finish page
37;!define MUI_FINISHPAGE_RUN "$INSTDIR\sylpheed.exe"
38;!define MUI_FINISHPAGE_RUN_NOTCHECKED
39!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
40;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README-win32.txt"
41;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README-win32-ja.txt"
42!define MUI_FINISHPAGE_SHOWREADME_FUNCTION "ShowReadme"
43!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(readme)"
44!define MUI_FINISHPAGE_LINK "$(jump)"
45!define MUI_FINISHPAGE_LINK_LOCATION ${PRODUCT_WEB_SITE}
46!insertmacro MUI_PAGE_FINISH
47
48; Uninstaller pages
49!insertmacro MUI_UNPAGE_WELCOME
50!define MUI_UNCONFIRMPAGE_TEXT_TOP "$(un_confirmpage_text_top)"
51!insertmacro MUI_UNPAGE_CONFIRM
52!insertmacro MUI_UNPAGE_COMPONENTS
53!insertmacro MUI_UNPAGE_INSTFILES
54!insertmacro MUI_UNPAGE_FINISH
55
56; Language files
57!insertmacro MUI_LANGUAGE "English" # ${LANG_ENGLISH}
58!insertmacro MUI_LANGUAGE "Spanish" # ${LANG_SPANISH}
59!insertmacro MUI_LANGUAGE "Japanese" # ${LANG_JAPANESE}
60
61; Reserve files
62!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
63ReserveFile "${NSISDIR}\Plugins\nsProcess.dll"
64
65; MUI end ------
66
67!include "English.nsh"
68!include "Spanish.nsh"
69!include "Japanese.nsh"
70
71Var ISSILENT
72
73;Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
74;OutFile "${PRODUCT_NAME}-${PRODUCT_VERSION}_setup.exe"
75Name "${INST_NAME} ${INST_VERSION}"
76OutFile "${INST_FILENAME}-${INST_VERSION}_setup.exe"
77InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
78InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
79RequestExecutionLevel admin
80ShowInstDetails hide
81ShowUnInstDetails hide
82XPStyle on
83BrandingText "${INST_NAME} ${INST_VERSION}"
84
85${MementoSection} "!Sylpheed" sec_sylpheed
86 SetShellVarContext all
87 SectionIn RO
88 SetOutPath "$INSTDIR"
89 File /r "Sylpheed\"
90 CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
91
92 ${If} $LANGUAGE = "${LANG_JAPANESE}"
93 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_manual_lnk).lnk" "$INSTDIR\doc\manual\ja\Sylpheed.html"
94 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\README.lnk" "$INSTDIR\README-win32-ja.txt"
95 File /oname=README.txt "Sylpheed\README-win32-ja.txt"
96 ${ElseIf} $LANGUAGE = "${LANG_SPANISH}"
97 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_manual_lnk).lnk" "$INSTDIR\doc\manual\en\Sylpheed.html"
98 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\README.lnk" "$INSTDIR\README-win32-es.txt"
99 File /oname=README.txt "Sylpheed\README-win32-es.txt"
100 ${Else}
101 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_manual_lnk).lnk" "$INSTDIR\doc\manual\en\Sylpheed.html"
102 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\README.lnk" "$INSTDIR\README-win32.txt"
103 File /oname=README.txt "Sylpheed\README-win32.txt"
104 ${EndIf}
105
106 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Sylpheed.lnk" "$INSTDIR\sylpheed.exe"
107 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_debug_mode_lnk).lnk" "$INSTDIR\sylpheed.exe" "--debug"
108 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_safe_mode_lnk).lnk" "$INSTDIR\sylpheed.exe" "--safe-mode"
109 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_all_quit_lnk).lnk" "$INSTDIR\sylpheed.exe" "--exit"
110 WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${ORIG_WEB_SITE}"
111 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_homepage_lnk).lnk" "$INSTDIR\${PRODUCT_NAME}.url"
112 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\$(uninstall_lnk).lnk" "$INSTDIR\uninst.exe"
113${MementoSectionEnd}
114
115SectionGroup /e "$(plugins)" sec_plugins
116
117!ifdef SYLPHEED_PRO
118${MementoSection} "Sylpheed Pro" sec_sylpheed_pro
119 SetShellVarContext all
120 SetOutPath "$INSTDIR"
121 File /r "Sylpheed-Pro\"
122 WriteIniStr "$INSTDIR\${INST_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
123 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Sylpheed Pro Homepage.lnk" "$INSTDIR\${INST_NAME}.url"
124 CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Sylpheed Pro Manual.lnk" "$INSTDIR\doc\manual\sylpheed-pro\ja\search-plugin.html"
125${MementoSectionEnd}
126!endif
127
128${MementoSection} "$(attachment_tool_plugin)" sec_attachment_tool_plugin
129 SetOutPath "$INSTDIR\plugins"
130 File "plugins\plugins\attachment_tool.dll"
131 SetOutPath "$INSTDIR\doc\plugins"
132 File "plugins\doc\plugins\README.attachment_tool.txt"
133${MementoSectionEnd}
134
135!ifdef HAVE_AUTOENC_PLUGIN
136${MementoSection} "$(autoenc_plugin)" sec_autoenc_plugin
137 SetOutPath "$INSTDIR"
138 File /r "autoenc\"
139${MementoSectionEnd}
140!endif
141
142SectionGroupEnd
143
144${MementoSection} "sylfilter" sec_sylfilter
145 SetOutPath "$INSTDIR"
146 File /r "sylfilter\"
147${MementoSectionEnd}
148
149${MementoSection} "bsfilter" sec_bsfilter
150 SetOutPath "$INSTDIR"
151 File /r "bsfilter\"
152${MementoSectionEnd}
153
154${MementoSection} "$(desktop_shortcut)" sec_desktop_shortcut
155 SetShellVarContext current
156 CreateShortCut "$DESKTOP\Sylpheed.lnk" "$INSTDIR\sylpheed.exe"
157${MementoSectionEnd}
158
159${MementoUnselectedSection} "$(quick_shortcut)" sec_quick_shortcut
160 SetShellVarContext current
161 CreateShortCut "$QUICKLAUNCH\Sylpheed.lnk" "$INSTDIR\sylpheed.exe"
162${MementoSectionEnd}
163
164${MementoSection} "$(handler)" sec_handler
165 ; HKLM
166 ; .eml
167 WriteRegStr HKLM "Software\Classes\Sylpheed.EML" "" "Sylpheed Message"
168 WriteRegDWORD HKLM "Software\Classes\Sylpheed.EML" "EditFlags" 0x00000002
169 WriteRegStr HKLM "Software\Classes\Sylpheed.EML" "FriendlyTypeName" "Sylpheed Message"
170 WriteRegStr HKLM "Software\Classes\Sylpheed.EML\DefaultIcon" "" "$INSTDIR\sylpheed.exe,0"
171 WriteRegStr HKLM "Software\Classes\Sylpheed.EML\shell\open\command" "" "$\"$INSTDIR\sylpheed.exe$\" --open $\"%1$\""
172
173 ; mailto:
174 WriteRegStr HKLM "Software\Classes\mailto" "" "URL:MailTo Protocol"
175 WriteRegDWORD HKLM "Software\Classes\mailto" "EditFlags" 0x00000002
176 WriteRegStr HKLM "Software\Classes\mailto" "FriendlyTypeName" "Sylpheed MailTo"
177 WriteRegStr HKLM "Software\Classes\mailto" "URL Protocol" ""
178 WriteRegStr HKLM "Software\Classes\mailto\DefaultIcon" "" "$INSTDIR\sylpheed.exe,0"
179 WriteRegStr HKLM "Software\Classes\mailto\shell\open\command" "" "$\"$INSTDIR\sylpheed.exe$\" --compose $\"%1$\""
180
181 WriteRegStr HKLM "Software\Classes\Sylpheed.Url.MailTo" "" "URL:MailTo Protocol"
182 WriteRegDWORD HKLM "Software\Classes\Sylpheed.Url.MailTo" "EditFlags" 0x00000002
183 WriteRegStr HKLM "Software\Classes\Sylpheed.Url.MailTo" "FriendlyTypeName" "Sylpheed MailTo"
184 WriteRegStr HKLM "Software\Classes\Sylpheed.Url.MailTo" "URL Protocol" ""
185 WriteRegStr HKLM "Software\Classes\Sylpheed.Url.MailTo\DefaultIcon" "" "$INSTDIR\sylpheed.exe,0"
186 WriteRegStr HKLM "Software\Classes\Sylpheed.Url.MailTo\shell\open\command" "" "$\"$INSTDIR\sylpheed.exe$\" --compose $\"%1$\""
187
188 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed" "" "Sylpheed"
189 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\DefaultIcon" "" "$INSTDIR\sylpheed.exe,0"
190 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Protocols\mailto" "" "URL:MailTo Protocol"
191 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Protocols\mailto" "URL Protocol" ""
192 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Protocols\mailto\DefaultIcon" "" "$INSTDIR\sylpheed.exe,0"
193 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Protocols\mailto\shell\open\command" "" "$\"$INSTDIR\sylpheed.exe$\" --compose $\"%1$\""
194 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\shell\open\command" "" "$\"$INSTDIR\sylpheed.exe$\""
195
196 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Capabilities" "ApplicationName" "Sylpheed"
197 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Capabilities" "ApplicationIcon" "$INSTDIR\sylpheed.exe,0"
198 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Capabilities" "ApplicationDescription" "Sylpheed - lightweight and user-friendly e-mail client"
199 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Capabilities\FileAssociations" ".eml" "Sylpheed.EML"
200 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Capabilities\URLAssociations" "mailto" "Sylpheed.Url.MailTo"
201 WriteRegStr HKLM "Software\Clients\Mail\Sylpheed\Capabilities\StartMenu" "Mail" "Sylpheed"
202
203 WriteRegStr HKLM "Software\RegisteredApplications" "Sylpheed" "SOFTWARE\Clients\Mail\Sylpheed\Capabilities"
204
205 ; HKCU
206 WriteRegStr HKCU "Software\Clients\Mail" "" "Sylpheed"
207
208 WriteRegStr HKCU "Software\Microsoft\Windows\Shell\Associations\URLAssociations\mailto\UserChoice" "Progid" "Sylpheed.Url.MailTo"
209 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.eml\UserChoice"
210 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.eml\UserChoice" "Progid" "Sylpheed.EML"
211
212 ; .eml
213 WriteRegStr HKCU "Software\Classes\.eml" "" "Sylpheed.EML"
214
215 WriteRegStr HKCU "Software\Classes\Sylpheed.EML" "" "Sylpheed Message"
216 WriteRegDWORD HKCU "Software\Classes\Sylpheed.EML" "EditFlags" 0x00000002
217 WriteRegStr HKCU "Software\Classes\Sylpheed.EML" "FriendlyTypeName" "Sylpheed Message"
218 WriteRegStr HKCU "Software\Classes\Sylpheed.EML\DefaultIcon" "" "$INSTDIR\sylpheed.exe,0"
219 WriteRegStr HKCU "Software\Classes\Sylpheed.EML\shell\open\command" "" "$\"$INSTDIR\sylpheed.exe$\" --open $\"%1$\""
220
221 ; mailto:
222 WriteRegStr HKCU "Software\Classes\mailto" "" "URL:MailTo Protocol"
223 WriteRegDWORD HKCU "Software\Classes\mailto" "EditFlags" 0x00000002
224 WriteRegStr HKCU "Software\Classes\mailto" "FriendlyTypeName" "Sylpheed MailTo"
225 WriteRegStr HKCU "Software\Classes\mailto" "URL Protocol" ""
226 WriteRegStr HKCU "Software\Classes\mailto\DefaultIcon" "" "$INSTDIR\sylpheed.exe,0"
227 WriteRegStr HKCU "Software\Classes\mailto\shell\open\command" "" "$\"$INSTDIR\sylpheed.exe$\" --compose $\"%1$\""
228
229 WriteRegStr HKCU "Software\Classes\Sylpheed.Url.MailTo" "" "URL:MailTo Protocol"
230 WriteRegDWORD HKCU "Software\Classes\Sylpheed.Url.MailTo" "EditFlags" 0x00000002
231 WriteRegStr HKCU "Software\Classes\Sylpheed.Url.MailTo" "FriendlyTypeName" "Sylpheed MailTo"
232 WriteRegStr HKCU "Software\Classes\Sylpheed.Url.MailTo" "URL Protocol" ""
233 WriteRegStr HKCU "Software\Classes\Sylpheed.Url.MailTo\DefaultIcon" "" "$INSTDIR\sylpheed.exe,0"
234 WriteRegStr HKCU "Software\Classes\Sylpheed.Url.MailTo\shell\open\command" "" "$\"$INSTDIR\sylpheed.exe$\" --compose $\"%1$\""
235${MementoSectionEnd}
236
237${MementoSectionDone}
238
239Section -Post
240 WriteUninstaller "$INSTDIR\uninst.exe"
241 WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\sylpheed.exe"
242 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
243 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
244 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\sylpheed.exe"
245 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
246 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
247 WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
248SectionEnd
249
250Section "!un.Sylpheed" sec_un_sylpheed
251 SetShellVarContext all
252 Delete "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_manual_lnk).lnk"
253 Delete "$SMPROGRAMS\${PRODUCT_NAME}\README.lnk"
254 Delete "$SMPROGRAMS\${PRODUCT_NAME}\Sylpheed.lnk"
255 Delete "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_debug_mode_lnk).lnk"
256 Delete "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_safe_mode_lnk).lnk"
257 Delete "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_all_quit_lnk).lnk"
258 Delete "$SMPROGRAMS\${PRODUCT_NAME}\$(sylpheed_homepage_lnk).lnk"
259 Delete "$SMPROGRAMS\${PRODUCT_NAME}\$(uninstall_lnk).lnk"
260 SetShellVarContext current
261
262 Delete "$INSTDIR\curl.exe"
263 Delete "$INSTDIR\gpgme-w32spawn.exe"
264 Delete "$INSTDIR\gspawn-win32-helper-console.exe"
265 Delete "$INSTDIR\gspawn-win32-helper.exe"
266 Delete "$INSTDIR\iconv.dll"
267 Delete "$INSTDIR\intl.dll"
268 Delete "$INSTDIR\jpeg62.dll"
269 Delete "$INSTDIR\libasprintf-0.dll"
270 Delete "$INSTDIR\libassuan-0.dll"
271 Delete "$INSTDIR\libatk-1.0-0.dll"
272 Delete "$INSTDIR\libcairo-2.dll"
273 Delete "$INSTDIR\libcompface.dll"
274 Delete "$INSTDIR\libeay32.dll"
275 Delete "$INSTDIR\libffi-6.dll"
276 Delete "$INSTDIR\libgdk-win32-2.0-0.dll"
277 Delete "$INSTDIR\libgdk_pixbuf-2.0-0.dll"
278 Delete "$INSTDIR\libgio-2.0-0.dll"
279 Delete "$INSTDIR\libglib-2.0-0.dll"
280 Delete "$INSTDIR\libgmodule-2.0-0.dll"
281 Delete "$INSTDIR\libgobject-2.0-0.dll"
282 Delete "$INSTDIR\libgpg-error-0.dll"
283 Delete "$INSTDIR\libgpgme-11.dll"
284 Delete "$INSTDIR\libgthread-2.0-0.dll"
285 Delete "$INSTDIR\libgtk-win32-2.0-0.dll"
286 Delete "$INSTDIR\libonig.dll"
287 Delete "$INSTDIR\libpango-1.0-0.dll"
288 Delete "$INSTDIR\libpangocairo-1.0-0.dll"
289 Delete "$INSTDIR\libpangowin32-1.0-0.dll"
290 Delete "$INSTDIR\libpng14-14.dll"
291 Delete "$INSTDIR\libsylph-0-1.dll"
292 Delete "$INSTDIR\libsylpheed-plugin-0-1.dll"
293 Delete "$INSTDIR\ssleay32.dll"
294 Delete "$INSTDIR\sylpheed.exe"
295 Delete "$INSTDIR\wabread.exe"
296 Delete "$INSTDIR\zlib1.dll"
297
298 Delete "$INSTDIR\README-win32-es.txt"
299 Delete "$INSTDIR\README-win32-ja.txt"
300 Delete "$INSTDIR\README-win32.txt"
301 Delete "$INSTDIR\README.txt"
302
303 Delete "$INSTDIR\sample-sylpheed.ini"
304
305 Delete "$INSTDIR\sylpheed-128x128.png"
306 Delete "$INSTDIR\sylpheed-64x64.png"
307 Delete "$INSTDIR\sylpheed-mailto-protocol_admin.reg"
308 Delete "$INSTDIR\sylpheed-mailto-protocol_user.reg"
309 Delete "$INSTDIR\sylpheed.png"
310 Delete "$INSTDIR\${PRODUCT_NAME}.url"
311
312 Delete "$INSTDIR\plugin-updater.exe"
313 Delete "$INSTDIR\update-manager.exe"
314 Delete "$INSTDIR\uninst.exe"
315
316 RMDir /r "$INSTDIR\doc"
317 RMDir /r "$INSTDIR\etc"
318 RMDir /r "$INSTDIR\lib"
319 RMDir /r "$INSTDIR\share\locale"
320 RMDir /r "$INSTDIR\share\themes"
321 RMDir "$INSTDIR\share"
322SectionEnd
323
324SectionGroup /e "un.$(plugins)" sec_un_plugins
325
326!ifdef SYLPHEED_PRO
327Section "un.Sylpheed Pro" sec_un_sylpheed_pro
328 SetShellVarContext all
329 Delete "$SMPROGRAMS\${PRODUCT_NAME}\Sylpheed Pro Homepage.lnk"
330 Delete "$SMPROGRAMS\${PRODUCT_NAME}\Sylpheed Pro Manual.lnk"
331 SetShellVarContext current
332
333 ; Sylpheed Pro components
334 Delete "$INSTDIR\bzip2.dll"
335 Delete "$INSTDIR\dbimport-ext.exe"
336 Delete "$INSTDIR\dts-indexer.exe"
337 Delete "$INSTDIR\libarchive2.dll"
338 Delete "$INSTDIR\libmecab.dll"
339 Delete "$INSTDIR\libpq.dll"
340 Delete "$INSTDIR\mecabrc"
341 Delete "$INSTDIR\Sylpheed Pro.url"
342 Delete "$INSTDIR\plugins\dbimport.dll"
343 Delete "$INSTDIR\plugins\scheduler.dll"
344 RMDir /r "$INSTDIR\dic"
345 RMDir /r "$INSTDIR\pgsql"
346 RMDir /r "$INSTDIR\pgsql83"
347 RMDir /r "$INSTDIR\share\sylpheed-pro"
348 RMDir "$INSTDIR\share"
349SectionEnd
350!endif
351
352Section "un.$(attachment_tool_plugin)" sec_un_attachment_tool_plugin
353 Delete "$INSTDIR\plugins\attachment_tool.dll"
354 Delete "$INSTDIR\doc\plugins\README.attachment_tool.txt"
355SectionEnd
356
357!ifdef HAVE_AUTOENC_PLUGIN
358Section "un.$(autoenc_plugin)" sec_un_autoenc_plugin
359 Delete "$INSTDIR\plugins\autoenc.dll"
360 Delete "$INSTDIR\doc\autoenc\COPYING.txt"
361 Delete "$INSTDIR\doc\autoenc\README.autoenc.txt"
362 Delete "$INSTDIR\doc\autoenc\LICENSE.7-zip.txt"
363 RMDir "$INSTDIR\doc\autoenc"
364 Delete "$INSTDIR\7z.dll"
365 Delete "$INSTDIR\7z.exe"
366SectionEnd
367!endif
368
369SectionGroupEnd
370
371Section "un.sylfilter" sec_un_sylfilter
372 ; sylfilter components
373 Delete "$INSTDIR\sylfilter.exe"
374 Delete "$INSTDIR\sylfilter-cui.exe"
375SectionEnd
376
377Section "un.bsfilter" sec_un_bsfilter
378 ; bsfilter components
379 Delete "$INSTDIR\bsfilter"
380 Delete "$INSTDIR\bsfilterw.exe"
381SectionEnd
382
383Section "un.$(desktop_shortcut)" sec_un_desktop_shortcut
384 SetShellVarContext current
385 Delete "$DESKTOP\Sylpheed.lnk"
386SectionEnd
387
388Section "un.$(quick_shortcut)" sec_un_quick_shortcut
389 SetShellVarContext current
390 Delete "$QUICKLAUNCH\Sylpheed.lnk"
391SectionEnd
392
393Section "-un.install"
394 SetShellVarContext all
395 RMDir "$SMPROGRAMS\Sylpheed"
396 SetShellVarContext current
397
398 ; remove plug-ins dir only when empty
399 RMDir "$INSTDIR\plugins"
400 RMDir "$INSTDIR"
401
402 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
403 DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_DIR_REGKEY}"
404 DeleteRegKey HKLM "Software\Classes\Sylpheed.EML"
405 DeleteRegKey HKLM "Software\Classes\Sylpheed.Url.MailTo"
406 DeleteRegKey HKLM "Software\Clients\Mail\Sylpheed"
407 DeleteRegValue HKLM "Software\RegisteredApplications" "Sylpheed"
408 DeleteRegKey HKCU "Software\Classes\Sylpheed.EML"
409 DeleteRegKey HKCU "Software\Classes\Sylpheed.Url.MailTo"
410 DeleteRegKey ${MEMENTO_REGISTRY_ROOT} "${MEMENTO_REGISTRY_KEY}"
411
412 SetAutoClose true
413SectionEnd
414
415; Section descriptions
416!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
417 !insertmacro MUI_DESCRIPTION_TEXT ${sec_sylpheed} "$(sylpheed_description)"
418 !insertmacro MUI_DESCRIPTION_TEXT ${sec_plugins} "$(plugins_description)"
419!ifdef SYLPHEED_PRO
420 !insertmacro MUI_DESCRIPTION_TEXT ${sec_sylpheed_pro} "$(sylpheed_pro_description)"
421!endif
422 !insertmacro MUI_DESCRIPTION_TEXT ${sec_attachment_tool_plugin} "$(attachment_tool_plugin_description)"
423!ifdef HAVE_AUTOENC_PLUGIN
424 !insertmacro MUI_DESCRIPTION_TEXT ${sec_autoenc_plugin} "$(autoenc_plugin_description)"
425!endif
426 !insertmacro MUI_DESCRIPTION_TEXT ${sec_sylfilter} "$(sylfilter_description)"
427 !insertmacro MUI_DESCRIPTION_TEXT ${sec_bsfilter} "$(bsfilter_description)"
428 !insertmacro MUI_DESCRIPTION_TEXT ${sec_desktop_shortcut} "$(desktop_shortcut_description)"
429 !insertmacro MUI_DESCRIPTION_TEXT ${sec_quick_shortcut} "$(quick_shortcut_description)"
430 !insertmacro MUI_DESCRIPTION_TEXT ${sec_handler} "$(handler_description)"
431!insertmacro MUI_FUNCTION_DESCRIPTION_END
432!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
433 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_sylpheed} "$(un_sylpheed_description)"
434 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_plugins} "$(un_plugins_description)"
435!ifdef SYLPHEED_PRO
436 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_sylpheed_pro} "$(un_sylpheed_pro_description)"
437!endif
438 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_attachment_tool_plugin} "$(un_attachment_tool_plugin_description)"
439!ifdef HAVE_AUTOENC_PLUGIN
440 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_autoenc_plugin} "$(un_autoenc_plugin_description)"
441!endif
442 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_sylfilter} "$(un_sylfilter_description)"
443 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_bsfilter} "$(un_bsfilter_description)"
444 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_desktop_shortcut} "$(un_desktop_shortcut_description)"
445 !insertmacro MUI_DESCRIPTION_TEXT ${sec_un_quick_shortcut} "$(un_quick_shortcut_description)"
446 ; handler is not uninstallable.
447!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
448
449Function .onInit
450 ${MementoSectionRestore}
451
452 StrCpy $1 ${sec_sylpheed}
453
454; Prevent install while Sylpheed is running
455check_app_running:
456 ${nsProcess::FindProcess} "sylpheed.exe" $R0
457 StrCmp $R0 "0" 0 +3
458 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(app_running)" IDOK check_app_running
459 Abort
460
461; Auto-uninstall old before installing new
462; http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new
463 ReadRegStr $R0 HKLM \
464 "${PRODUCT_UNINST_KEY}" "UninstallString"
465 StrCmp $R0 "" done_
466
467 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
468 "$(delete_caution)" \
469 /SD IDOK \
470 IDOK uninst
471 Abort
472
473;Run the uninstaller
474uninst:
475 ClearErrors
476 StrCpy $ISSILENT "/S"
477 IfSilent +2
478 StrCpy $ISSILENT ""
479 ExecWait '$R0 $ISSILENT _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
480
481 IfErrors no_remove_uninstaller done_
482 no_remove_uninstaller:
483 Abort
484
485; label "done" used in MementoSectionRestore
486done_:
487FunctionEnd
488
489Function .onInstSuccess
490 ${MementoSectionSave}
491FunctionEnd
492
493Function .onSelChange
494 !insertmacro StartRadioButtons $1
495 !insertmacro RadioButton ${sec_sylpheed}
496 !insertmacro EndRadioButtons
497FunctionEnd
498
499Function un.onInit
500check_app_running:
501 ; Prevent uninstall while Sylpheed is running
502 ${nsProcess::FindProcess} "sylpheed.exe" $R0
503 StrCmp $R0 "0" 0 +3
504 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(app_running_uninst)" IDOK check_app_running
505 Abort
506
507 ${nsProcess::KillProcess} "sylpheed.exe" $R0
508 ${nsProcess::KillProcess} "dts-indexer.exe" $R0
509 ${nsProcess::KillProcess} "postgres.exe" $R0
510
511 SetShellVarContext current
512
513 IfFileExists "$INSTDIR\sylpheed.exe" sylpheed_file_exists
514 !insertmacro UnselectSection ${sec_un_sylpheed}
515 sylpheed_file_exists:
516 !insertmacro SetSectionFlag ${sec_un_sylpheed} ${SF_RO}
517
518!ifdef SYLPHEED_PRO
519 IfFileExists "$INSTDIR\plugins\dbimport.dll" sylpheed_pro_file_exists
520 !insertmacro UnselectSection ${sec_un_sylpheed_pro}
521 !insertmacro SetSectionFlag ${sec_un_sylpheed_pro} ${SF_RO}
522 sylpheed_pro_file_exists:
523!endif
524
525 IfFileExists "$INSTDIR\plugins\attachment_tool.dll" attachment_tool_plugin_file_exists
526 !insertmacro UnselectSection ${sec_un_attachment_tool_plugin}
527 !insertmacro SetSectionFlag ${sec_un_attachment_tool_plugin} ${SF_RO}
528 attachment_tool_plugin_file_exists:
529
530!ifdef HAVE_AUTOENC_PLUGIN
531 IfFileExists "$INSTDIR\plugins\autoenc.dll" autoenc_plugin_file_exists
532 !insertmacro UnselectSection ${sec_un_autoenc_plugin}
533 !insertmacro SetSectionFlag ${sec_un_autoenc_plugin} ${SF_RO}
534 autoenc_plugin_file_exists:
535!endif
536
537 IfFileExists "$INSTDIR\sylfilter.exe" sylfilter_file_exists
538 !insertmacro UnselectSection ${sec_un_sylfilter}
539 !insertmacro SetSectionFlag ${sec_un_sylfilter} ${SF_RO}
540 sylfilter_file_exists:
541
542 IfFileExists "$INSTDIR\bsfilter" bsfilter_file_exists
543 !insertmacro UnselectSection ${sec_un_bsfilter}
544 !insertmacro SetSectionFlag ${sec_un_bsfilter} ${SF_RO}
545 bsfilter_file_exists:
546
547 SetShellVarContext current
548 IfFileExists "$DESKTOP\Sylpheed.lnk" desktop_shortcut_file_exists
549 !insertmacro UnselectSection ${sec_un_desktop_shortcut}
550 !insertmacro SetSectionFlag ${sec_un_desktop_shortcut} ${SF_RO}
551 desktop_shortcut_file_exists:
552
553 SetShellVarContext current
554 IfFileExists "$QUICKLAUNCH\Sylpheed.lnk" quick_shortcut_file_exists
555 !insertmacro UnselectSection ${sec_un_quick_shortcut}
556 !insertmacro SetSectionFlag ${sec_un_quick_shortcut} ${SF_RO}
557 quick_shortcut_file_exists:
558FunctionEnd
559
560Function ShowReadme
561 ExecShell open "$INSTDIR\README.txt"
562!ifdef SYLPHEED_PRO
563 ${If} $LANGUAGE = "${LANG_JAPANESE}"
564 IfFileExists "$INSTDIR\doc\manual\sylpheed-pro\ja\search-plugin.html" 0 +2
565 ExecShell open "$INSTDIR\doc\manual\sylpheed-pro\ja\search-plugin.html"
566 ${EndIf}
567!endif
568FunctionEnd