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