2008-09-30 Colin Leroy <colin@colino.net>
[gpg4win.git] / src / inst-sections.nsi
1 # inst-sections.nsi - Installer for GPG4Win sections.  -*- coding: latin-1; -*-
2 # Copyright (C) 2005, 2006, 2007, 2008 g10 Code GmbH
3
4 # This file is part of GPG4Win.
5
6 # GPG4Win is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10
11 # GPG4Win is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 # USA.
20
21
22 # Sections
23
24 !include "inst-gpg4win.nsi"
25
26 # The order of installation must be the same as the build order.  You
27 # can use tsort on the info in configure.ac, or just check out
28 # gpg4win_build_list in config.nsi.  The order determines also the
29 # order in the packages selection dialog.
30
31 !ifdef HAVE_PKG_ADNS
32 !include "inst-adns.nsi"
33 !endif
34 !ifdef HAVE_PKG_BZIP2
35 !include "inst-bzip2.nsi"
36 !endif
37 !ifdef HAVE_PKG_CRYPT
38 !include "inst-crypt.nsi"
39 !endif
40 !ifdef HAVE_PKG_JPEG
41 !include "inst-jpeg.nsi"
42 !endif
43 !ifdef HAVE_PKG_KDESUPPORT
44 !include "inst-kdesupport.nsi"
45 !endif
46 !ifdef HAVE_PKG_LIBGSASL
47 !include "inst-libgsasl.nsi"
48 !endif
49 !ifdef HAVE_PKG_LIBICONV
50 !include "inst-libiconv.nsi"
51 !endif
52 !ifdef HAVE_PKG_LIBTASN1
53 !include "inst-libtasn1.nsi"
54 !endif
55 !ifdef HAVE_PKG_OXYGEN_ICONS
56 !include "inst-oxygen-icons.nsi"
57 !endif
58 !ifdef HAVE_PKG_PKGCONFIG
59 !include "inst-pkgconfig.nsi"
60 !endif
61 !ifdef HAVE_PKG_PTHREADS_W32
62 !include "inst-pthreads-w32.nsi"
63 !endif
64 !ifdef HAVE_PKG_REGEX
65 !include "inst-regex.nsi"
66 !endif
67 !ifdef HAVE_PKG_W32PTH
68 !include "inst-w32pth.nsi"
69 !endif
70 !ifdef HAVE_PKG_ZLIB
71 !include "inst-zlib.nsi"
72 !endif
73 !ifdef HAVE_PKG_QT
74 !include "inst-qt.nsi"
75 !endif
76 !ifdef HAVE_PKG_GETTEXT
77 !include "inst-gettext.nsi"
78 !endif
79 !ifdef HAVE_PKG_LIBPNG
80 !include "inst-libpng.nsi"
81 !endif
82 !ifdef HAVE_PKG_LIBETPAN
83 !include "inst-libetpan.nsi"
84 !endif
85 !ifdef HAVE_PKG_LIBASSUAN
86 !include "inst-libassuan.nsi"
87 !endif
88 !ifdef HAVE_PKG_KDELIBS
89 !include "inst-kdelibs.nsi"
90 !endif
91 !ifdef HAVE_PKG_LIBGPG_ERROR
92 !include "inst-libgpg-error.nsi"
93 !endif
94 !ifdef HAVE_PKG_GLIB
95 !include "inst-glib.nsi"
96 !endif
97 !ifdef HAVE_PKG_LIBKSBA
98 !include "inst-libksba.nsi"
99 !endif
100 !ifdef HAVE_PKG_LIBGCRYPT
101 !include "inst-libgcrypt.nsi"
102 !endif
103 !ifdef HAVE_PKG_CAIRO
104 !include "inst-cairo.nsi"
105 !endif
106 !ifdef HAVE_PKG_PANGO
107 !include "inst-pango.nsi"
108 !endif
109 !ifdef HAVE_PKG_ATK
110 !include "inst-atk.nsi"
111 !endif
112 !ifdef HAVE_PKG_OPENCDK
113 !include "inst-opencdk.nsi"
114 !endif
115 !ifdef HAVE_PKG_DIRMNGR
116 !include "inst-dirmngr.nsi"
117 !endif
118 !ifdef HAVE_PKG_GTK_
119 !include "inst-gtk+.nsi"
120 !endif
121 !ifdef HAVE_PKG_GNUTLS
122 !include "inst-gnutls.nsi"
123 !endif
124 !ifdef HAVE_PKG_CURL
125 !include "inst-curl.nsi"
126 !endif
127 !ifdef HAVE_PKG_LIBXML2
128 !include "inst-libxml2.nsi"
129 !endif
130 !ifdef HAVE_PKG_PINENTRY
131 !include "inst-pinentry.nsi"
132 !endif
133 !ifdef HAVE_PKG_GNUPG2
134 !include "inst-gnupg2.nsi"
135 !endif
136 !ifdef HAVE_PKG_GPGME
137 !include "inst-gpgme.nsi"
138 !endif
139
140 # These are displayed in the selection dialog.
141
142 !ifdef HAVE_PKG_KLEOPATRA
143 !include "inst-kleopatra.nsi"
144 !endif
145 !ifdef HAVE_PKG_GPA
146 !include "inst-gpa.nsi"
147 !endif
148 !ifdef HAVE_PKG_WINPT
149 !include "inst-winpt.nsi"
150 !endif
151 !ifdef HAVE_PKG_GPGOL
152 !include "inst-gpgol.nsi"
153 !endif
154 !ifdef HAVE_PKG_GPGEX
155 !include "inst-gpgex.nsi"
156 !endif
157 !ifdef HAVE_PKG_SCUTE
158 !include "inst-scute.nsi"
159 !endif
160 !ifdef HAVE_PKG_CLAWS_MAIL
161 !include "inst-claws-mail.nsi"
162 !endif
163 !ifdef HAVE_PKG_NOTIFICATION_PLUGIN
164 !include "inst-notification_plugin.nsi"
165 !endif
166 !ifdef HAVE_PKG_GTKHTML2_VIEWER
167 !include "inst-gtkhtml2_viewer.nsi"
168 !endif
169 !ifdef HAVE_PKG_VCALENDAR
170 !include "inst-vcalendar.nsi"
171 !endif
172 !ifdef HAVE_PKG_RSSYL
173 !include "inst-rssyl.nsi"
174 !endif
175 !ifdef HAVE_PKG_TNEF_PARSE
176 !include "inst-tnef_parse.nsi"
177 !endif
178 #!ifdef HAVE_PKG_EUDORAGPG
179 #!include "inst-eudoragpg.nsi"
180 #!endif
181 !ifdef HAVE_PKG_COMPENDIUM_DE
182 !include "inst-compendium_de.nsi"
183 !endif
184 !ifdef HAVE_PKG_MAN_NOVICE_EN
185 !include "inst-man_novice_en.nsi"
186 !endif
187 !ifdef HAVE_PKG_MAN_ADVANCED_EN
188 !include "inst-man_advanced_en.nsi"
189 !endif
190 !ifdef HAVE_PKG_MAN_NOVICE_DE
191 !include "inst-man_novice_de.nsi"
192 !endif
193 !ifdef HAVE_PKG_MAN_ADVANCED_DE
194 !include "inst-man_advanced_de.nsi"
195 !endif
196
197 !include "inst-final.nsi"
198
199 # We have to invoke the uninstallers in reverse order!
200
201 !ifdef HAVE_PKG_MAN_ADVANCED_DE
202 !include "uninst-man_advanced_de.nsi"
203 !endif
204 !ifdef HAVE_PKG_MAN_NOVICE_DE
205 !include "uninst-man_novice_de.nsi"
206 !endif
207 !ifdef HAVE_PKG_MAN_ADVANCED_EN
208 !include "uninst-man_advanced_en.nsi"
209 !endif
210 !ifdef HAVE_PKG_MAN_NOVICE_EN
211 !include "uninst-man_novice_en.nsi"
212 !endif
213 !ifdef HAVE_PKG_COMPENDIUM_DE
214 !include "uninst-compendium_de.nsi"
215 !endif
216 #!ifdef HAVE_PKG_EUDORAGPG
217 #!include "uninst-eudoragpg.nsi"
218 #!endif
219 !ifdef HAVE_PKG_CLAWS_MAIL
220 !include "uninst-claws-mail.nsi"
221 !endif
222 !ifdef HAVE_PKG_NOTIFICATION_PLUGIN
223 !include "uninst-notification_plugin.nsi"
224 !endif
225 !ifdef HAVE_PKG_GTKHTML2_VIEWER
226 !include "uninst-gtkhtml2_viewer.nsi"
227 !endif
228 !ifdef HAVE_PKG_VCALENDAR
229 !include "uninst-vcalendar.nsi"
230 !endif
231 !ifdef HAVE_PKG_RSSYL
232 !include "uninst-rssyl.nsi"
233 !endif
234 !ifdef HAVE_PKG_TNEF_PARSE
235 !include "uninst-tnef_parse.nsi"
236 !endif
237 !ifdef HAVE_PKG_SCUTE
238 !include "uninst-scute.nsi"
239 !endif
240 !ifdef HAVE_PKG_GPGEX
241 !include "uninst-gpgex.nsi"
242 !endif
243 !ifdef HAVE_PKG_GPGOL
244 !include "uninst-gpgol.nsi"
245 !endif
246 !ifdef HAVE_PKG_WINPT
247 !include "uninst-winpt.nsi"
248 !endif
249 !ifdef HAVE_PKG_GPA
250 !include "uninst-gpa.nsi"
251 !endif
252 !ifdef HAVE_PKG_KLEOPATRA
253 !include "uninst-kleopatra.nsi"
254 !endif
255
256 !ifdef HAVE_PKG_GPGME
257 !include "uninst-gpgme.nsi"
258 !endif
259 !ifdef HAVE_PKG_GNUPG2
260 !include "uninst-gnupg2.nsi"
261 !endif
262 !ifdef HAVE_PKG_PINENTRY
263 !include "uninst-pinentry.nsi"
264 !endif
265 !ifdef HAVE_PKG_GNUTLS
266 !include "uninst-gnutls.nsi"
267 !endif
268 !ifdef HAVE_PKG_CURL
269 !include "uninst-curl.nsi"
270 !endif
271 !ifdef HAVE_PKG_LIBXML2
272 !include "uninst-libxml2.nsi"
273 !endif
274 !ifdef HAVE_PKG_GTK_
275 !include "uninst-gtk+.nsi"
276 !endif
277 !ifdef HAVE_PKG_DIRMNGR
278 !include "uninst-dirmngr.nsi"
279 !endif
280 !ifdef HAVE_PKG_OPENCDK
281 !include "uninst-opencdk.nsi"
282 !endif
283 !ifdef HAVE_PKG_ATK
284 !include "uninst-atk.nsi"
285 !endif
286 !ifdef HAVE_PKG_PANGO
287 !include "uninst-pango.nsi"
288 !endif
289 !ifdef HAVE_PKG_CAIRO
290 !include "uninst-cairo.nsi"
291 !endif
292 !ifdef HAVE_PKG_LIBGCRYPT
293 !include "uninst-libgcrypt.nsi"
294 !endif
295 !ifdef HAVE_PKG_LIBKSBA
296 !include "uninst-libksba.nsi"
297 !endif
298 !ifdef HAVE_PKG_GLIB
299 !include "uninst-glib.nsi"
300 !endif
301 !ifdef HAVE_PKG_LIBGPG_ERROR
302 !include "uninst-libgpg-error.nsi"
303 !endif
304 !ifdef HAVE_PKG_KDELIBS
305 !include "uninst-kdelibs.nsi"
306 !endif
307 !ifdef HAVE_PKG_LIBASSUAN
308 !include "uninst-libassuan.nsi"
309 !endif
310 !ifdef HAVE_PKG_LIBETPAN
311 !include "uninst-libetpan.nsi"
312 !endif
313 !ifdef HAVE_PKG_LIBPNG
314 !include "uninst-libpng.nsi"
315 !endif
316 !ifdef HAVE_PKG_GETTEXT
317 !include "uninst-gettext.nsi"
318 !endif
319 !ifdef HAVE_PKG_QT
320 !include "uninst-qt.nsi"
321 !endif
322 !ifdef HAVE_PKG_ZLIB
323 !include "uninst-zlib.nsi"
324 !endif
325 !ifdef HAVE_PKG_W32PTH
326 !include "uninst-w32pth.nsi"
327 !endif
328 !ifdef HAVE_PKG_REGEX
329 !include "uninst-regex.nsi"
330 !endif
331 !ifdef HAVE_PKG_PTHREADS_W32
332 !include "uninst-pthreads-w32.nsi"
333 !endif
334 !ifdef HAVE_PKG_PKGCONFIG
335 !include "uninst-pkgconfig.nsi"
336 !endif
337 !ifdef HAVE_PKG_OXYGEN_ICONS
338 !include "uninst-oxygen-icons.nsi"
339 !endif
340 !ifdef HAVE_PKG_MAN_ADVANCED_DE
341 !include "uninst-man_advanced_de.nsi"
342 !endif
343 !ifdef HAVE_PKG_MAN_NOVICE_DE
344 !include "uninst-man_novice_de.nsi"
345 !endif
346 !ifdef HAVE_PKG_MAN_ADVANCED_EN
347 !include "uninst-man_advanced_en.nsi"
348 !endif
349 !ifdef HAVE_PKG_MAN_NOVICE_EN
350 !include "uninst-man_novice_en.nsi"
351 !endif
352 !ifdef HAVE_PKG_LIBTASN1
353 !include "uninst-libtasn1.nsi"
354 !endif
355 !ifdef HAVE_PKG_LIBICONV
356 !include "uninst-libiconv.nsi"
357 !endif
358 !ifdef HAVE_PKG_LIBGSASL
359 !include "uninst-libgsasl.nsi"
360 !endif
361 !ifdef HAVE_PKG_KDESUPPORT
362 !include "uninst-kdesupport.nsi"
363 !endif
364 !ifdef HAVE_PKG_JPEG
365 !include "uninst-jpeg.nsi"
366 !endif
367 !ifdef HAVE_PKG_CRYPT
368 !include "uninst-crypt.nsi"
369 !endif
370 !ifdef HAVE_PKG_BZIP2
371 !include "uninst-bzip2.nsi"
372 !endif
373 !ifdef HAVE_PKG_ADNS
374 !include "uninst-adns.nsi"
375 !endif
376
377 !include "uninst-gpg4win.nsi"
378
379
380 # Dependency Management
381
382 ${MementoSectionDone}
383
384 !include "Sections.nsh"
385
386
387 Function CalcDefaults
388
389 # The defaults for the installer-options.ini file.
390 g4wihelp::config_fetch_bool "inst_start_menu"
391 StrCmp $R0 "" +2
392 !insertmacro MUI_INSTALLOPTIONS_WRITE "installer-options.ini" \
393         "Field 2" "State" $R0
394
395 g4wihelp::config_fetch_bool "inst_desktop"
396 StrCmp $R0 "" +2
397 !insertmacro MUI_INSTALLOPTIONS_WRITE "installer-options.ini" \
398         "Field 3" "State" $R0
399
400 g4wihelp::config_fetch_bool "inst_quick_launch_bar"
401 StrCmp $R0 "" +2
402 !insertmacro MUI_INSTALLOPTIONS_WRITE "installer-options.ini" \
403         "Field 4" "State" $R0
404
405
406
407 !ifdef HAVE_PKG_KLEOPATRA
408   g4wihelp::config_fetch_bool "inst_kleopatra"
409   StrCmp $R0 "1" 0 calc_defaults_kleopatra_not_one
410    !insertmacro SelectSection ${SEC_kleopatra}
411    Goto calc_defaults_kleopatra_done
412   calc_defaults_kleopatra_not_one:
413   StrCmp $R0 "0" 0 calc_defaults_kleopatra_done
414    !insertmacro UnselectSection ${SEC_kleopatra}
415 calc_defaults_kleopatra_done:
416 !endif
417
418 !ifdef HAVE_PKG_GPGOL
419   g4wihelp::config_fetch_bool "inst_gpgol"
420   StrCmp $R0 "1" 0 calc_defaults_gpgol_not_one
421    !insertmacro SelectSection ${SEC_gpgol}
422    Goto calc_defaults_gpgol_done
423   calc_defaults_gpgol_not_one:
424   StrCmp $R0 "0" 0 calc_defaults_gpgol_done
425    !insertmacro UnselectSection ${SEC_gpgol}
426 calc_defaults_gpgol_done:
427 !endif
428
429 !ifdef HAVE_PKG_GPGEX
430   g4wihelp::config_fetch_bool "inst_gpgex"
431   StrCmp $R0 "1" 0 calc_defaults_gpgex_not_one
432    !insertmacro SelectSection ${SEC_gpgex}
433    Goto calc_defaults_gpgex_done
434   calc_defaults_gpgex_not_one:
435   StrCmp $R0 "0" 0 calc_defaults_gpgex_done
436    !insertmacro UnselectSection ${SEC_gpgex}
437 calc_defaults_gpgex_done:
438 !endif
439
440 !ifdef HAVE_PKG_SCUTE
441   g4wihelp::config_fetch_bool "inst_scute"
442   StrCmp $R0 "1" 0 calc_defaults_scute_not_one
443    !insertmacro SelectSection ${SEC_scute}
444    Goto calc_defaults_scute_done
445   calc_defaults_scute_not_one:
446   StrCmp $R0 "0" 0 calc_defaults_scute_done
447    !insertmacro UnselectSection ${SEC_scute}
448 calc_defaults_scute_done:
449 !endif
450
451 !ifdef HAVE_PKG_GPA
452   g4wihelp::config_fetch_bool "inst_gpa"
453   StrCmp $R0 "1" 0 calc_defaults_gpa_not_one
454    !insertmacro SelectSection ${SEC_gpa}
455    Goto calc_defaults_gpa_done
456   calc_defaults_gpa_not_one:
457   StrCmp $R0 "0" 0 calc_defaults_gpa_done
458    !insertmacro UnselectSection ${SEC_gpa}
459 calc_defaults_gpa_done:
460 !endif
461
462 !ifdef HAVE_PKG_WINPT
463   g4wihelp::config_fetch_bool "inst_winpt"
464   StrCmp $R0 "1" 0 calc_defaults_winpt_not_one
465    !insertmacro SelectSection ${SEC_winpt}
466    Goto calc_defaults_winpt_done
467   calc_defaults_winpt_not_one:
468   StrCmp $R0 "0" 0 calc_defaults_winpt_done
469    !insertmacro UnselectSection ${SEC_winpt}
470 calc_defaults_winpt_done:
471 !endif
472
473 !ifdef HAVE_PKG_CLAWS_MAIL
474   g4wihelp::config_fetch_bool "inst_claws_mail"
475   StrCmp $R0 "1" 0 calc_defaults_claws_mail_not_one
476    !insertmacro SelectSection ${SEC_claws_mail}
477    Goto calc_defaults_claws_mail_done
478   calc_defaults_claws_mail_not_one:
479   StrCmp $R0 "0" 0 calc_defaults_claws_mail_done
480    !insertmacro UnselectSection ${SEC_claws_mail}
481 calc_defaults_claws_mail_done:
482 !endif
483
484 !ifdef HAVE_PKG_COMPENDIUM_DE
485   g4wihelp::config_fetch_bool "inst_compendium_de"
486   StrCmp $R0 "1" 0 calc_defaults_compendium_de_not_one
487    !insertmacro SelectSection ${SEC_compendium_de}
488    Goto calc_defaults_compendium_de_done
489   calc_defaults_compendium_de_not_one:
490   StrCmp $R0 "0" 0 calc_defaults_compendium_de_done
491    !insertmacro UnselectSection ${SEC_compendium_de}
492 calc_defaults_compendium_de_done:
493 !endif
494
495 !ifdef HAVE_PKG_MAN_NOVICE_DE
496   g4wihelp::config_fetch_bool "inst_man_novice_de"
497   StrCmp $R0 "1" 0 calc_defaults_man_novice_de_not_one
498    !insertmacro SelectSection ${SEC_man_novice_de}
499    Goto calc_defaults_man_novice_de_done
500   calc_defaults_man_novice_de_not_one:
501   StrCmp $R0 "0" 0 calc_defaults_man_novice_de_done
502    !insertmacro UnselectSection ${SEC_man_novice_de}
503 calc_defaults_man_novice_de_done:
504 !endif
505
506 !ifdef HAVE_PKG_MAN_NOVICE_EN
507   g4wihelp::config_fetch_bool "inst_man_novice_en"
508   StrCmp $R0 "1" 0 calc_defaults_man_novice_en_not_one
509    !insertmacro SelectSection ${SEC_man_novice_en}
510    Goto calc_defaults_man_novice_en_done
511   calc_defaults_man_novice_en_not_one:
512   StrCmp $R0 "0" 0 calc_defaults_man_novice_en_done
513    !insertmacro UnselectSection ${SEC_man_novice_en}
514 calc_defaults_man_novice_en_done:
515 !endif
516
517 !ifdef HAVE_PKG_MAN_ADVANCED_DE
518   g4wihelp::config_fetch_bool "inst_man_advanced_de"
519   StrCmp $R0 "1" 0 calc_defaults_man_advanced_de_not_one
520    !insertmacro SelectSection ${SEC_man_advanced_de}
521    Goto calc_defaults_man_advanced_de_done
522   calc_defaults_man_advanced_de_not_one:
523   StrCmp $R0 "0" 0 calc_defaults_man_advanced_de_done
524    !insertmacro UnselectSection ${SEC_man_advanced_de}
525 calc_defaults_man_advanced_de_done:
526 !endif
527
528 !ifdef HAVE_PKG_MAN_ADVANCED_EN
529   g4wihelp::config_fetch_bool "inst_man_advanced_en"
530   StrCmp $R0 "1" 0 calc_defaults_man_advanced_en_not_one
531    !insertmacro SelectSection ${SEC_man_advanced_en}
532    Goto calc_defaults_man_advanced_en_done
533   calc_defaults_man_advanced_en_not_one:
534   StrCmp $R0 "0" 0 calc_defaults_man_advanced_en_done
535    !insertmacro UnselectSection ${SEC_man_advanced_en}
536 calc_defaults_man_advanced_en_done:
537 !endif
538
539 FunctionEnd
540
541
542 Function CalcDepends
543   # This section could very well be autogenerated from the
544   # information in configure.ac.  Note that it doesn't hurt to have
545   # stuff here for packages that we don't include.
546
547   # First clear all indirect dependencies.
548 !ifdef HAVE_PKG_LIBICONV
549   !insertmacro UnselectSection ${SEC_libiconv}
550 !endif
551 !ifdef HAVE_PKG_GETTEXT
552   !insertmacro UnselectSection ${SEC_gettext}
553 !endif
554 !ifdef HAVE_PKG_ZLIB
555   !insertmacro UnselectSection ${SEC_zlib}
556 !endif
557 !ifdef HAVE_PKG_CRYPT
558   !insertmacro UnselectSection ${SEC_crypt}
559 !endif
560 !ifdef HAVE_PKG_REGEX
561   !insertmacro UnselectSection ${SEC_regex}
562 !endif
563 !ifdef HAVE_PKG_DIRMNGR
564   !insertmacro UnselectSection ${SEC_dirmngr}
565 !endif
566 !ifdef HAVE_PKG_PTHREADS_W32
567   !insertmacro UnselectSection ${SEC_pthreads_w32}
568 !endif
569 !ifdef HAVE_PKG_LIBPNG
570   !insertmacro UnselectSection ${SEC_libpng}
571 !endif
572 !ifdef HAVE_PKG_JPEG
573   !insertmacro UnselectSection ${SEC_jpeg}
574 !endif
575 !ifdef HAVE_PKG_PKGCONFIG
576   !insertmacro UnselectSection ${SEC_pkgconfig}
577 !endif
578 !ifdef HAVE_PKG_GLIB
579   !insertmacro UnselectSection ${SEC_glib}
580 !endif
581 !ifdef HAVE_PKG_ATK
582   !insertmacro UnselectSection ${SEC_atk}
583 !endif
584 !ifdef HAVE_PKG_CAIRO
585   !insertmacro UnselectSection ${SEC_cairo}
586 !endif
587 !ifdef HAVE_PKG_PANGO
588   !insertmacro UnselectSection ${SEC_pango}
589 !endif
590 !ifdef HAVE_PKG_GTK_
591   !insertmacro UnselectSection ${SEC_gtk_}
592 !endif
593 !ifdef HAVE_PKG_LIBGSASL
594   !insertmacro UnselectSection ${SEC_libgsasl}
595 !endif
596 !ifdef HAVE_PKG_LIBTASN1
597   !insertmacro UnselectSection ${SEC_libtasn1}
598 !endif
599 !ifdef HAVE_PKG_OPENCDK
600   !insertmacro UnselectSection ${SEC_opencdk}
601 !endif
602 !ifdef HAVE_PKG_GNUTLS
603   !insertmacro UnselectSection ${SEC_gnutls}
604 !endif
605 !ifdef HAVE_PKG_CURL
606   !insertmacro UnselectSection ${SEC_curl}
607 !endif
608 !ifdef HAVE_PKG_LIBXML2
609   !insertmacro UnselectSection ${SEC_libxml2}
610 !endif
611 !ifdef HAVE_PKG_LIBGPG_ERROR
612   !insertmacro UnselectSection ${SEC_libgpg_error}
613 !endif
614 !ifdef HAVE_PKG_GPGME
615   !insertmacro UnselectSection ${SEC_gpgme}
616 !endif
617 !ifdef HAVE_PKG_LIBKSBA
618   !insertmacro UnselectSection ${SEC_libksba}
619 !endif
620 !ifdef HAVE_PKG_W32PTH
621   !insertmacro UnselectSection ${SEC_w32pth}
622 !endif
623 !ifdef HAVE_PKG_LIBASSUAN
624   !insertmacro UnselectSection ${SEC_libassuan}
625 !endif
626 !ifdef HAVE_PKG_LIBGCRYPT
627   !insertmacro UnselectSection ${SEC_libgcrypt}
628 !endif
629 !ifdef HAVE_PKG_ADNS
630   !insertmacro UnselectSection ${SEC_adns}
631 !endif
632 !ifdef HAVE_PKG_PINENTRY
633   !insertmacro UnselectSection ${SEC_pinentry}
634 !endif
635 !ifdef HAVE_PKG_KDESUPPORT
636   !insertmacro UnselectSection ${SEC_kdesupport}
637 !endif
638 !ifdef HAVE_PKG_QT
639   !insertmacro UnselectSection ${SEC_qt}
640 !endif
641 !ifdef HAVE_PKG_OXYGEN_ICONS
642   !insertmacro UnselectSection ${SEC_oxygen_icons}
643 !endif
644 !ifdef HAVE_PKG_KDELIBS
645   !insertmacro UnselectSection ${SEC_kdelibs}
646 !endif
647
648   # Always install gnupg2.  This is also ensured by putting
649   # these packages in the RO section and enabling them by default, but
650   # it doesn't harm to add it explicitely here as well.
651
652   !insertmacro SelectSection ${SEC_gnupg2}
653
654   # Then enable all dependencies in reverse build list order!
655
656 !ifdef HAVE_PKG_GPGOL
657   !insertmacro SectionFlagIsSet ${SEC_gpgol} \
658                 ${SF_SELECTED} have_gpgol skip_gpgol
659   have_gpgol:
660   !insertmacro SelectSection ${SEC_gpgme}
661   !insertmacro SelectSection ${SEC_kleopatra}
662   skip_gpgol:
663 !endif
664
665 !ifdef HAVE_PKG_GPGEX
666   !insertmacro SectionFlagIsSet ${SEC_gpgex} \
667                 ${SF_SELECTED} have_gpgex skip_gpgex
668   have_gpgex:
669   !insertmacro SelectSection ${SEC_kleopatra}
670   skip_gpgex:
671 !endif
672
673 !ifdef HAVE_PKG_SCUTE
674   !insertmacro SectionFlagIsSet ${SEC_scute} \
675                 ${SF_SELECTED} have_scute skip_scute
676   have_scute:
677   # All dependencies are linked in statically.
678   skip_scute:
679 !endif
680
681 !ifdef HAVE_PKG_KLEOPATRA
682   !insertmacro SectionFlagIsSet ${SEC_kleopatra} ${SF_SELECTED} have_kleopatra skip_kleopatra
683   have_kleopatra:
684   !insertmacro SelectSection ${SEC_gpgme}
685   # This drags in all the other KDE and Qt stuff.
686   !insertmacro SelectSection ${SEC_kdelibs}
687   skip_kleopatra:
688 !endif
689
690 !ifdef HAVE_PKG_GNUPG2
691   !insertmacro SectionFlagIsSet ${SEC_gnupg2} ${SF_SELECTED} have_gnupg2 skip_gnupg2
692   have_gnupg2:
693   !insertmacro SelectSection ${SEC_libiconv}
694   !insertmacro SelectSection ${SEC_libgcrypt}
695   !insertmacro SelectSection ${SEC_libksba}
696   !insertmacro SelectSection ${SEC_libassuan}
697   !insertmacro SelectSection ${SEC_libgpg_error}
698   !insertmacro SelectSection ${SEC_w32pth}
699   !insertmacro SelectSection ${SEC_zlib}
700   !insertmacro SelectSection ${SEC_adns}
701   !insertmacro SelectSection ${SEC_pinentry}
702   !insertmacro SelectSection ${SEC_dirmngr}
703   # Because we need pinentry, we also need to install GTK+
704   !insertmacro SelectSection ${SEC_zlib}
705   !insertmacro SelectSection ${SEC_gtk_}
706   !insertmacro SelectSection ${SEC_libpng}
707   !insertmacro SelectSection ${SEC_glib}
708   skip_gnupg2:
709 !endif
710
711 !ifdef HAVE_PKG_WINPT
712   !insertmacro SectionFlagIsSet ${SEC_winpt} ${SF_SELECTED} have_winpt skip_winpt
713   have_winpt:
714   !insertmacro SelectSection ${SEC_gpgme}
715   skip_winpt:
716 !endif
717
718 !ifdef HAVE_PKG_GPA
719   !insertmacro SectionFlagIsSet ${SEC_gpa} ${SF_SELECTED} have_gpa skip_gpa
720   have_gpa:
721   !insertmacro SelectSection ${SEC_zlib}
722   !insertmacro SelectSection ${SEC_gtk_}
723   !insertmacro SelectSection ${SEC_libpng}
724   !insertmacro SelectSection ${SEC_glib}
725   !insertmacro SelectSection ${SEC_gpgme}
726   skip_gpa:
727 !endif
728
729 !ifdef HAVE_PKG_CLAWS_MAIL
730   !insertmacro SectionFlagIsSet ${SEC_claws_mail} ${SF_SELECTED} have_claws_mail skip_claws_mail
731   have_claws_mail:
732   !insertmacro SelectSection ${SEC_zlib}
733   !insertmacro SelectSection ${SEC_gtk_}
734   !insertmacro SelectSection ${SEC_libpng}
735   !insertmacro SelectSection ${SEC_jpeg}
736   !insertmacro SelectSection ${SEC_glib}
737   !insertmacro SelectSection ${SEC_gpgme}
738   !insertmacro SelectSection ${SEC_pthreads_w32}
739   !insertmacro SelectSection ${SEC_crypt}
740   !insertmacro SelectSection ${SEC_regex}
741   !insertmacro SelectSection ${SEC_libetpan}
742   !insertmacro SelectSection ${SEC_gnutls}
743   !insertmacro SelectSection ${SEC_curl}
744   !insertmacro SelectSection ${SEC_libxml2}
745   skip_claws_mail:
746 !endif
747
748 !ifdef HAVE_PKG_GNUTLS
749   !insertmacro SectionFlagIsSet ${SEC_gnutls} ${SF_SELECTED} have_gnutls skip_gnutls
750   have_gnutls:
751   !insertmacro SelectSection ${SEC_zlib}
752   !insertmacro SelectSection ${SEC_libgcrypt}
753   !insertmacro SelectSection ${SEC_libgsasl}
754   !insertmacro SelectSection ${SEC_libtasn1}
755   !insertmacro SelectSection ${SEC_opencdk}
756   skip_gnutls:
757 !endif
758
759 !ifdef HAVE_PKG_CURL
760   !insertmacro SectionFlagIsSet ${SEC_curl} ${SF_SELECTED} have_curl skip_curl
761   have_curl:
762   !insertmacro SelectSection ${SEC_zlib}
763   !insertmacro SelectSection ${SEC_gnutls}
764   skip_curl:
765 !endif
766
767 !ifdef HAVE_PKG_LIBXML2
768   !insertmacro SectionFlagIsSet ${SEC_libxml2} ${SF_SELECTED} have_libxml2 skip_libxml2
769   have_libxml2:
770   !insertmacro SelectSection ${SEC_zlib}
771   skip_libxml2:
772 !endif
773
774 !ifdef HAVE_PKG_OPENCDK
775   !insertmacro SectionFlagIsSet ${SEC_opencdk} ${SF_SELECTED} have_opencdk skip_opencdk
776   have_opencdk:
777   !insertmacro SelectSection ${SEC_libgcrypt}
778   !insertmacro SelectSection ${SEC_libgpg_error}
779   skip_opencdk:
780 !endif
781
782 !ifdef HAVE_PKG_GTK_
783   !insertmacro SectionFlagIsSet ${SEC_gtk_} \
784                 ${SF_SELECTED} have_gtk_ skip_gtk_
785   have_gtk_:
786   !insertmacro SelectSection ${SEC_atk}
787   !insertmacro SelectSection ${SEC_cairo}
788   !insertmacro SelectSection ${SEC_pango}
789   !insertmacro SelectSection ${SEC_glib}
790   !insertmacro SelectSection ${SEC_libiconv}
791   !insertmacro SelectSection ${SEC_gettext}
792   !insertmacro SelectSection ${SEC_pkgconfig}
793   skip_gtk_:
794 !endif
795
796 !ifdef HAVE_PKG_ATK
797   !insertmacro SectionFlagIsSet ${SEC_atk} \
798                 ${SF_SELECTED} have_atk skip_atk
799   have_atk:
800   !insertmacro SelectSection ${SEC_glib}
801   !insertmacro SelectSection ${SEC_pkgconfig}
802   skip_atk:
803 !endif
804
805 !ifdef HAVE_PKG_CAIRO
806   !insertmacro SectionFlagIsSet ${SEC_cairo} \
807                 ${SF_SELECTED} have_cairo skip_cairo
808   have_cairo:
809   !insertmacro SelectSection ${SEC_glib}
810   !insertmacro SelectSection ${SEC_pkgconfig}
811   skip_cairo:
812 !endif
813
814 !ifdef HAVE_PKG_PANGO
815   !insertmacro SectionFlagIsSet ${SEC_pango} \
816                 ${SF_SELECTED} have_pango skip_pango
817   have_pango:
818   !insertmacro SelectSection ${SEC_glib}
819   !insertmacro SelectSection ${SEC_pkgconfig}
820   skip_pango:
821 !endif
822
823 !ifdef HAVE_PKG_LIBPNG
824   !insertmacro SectionFlagIsSet ${SEC_libpng} \
825                 ${SF_SELECTED} have_libpng skip_libpng
826   have_libpng:
827   !insertmacro SelectSection ${SEC_pkgconfig}
828   skip_libpng:
829 !endif
830
831 !ifdef HAVE_PKG_DIRMNGR
832   !insertmacro SectionFlagIsSet ${SEC_dirmngr} ${SF_SELECTED} have_dirmngr skip_dirmngr
833   have_dirmngr:
834   !insertmacro SelectSection ${SEC_libgcrypt}
835   !insertmacro SelectSection ${SEC_libksba}
836   !insertmacro SelectSection ${SEC_libassuan}
837   !insertmacro SelectSection ${SEC_libgpg_error}
838   !insertmacro SelectSection ${SEC_w32pth}
839   skip_dirmngr:
840 !endif
841
842 !ifdef HAVE_PKG_GLIB
843   !insertmacro SectionFlagIsSet ${SEC_glib} \
844                 ${SF_SELECTED} have_glib skip_glib
845   have_glib:
846   !insertmacro SelectSection ${SEC_pkgconfig}
847   skip_glib:
848 !endif
849
850 !ifdef HAVE_PKG_GETTEXT
851   !insertmacro SectionFlagIsSet ${SEC_gettext} \
852                 ${SF_SELECTED} have_gettext skip_gettext
853   have_gettext:
854   !insertmacro SelectSection ${SEC_libiconv}
855   skip_gettext:
856 !endif
857
858 !ifdef HAVE_PKG_GPGME
859   !insertmacro SectionFlagIsSet ${SEC_gpgme} \
860                 ${SF_SELECTED} have_gpgme skip_gpgme
861   have_gpgme:
862   # GPGME does not depend on gnupg2.  Do this in the
863   # actual application instead.
864   !insertmacro SelectSection ${SEC_libgpg_error}
865 !ifdef HAVE_PKG_QT
866   !insertmacro SelectSection ${SEC_qt}
867 !endif  
868    skip_gpgme:
869 !endif
870
871 !ifdef HAVE_PKG_LIBGCRYPT
872   !insertmacro SectionFlagIsSet ${SEC_libgcrypt} ${SF_SELECTED} have_libgcrypt skip_libgcrypt
873   have_libgcrypt:
874   !insertmacro SelectSection ${SEC_libgpg_error}
875   skip_libgcrypt:
876 !endif
877
878   # Package "zlib" has no dependencies.
879   # Package "pkgconfig" has no dependencies.
880   # Package "libgpg-error" has no dependencies.
881   # Package "libiconv" has no dependencies.
882
883 !ifdef HAVE_PKG_KDELIBS
884   !insertmacro SectionFlagIsSet ${SEC_kdelibs} \
885                 ${SF_SELECTED} have_kdelibs skip_kdelibs
886   have_kdelibs:
887   !insertmacro SelectSection ${SEC_qt}
888   !insertmacro SelectSection ${SEC_oxygen_icons}
889    skip_kdelibs:
890 !endif
891
892 !ifdef HAVE_PKG_QT
893   !insertmacro SectionFlagIsSet ${SEC_qt} \
894                 ${SF_SELECTED} have_qt skip_qt
895   have_qt:
896   !insertmacro SelectSection ${SEC_kdesupport}
897   skip_qt:
898 !endif
899
900   # Package "kdesupport" has no dependencies.
901   # Package "oxygen-icons" has no dependencies.
902
903 FunctionEnd
904
905
906 Function .onInit
907   Call G4wRunOnce
908
909   SetOutPath $TEMP
910 !ifdef SOURCES
911   File /oname=gpgspltmp.bmp "${TOP_SRCDIR}/doc/logo/gpg4win-logo-400px.bmp"
912   # We play the tune only for the source installer
913   File /oname=gpgspltmp.wav "${TOP_SRCDIR}/src/gpg4win-splash.wav"
914   g4wihelp::playsound $TEMP\gpgspltmp.wav
915   g4wihelp::showsplash 2500 $TEMP\gpgspltmp.bmp
916
917   Delete $TEMP\gpgspltmp.bmp
918   # Note that we delete gpgspltmp.wav in .onInst{Failed,Success}
919 !endif
920
921   # Enable this to force a language selection dialog on every run (the
922   # preferred language is the default).  Otherwise, the preferred
923   # language is stored in the registry, and the installer does not ask
924   # on upgrades.
925 !ifdef DEBUG
926 !define MUI_LANGDLL_ALWAYSSHOW
927 !endif
928   !insertmacro MUI_LANGDLL_DISPLAY
929
930   # We can't use TOP_SRCDIR dir as the name of the file needs to be
931   # the same while building and running the installer.  Thus we
932   # generate the file from a template.
933   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "installer-options.ini"
934
935   ${MementoSectionRestore}
936   Call CalcDefaults
937   Call CalcDepends
938   Call CheckOtherGnuPGApps
939 FunctionEnd
940
941
942 Function un.onInit
943   # Remove the language preference.
944   !insertmacro MUI_UNGETLANGUAGE
945 FunctionEnd
946
947
948 Function .onInstFailed
949   Delete $TEMP\gpgspltmp.wav
950 FunctionEnd
951
952 Function .onInstSuccess
953   ${MementoSectionSave}
954   Delete $TEMP\gpgspltmp.wav
955 FunctionEnd
956
957 Function .onSelChange
958   Call CalcDepends
959 FunctionEnd
960
961
962 # Note used anymore:
963 # This function is run from the finish page.
964 #Function RunOnFinish
965 #!ifdef HAVE_PKG_GPA
966 #    SectionGetFlags ${SEC_gpa} $R0 
967 #    IntOp $R0 $R0 & ${SF_SELECTED} 
968 #    IntCmp $R0 ${SF_SELECTED} 0 no_gpa_avail
969 #       Exec "$INSTDIR\gpa.exe"
970 #       Return
971 #   no_gpa_avail:
972 #!endif
973 #!ifdef HAVE_PKG_WINPT
974 #    SectionGetFlags ${SEC_winpt} $R0 
975 #    IntOp $R0 $R0 & ${SF_SELECTED} 
976 #    IntCmp $R0 ${SF_SELECTED} 0 no_winpt_avail
977 #       Exec "$INSTDIR\WinPT.exe --keymanager"
978 #       Return
979 #   no_winpt_avail:
980 #!endif
981 #  MessageBox MB_OK "$(T_NoKeyManager)"
982 #FunctionEnd
983
984
985 # This must be in a central place.  Urgs.
986
987 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
988 !ifdef HAVE_PKG_GNUPG2
989   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gnupg2} $(DESC_SEC_gnupg2)
990 !endif
991 !ifdef HAVE_PKG_GPGOL
992   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gpgol} $(DESC_SEC_gpgol)
993 !endif
994 !ifdef HAVE_PKG_GPGEX
995   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gpgex} $(DESC_SEC_gpgex)
996 !endif
997 !ifdef HAVE_PKG_SCUTE
998   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_scute} $(DESC_SEC_scute)
999 !endif
1000 !ifdef HAVE_PKG_GPA
1001   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gpa} $(DESC_SEC_gpa)
1002 !endif
1003 !ifdef HAVE_PKG_WINPT
1004   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_winpt} $(DESC_SEC_winpt)
1005 !endif
1006 !ifdef HAVE_PKG_CLAWS_MAIL
1007   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_claws_mail} $(DESC_SEC_claws_mail)
1008 !endif
1009 #!ifdef HAVE_PKG_EUDORAGPG
1010 #  !insertmacro MUI_DESCRIPTION_TEXT ${SEC_eudoragpg} $(DESC_SEC_eudoragpg)
1011 #!endif
1012 !ifdef HAVE_PKG_KLEOPATRA
1013   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_kleopatra} $(DESC_SEC_kleopatra)
1014 !endif
1015 !ifdef HAVE_PKG_MAN_NOVICE_EN
1016   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_man_novice_en} $(DESC_SEC_man_novice_en)
1017 !endif
1018 !ifdef HAVE_PKG_MAN_ADVANCED_EN
1019   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_man_advanced_en} $(DESC_SEC_man_advanced_en)
1020 !endif
1021 !ifdef HAVE_PKG_COMPENDIUM_DE
1022   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_compendium_de} $(DESC_SEC_compendium_de)
1023 !endif
1024 !ifdef HAVE_PKG_MAN_NOVICE_DE
1025   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_man_novice_de} $(DESC_SEC_man_novice_de)
1026 !endif
1027 !ifdef HAVE_PKG_MAN_ADVANCED_DE
1028   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_man_advanced_de} $(DESC_SEC_man_advanced_de)
1029 !endif
1030 !insertmacro MUI_FUNCTION_DESCRIPTION_END
1031
1032
1033 # This also must be in a central place.  Also Urgs.
1034
1035 Section "-startmenu"
1036
1037 !ifdef HAVE_STARTMENU
1038   # Make sure that the context of the automatic variables has been set to
1039   # the "all users" shell folder.  This guarantees that the menu gets written
1040   # for all users.  We have already checked that we are running as Admin; or
1041   # we printed a warning that installation will not succeed.
1042   SetShellVarContext all
1043
1044   # Check if the start menu entries where requested.
1045   !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
1046         "Field 2" "State"
1047   IntCmp $R0 0 no_start_menu
1048
1049 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
1050     # Delete the old stuff.
1051     Delete "$SMPROGRAMS\$STARTMENU_FOLDER\*.lnk"
1052
1053     CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
1054     CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)"
1055
1056 !ifdef HAVE_PKG_WINPT
1057     SectionGetFlags ${SEC_winpt} $R0 
1058     IntOp $R0 $R0 & ${SF_SELECTED} 
1059     IntCmp $R0 ${SF_SELECTED} 0 no_winpt_menu 
1060     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\WinPT.lnk" \
1061         "$INSTDIR\WinPT.exe" \
1062         "" "$INSTDIR\WinPT.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_winpt)
1063    no_winpt_menu:
1064 !endif
1065
1066 !ifdef HAVE_PKG_GPA
1067     SectionGetFlags ${SEC_gpa} $R0 
1068     IntOp $R0 $R0 & ${SF_SELECTED} 
1069     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_menu 
1070     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GPA.lnk" \
1071         "$INSTDIR\gpa.exe" \
1072         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
1073   no_gpa_menu:
1074 !endif
1075
1076 !ifdef HAVE_PKG_KLEOPATRA
1077     SectionGetFlags ${SEC_kleopatra} $R0 
1078     IntOp $R0 $R0 & ${SF_SELECTED} 
1079     IntCmp $R0 ${SF_SELECTED} 0 no_kleopatra_menu 
1080     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Kleopatra.lnk" \
1081         "$INSTDIR\kleopatra.exe" \
1082         "" "$INSTDIR\bin\kleopatra.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_kleopatra)
1083   no_kleopatra_menu:
1084 !endif
1085
1086 !ifdef HAVE_PKG_CLAWS_MAIL
1087     SectionGetFlags ${SEC_claws_mail} $R0 
1088     IntOp $R0 $R0 & ${SF_SELECTED} 
1089     IntCmp $R0 ${SF_SELECTED} 0 no_claws_mail_menu 
1090     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Claws-Mail.lnk" \
1091         "$INSTDIR\claws-mail.exe" \
1092         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail)
1093 !ifndef GPG4WIN_LIGHT
1094     CreateShortCut \
1095         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)\Claws-Mail Manual.lnk" \
1096         "$INSTDIR\claws-mail-manual.pdf" \
1097         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail_pdf)
1098 !endif
1099   no_claws_mail_menu:
1100 !endif
1101
1102 #!ifdef HAVE_PKG_EUDORAGPG
1103 #    SectionGetFlags ${SEC_eudoragpg} $R0 
1104 #    IntOp $R0 $R0 & ${SF_SELECTED} 
1105 #    IntCmp $R0 ${SF_SELECTED} 0 no_eudoragpg_menu 
1106 #    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\EudoraGPG Plugin.lnk" \
1107 #       "$INSTDIR\share\eudoragpg\eudoragpg.html" \
1108 #        "" "" "" SW_SHOWNORMAL "" ""
1109 #  no_eudoragpg_menu:
1110 #!endif
1111
1112 !ifdef HAVE_PKG_MAN_NOVICE_EN
1113     SectionGetFlags ${SEC_man_novice_en} $R0 
1114     IntOp $R0 $R0 & ${SF_SELECTED} 
1115     IntCmp $R0 ${SF_SELECTED} 0 no_man_novice_en_menu 
1116     CreateShortCut \
1117         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)\$(DESC_Name_man_novice_en).lnk" \
1118         "$INSTDIR\share\gpg4win\novices.pdf" \
1119         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_novice_en)
1120   no_man_novice_en_menu:
1121 !endif
1122
1123 !ifdef HAVE_PKG_MAN_ADVANCED_EN
1124     SectionGetFlags ${SEC_man_advanced_en} $R0 
1125     IntOp $R0 $R0 & ${SF_SELECTED} 
1126     IntCmp $R0 ${SF_SELECTED} 0 no_man_advanced_en_menu 
1127     CreateShortCut \
1128         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)\$(DESC_Name_man_advanced_en).lnk" \
1129         "$INSTDIR\share\gpg4win\advanced.pdf" \
1130         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_advanced_en)
1131   no_man_advanced_en_menu:
1132 !endif
1133
1134 !ifdef HAVE_PKG_COMPENDIUM_DE
1135     SectionGetFlags ${SEC_compendium_de} $R0 
1136     IntOp $R0 $R0 & ${SF_SELECTED} 
1137     IntCmp $R0 ${SF_SELECTED} 0 no_compendium_de_menu 
1138     CreateShortCut \
1139         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)\$(DESC_Name_compendium_de).lnk" \
1140         "$INSTDIR\share\gpg4win\html-de\gpg4win-compendium-de.html" \
1141         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_compendium_de)
1142   no_compendium_de_menu:
1143 !endif
1144
1145 !ifdef HAVE_PKG_MAN_NOVICE_DE
1146     SectionGetFlags ${SEC_man_novice_de} $R0 
1147     IntOp $R0 $R0 & ${SF_SELECTED} 
1148     IntCmp $R0 ${SF_SELECTED} 0 no_man_novice_de_menu 
1149     CreateShortCut \
1150         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)\$(DESC_Name_man_novice_de).lnk" \
1151         "$INSTDIR\share\gpg4win\einsteiger.pdf" \
1152         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_novice_de)
1153   no_man_novice_de_menu:
1154 !endif
1155
1156 !ifdef HAVE_PKG_MAN_ADVANCED_DE
1157     SectionGetFlags ${SEC_man_advanced_de} $R0 
1158     IntOp $R0 $R0 & ${SF_SELECTED} 
1159     IntCmp $R0 ${SF_SELECTED} 0 no_man_advanced_de_menu 
1160     CreateShortCut \
1161         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)\$(DESC_Name_man_advanced_de).lnk" \
1162         "$INSTDIR\share\gpg4win\durchblicker.pdf" \
1163         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_advanced_de)
1164   no_man_advanced_de_menu:
1165 !endif
1166
1167 # The FAQ is totally outdated, better don't show it.
1168 #    CreateShortCut \
1169 #      "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)\GnuPG FAQ.lnk" \
1170 #      "$INSTDIR\share\gnupg\faq.html" \
1171 #      "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gnupg_faq)
1172
1173     CreateShortCut \
1174       "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Menu_manuals)\Gpg4Win README.lnk" \
1175       "$INSTDIR\share\gpg4win\README.$(T_LangCode).txt" \
1176       "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpg4win_readme)
1177
1178 # No more uninstall link because Windows has its own feature to call
1179 #  the uninstaller.
1180 #    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" \
1181 #       "$INSTDIR\${PACKAGE}-uninstall.exe"
1182 !insertmacro MUI_STARTMENU_WRITE_END
1183
1184  no_start_menu:
1185
1186
1187
1188   # Check if the desktop entries where requested.
1189   !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
1190         "Field 3" "State"
1191   IntCmp $R0 0 no_desktop
1192
1193   # Delete the old stuff, also old names of previous versions.
1194   Delete "$DESKTOP\WinPT.lnk"
1195   Delete "$DESKTOP\GPA.lnk"
1196   Delete "$DESKTOP\Kleopatra.lnk"
1197   Delete "$DESKTOP\Sylpheed-Claws.lnk"
1198   Delete "$DESKTOP\Sylpheed-Claws Manual.lnk"
1199   Delete "$DESKTOP\Sylpheed.lnk"
1200   Delete "$DESKTOP\Claws-Mail.lnk"
1201   Delete "$DESKTOP\Claws-Mail Manual.lnk"
1202   Delete "$DESKTOP\$(DESC_Name_compendium_de).lnk"
1203   Delete "$DESKTOP\$(DESC_Name_man_novice_de).lnk"
1204   Delete "$DESKTOP\$(DESC_Name_man_novice_en).lnk"
1205   Delete "$DESKTOP\$(DESC_Name_man_advanced_de).lnk"
1206   Delete "$DESKTOP\GPGee Manual.lnk"
1207   Delete "$DESKTOP\GnuPG FAQ.lnk"
1208   Delete "$DESKTOP\Gpg4Win README.lnk"
1209   Delete "$DESKTOP\$(DESC_Desktop_manuals)\Claws-Mail Manual.lnk"
1210   Delete "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_compendium_de).lnk"
1211   Delete "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_man_novice_de).lnk"
1212   Delete "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_man_novice_en).lnk"
1213   Delete "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_man_advanced_de).lnk"
1214   Delete "$DESKTOP\$(DESC_Desktop_manuals)\GPGee Manual.lnk"
1215   Delete "$DESKTOP\$(DESC_Desktop_manuals)\GnuPG FAQ.lnk"
1216   Delete "$DESKTOP\$(DESC_Desktop_manuals)\Gpg4Win README.lnk"
1217
1218   CreateDirectory "$DESKTOP\$(DESC_Desktop_manuals)"
1219
1220 !ifdef HAVE_PKG_WINPT
1221     SectionGetFlags ${SEC_winpt} $R0 
1222     IntOp $R0 $R0 & ${SF_SELECTED}
1223     IntCmp $R0 ${SF_SELECTED} 0 no_winpt_desktop
1224     # Create link which directly starts the WinPT key manager
1225     CreateShortCut "$DESKTOP\WinPT.lnk" \
1226         "$INSTDIR\winpt.exe" \
1227         "--keymanager" "$INSTDIR\winpt.exe" "" \
1228         SW_SHOWNORMAL "" $(DESC_Menu_winpt)
1229    no_winpt_desktop:
1230 !endif
1231
1232 !ifdef HAVE_PKG_GPA
1233     SectionGetFlags ${SEC_gpa} $R0 
1234     IntOp $R0 $R0 & ${SF_SELECTED} 
1235     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_desktop
1236     CreateShortCut "$DESKTOP\GPA.lnk" \
1237         "$INSTDIR\gpa.exe" \
1238         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
1239   no_gpa_desktop:
1240 !endif
1241
1242 !ifdef HAVE_PKG_KLEOPATRA
1243     SectionGetFlags ${SEC_kleopatra} $R0 
1244     IntOp $R0 $R0 & ${SF_SELECTED}
1245     IntCmp $R0 ${SF_SELECTED} 0 no_kleopatra_desktop
1246     CreateShortCut "$DESKTOP\Kleopatra.lnk" \
1247         "$INSTDIR\kleopatra.exe" \
1248         "" "$INSTDIR\bin\kleopatra.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_kleopatra)
1249   no_kleopatra_desktop:
1250 !endif
1251
1252 !ifdef HAVE_PKG_CLAWS_MAIL
1253     SectionGetFlags ${SEC_claws_mail} $R0 
1254     IntOp $R0 $R0 & ${SF_SELECTED} 
1255     IntCmp $R0 ${SF_SELECTED} 0 no_claws_mail_desktop
1256     CreateShortCut "$DESKTOP\Claws-Mail.lnk" \
1257         "$INSTDIR\claws-mail.exe" \
1258         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail)
1259 !ifndef GPG4WIN_LIGHT
1260     CreateShortCut \
1261         "$DESKTOP\$(DESC_Desktop_manuals)\Claws-Mail Manual.lnk" \
1262         "$INSTDIR\claws-mail-manual.pdf" \
1263         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail_pdf)
1264 !endif
1265   no_claws_mail_desktop:
1266 !endif
1267
1268 !ifdef HAVE_PKG_MAN_NOVICE_EN
1269     SectionGetFlags ${SEC_man_novice_en} $R0 
1270     IntOp $R0 $R0 & ${SF_SELECTED} 
1271     IntCmp $R0 ${SF_SELECTED} 0 no_man_novice_en_desktop
1272     CreateShortCut \
1273         "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_man_novice_en).lnk" \
1274         "$INSTDIR\share\gpg4win\novices.pdf" \
1275         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_novice_en)
1276   no_man_novice_en_desktop:
1277 !endif
1278
1279 !ifdef HAVE_PKG_MAN_ADVANCED_EN
1280     SectionGetFlags ${SEC_man_advanced_en} $R0 
1281     IntOp $R0 $R0 & ${SF_SELECTED} 
1282     IntCmp $R0 ${SF_SELECTED} 0 no_man_advanced_en_desktop
1283     CreateShortCut \
1284         "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_man_advanced_en).lnk" \
1285         "$INSTDIR\share\gpg4win\advanced.pdf" \
1286         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_advanced_en)
1287   no_man_advanced_en_desktop:
1288 !endif
1289
1290 !ifdef HAVE_PKG_COMPENDIUM_DE
1291     SectionGetFlags ${SEC_compendium_de} $R0 
1292     IntOp $R0 $R0 & ${SF_SELECTED} 
1293     IntCmp $R0 ${SF_SELECTED} 0 no_compendium_de_desktop
1294     CreateShortCut \
1295         "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_compendium_de).lnk" \
1296         "$INSTDIR\share\gpg4win\html-de\gpg4win-compendium-de.html" \
1297         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_compendium_de)
1298   no_compendium_de_desktop:
1299 !endif
1300
1301 !ifdef HAVE_PKG_MAN_NOVICE_DE
1302     SectionGetFlags ${SEC_man_novice_de} $R0 
1303     IntOp $R0 $R0 & ${SF_SELECTED} 
1304     IntCmp $R0 ${SF_SELECTED} 0 no_man_novice_de_desktop
1305     CreateShortCut \
1306         "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_man_novice_de).lnk" \
1307         "$INSTDIR\share\gpg4win\einsteiger.pdf" \
1308         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_novice_de)
1309   no_man_novice_de_desktop:
1310 !endif
1311
1312 !ifdef HAVE_PKG_MAN_ADVANCED_DE
1313     SectionGetFlags ${SEC_man_advanced_de} $R0 
1314     IntOp $R0 $R0 & ${SF_SELECTED} 
1315     IntCmp $R0 ${SF_SELECTED} 0 no_man_advanced_de_desktop
1316     CreateShortCut \
1317         "$DESKTOP\$(DESC_Desktop_manuals)\$(DESC_Name_man_advanced_de).lnk" \
1318         "$INSTDIR\share\gpg4win\durchblicker.pdf" \
1319         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_advanced_de)
1320   no_man_advanced_de_desktop:
1321 !endif
1322
1323 # The GnuPG FAQ is totally out of date
1324 #    CreateShortCut "$DESKTOP\$(DESC_Desktop_manuals)\GnuPG FAQ.lnk" \
1325 #                   "$INSTDIR\share\gnupg\faq.html" \
1326 #                   "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gnupg_faq)
1327
1328 no_desktop:
1329
1330         
1331   # Check if the quick launch bar entries where requested.
1332   !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
1333         "Field 4" "State"
1334   IntCmp $R0 0 no_quick_launch
1335   StrCmp $QUICKLAUNCH $TEMP no_quick_launch
1336
1337   # Delete old Quick Launch Bar links.
1338   Delete "$QUICKLAUNCH\WinPT.lnk"
1339   Delete "$QUICKLAUNCH\GPA.lnk"
1340   Delete "$QUICKLAUNCH\Kleopatra.lnk"
1341   Delete "$QUICKLAUNCH\Sylpheed-Claws.lnk"
1342   # We better delete also the name we used prior to 1.0.3
1343   Delete "$QUICKLAUNCH\Sylpheed.lnk"
1344   Delete "$QUICKLAUNCH\Claws-Mail.lnk"
1345   Delete "$QUICKLAUNCH\$(DESC_Name_compendium_de).lnk"
1346   Delete "$QUICKLAUNCH\$(DESC_Name_man_novice_de).lnk"
1347   Delete "$QUICKLAUNCH\$(DESC_Name_man_advanced_de).lnk"
1348   Delete "$QUICKLAUNCH\GPGee Manual.lnk"
1349   Delete "$QUICKLAUNCH\GnuPG FAQ.lnk"
1350   Delete "$QUICKLAUNCH\Gpg4Win README.lnk"
1351
1352 !ifdef HAVE_PKG_WINPT
1353     SectionGetFlags ${SEC_winpt} $R0 
1354     IntOp $R0 $R0 & ${SF_SELECTED}
1355     IntCmp $R0 ${SF_SELECTED} 0 no_winpt_quicklaunch 
1356     CreateShortCut "$QUICKLAUNCH\WinPT.lnk" \
1357         "$INSTDIR\winpt.exe" \
1358         "" "$INSTDIR\winpt.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_winpt)
1359    no_winpt_quicklaunch:
1360 !endif
1361
1362 !ifdef HAVE_PKG_GPA
1363     SectionGetFlags ${SEC_gpa} $R0 
1364     IntOp $R0 $R0 & ${SF_SELECTED} 
1365     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_quicklaunch
1366     CreateShortCut "$QUICKLAUNCH\GPA.lnk" \
1367         "$INSTDIR\gpa.exe" \
1368         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
1369   no_gpa_quicklaunch:
1370 !endif
1371
1372 !ifdef HAVE_PKG_KLEOPATRA
1373     SectionGetFlags ${SEC_kleopatra} $R0 
1374     IntOp $R0 $R0 & ${SF_SELECTED} 
1375     IntCmp $R0 ${SF_SELECTED} 0 no_kleopatra_quicklaunch
1376     CreateShortCut "$QUICKLAUNCH\Kleopatra.lnk" \
1377         "$INSTDIR\kleopatra.exe" \
1378         "" "$INSTDIR\bin\kleopatra.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_kleopatra)
1379   no_kleopatra_quicklaunch:
1380 !endif
1381
1382 !ifdef HAVE_PKG_CLAWS_MAIL
1383     SectionGetFlags ${SEC_claws_mail} $R0 
1384     IntOp $R0 $R0 & ${SF_SELECTED} 
1385     IntCmp $R0 ${SF_SELECTED} 0 no_claws_mail_quicklaunch
1386     CreateShortCut "$QUICKLAUNCH\Claws-Mail.lnk" \
1387         "$INSTDIR\claws-mail.exe" \
1388         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail)
1389   no_claws_mail_quicklaunch:
1390 !endif
1391
1392
1393 no_quick_launch:
1394
1395
1396 !endif
1397 SectionEnd
1398
1399
1400 # FIXME: Now write desktop and quick launch bar.
1401 # Don't forget to delete the corr. entries in installer-finish. Uninstall.