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