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