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