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