Updating gnupg to version 2.2.0
[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 !include "inst-gpg4win.nsi"
20
21 # The order of installation must be the same as the build order.  You
22 # can use tsort on the info in configure.ac, or just check out
23 # gpg4win_build_list in config.nsi.  The order determines also the
24 # order in the packages selection dialog.
25
26 !ifdef HAVE_PKG_BZIP2
27 !include "inst-bzip2.nsi"
28 !endif
29 !ifdef HAVE_PKG_LIBICONV
30 !include "inst-libiconv.nsi"
31 !endif
32 !ifdef HAVE_PKG_LIBTASN1
33 !include "inst-libtasn1.nsi"
34 !endif
35 !ifdef HAVE_PKG_BREEZE_ICONS
36 !include "inst-breeze-icons.nsi"
37 !endif
38 !ifdef HAVE_PKG_PKGCONFIG
39 !include "inst-pkgconfig.nsi"
40 !endif
41 !ifdef HAVE_PKG_W32PTH
42 !include "inst-w32pth.nsi"
43 !endif
44 !ifdef HAVE_PKG_ZLIB
45 !include "inst-zlib.nsi"
46 !endif
47 !ifdef HAVE_PKG_QTBASE
48 !include "inst-qtbase.nsi"
49 !endif
50 !ifdef HAVE_PKG_GETTEXT
51 !include "inst-gettext.nsi"
52 !endif
53 !ifdef HAVE_PKG_LIBPNG
54 !include "inst-libpng.nsi"
55 !endif
56 !ifdef HAVE_PKG_LIBASSUAN
57 !include "inst-libassuan.nsi"
58 !endif
59 !ifdef HAVE_PKG_LIBGPG_ERROR
60 !include "inst-libgpg-error.nsi"
61 !endif
62 !ifdef HAVE_PKG_LIBFFI
63 !include "inst-libffi.nsi"
64 !endif
65 !ifdef HAVE_PKG_GLIB
66 !include "inst-glib.nsi"
67 !endif
68 !ifdef HAVE_PKG_EXPAT
69 !include "inst-expat.nsi"
70 !endif
71 !ifdef HAVE_PKG_FREETYPE
72 !include "inst-freetype.nsi"
73 !endif
74 !ifdef HAVE_PKG_FONTCONFIG
75 !include "inst-fontconfig.nsi"
76 !endif
77 !ifdef HAVE_PKG_CAIRO
78 !include "inst-cairo.nsi"
79 !endif
80 !ifdef HAVE_PKG_PANGO
81 !include "inst-pango.nsi"
82 !endif
83 !ifdef HAVE_PKG_ATK
84 !include "inst-atk.nsi"
85 !endif
86 !ifdef HAVE_PKG_GDK_PIXBUF
87 !include "inst-gdk-pixbuf.nsi"
88 !endif
89 !ifdef HAVE_PKG_GTK_
90 !include "inst-gtk+.nsi"
91 !endif
92 !ifdef HAVE_PKG_PINENTRY
93 !include "inst-pinentry.nsi"
94 !endif
95 !ifdef HAVE_PKG_GNUPG_W32
96 !include "inst-gnupg-w32.nsi"
97 !endif
98 !ifdef HAVE_PKG_GPGME
99 !include "inst-gpgme.nsi"
100 !endif
101 !ifdef HAVE_PKG_QTTOOLS
102 !include "inst-qttools.nsi"
103 !endif
104 !ifdef HAVE_PKG_QTWINEXTRAS
105 !include "inst-qtwinextras.nsi"
106 !endif
107 !ifdef HAVE_PKG_BOOST
108 !include "inst-boost.nsi"
109 !endif
110 !ifdef HAVE_PKG_KCONFIG
111 !include "inst-kconfig.nsi"
112 !endif
113 !ifdef HAVE_PKG_KI18N
114 !include "inst-ki18n.nsi"
115 !endif
116 !ifdef HAVE_PKG_KWIDGETSADDONS
117 !include "inst-kwidgetsaddons.nsi"
118 !endif
119 !ifdef HAVE_PKG_KCOMPLETION
120 !include "inst-kcompletion.nsi"
121 !endif
122 !ifdef HAVE_PKG_KWINDOWSYSTEM
123 !include "inst-kwindowsystem.nsi"
124 !endif
125 !ifdef HAVE_PKG_KCOREADDONS
126 !include "inst-kcoreaddons.nsi"
127 !endif
128 !ifdef HAVE_PKG_KCODECS
129 !include "inst-kcodecs.nsi"
130 !endif
131 !ifdef HAVE_PKG_KCONFIGWIDGETS
132 !include "inst-kconfigwidgets.nsi"
133 !endif
134 !ifdef HAVE_PKG_KXMLGUI
135 !include "inst-kxmlgui.nsi"
136 !endif
137 !ifdef HAVE_PKG_KGUIADDONS
138 !include "inst-kguiaddons.nsi"
139 !endif
140 !ifdef HAVE_PKG_KMIME
141 !include "inst-kmime.nsi"
142 !endif
143 !ifdef HAVE_PKG_KDE_L10N
144 !include "inst-kde-l10n.nsi"
145 !endif
146 !ifdef HAVE_PKG_KICONTHEMES
147 !include "inst-kiconthemes.nsi"
148 !endif
149 !ifdef HAVE_PKG_KARCHIVE
150 !include "inst-karchive.nsi"
151 !endif
152 !ifdef HAVE_PKG_KITEMVIEWS
153 !include "inst-kitemviews.nsi"
154 !endif
155 !ifdef HAVE_PKG_KITEMMODELS
156 !include "inst-kitemmodels.nsi"
157 !endif
158 !ifdef HAVE_PKG_LIBKLEO
159 !include "inst-libkleo.nsi"
160 !endif
161 !ifdef HAVE_PKG_EXTRA_CMAKE_MODULES
162 !include "inst-extra-cmake-modules.nsi"
163 !endif
164 !ifdef HAVE_PKG_QTSVG
165 !include "inst-qtsvg.nsi"
166 !endif
167 !ifdef HAVE_PKG_QTTRANSLATIONS
168 !include "inst-qttranslations.nsi"
169 !endif
170
171 # These are displayed in the selection dialog.
172
173 !ifdef HAVE_PKG_KLEOPATRA
174 !include "inst-kleopatra.nsi"
175 !endif
176 !ifdef HAVE_PKG_GPA
177 !include "inst-gpa.nsi"
178 !endif
179 !ifdef HAVE_PKG_GPGOL
180 !include "inst-gpgol.nsi"
181 !endif
182 !ifdef HAVE_PKG_GPGEX
183 !include "inst-gpgex.nsi"
184 !endif
185 !ifdef HAVE_PKG_PAPERKEY
186 !include "inst-paperkey.nsi"
187 !endif
188 !ifdef HAVE_PKG_COMPENDIUM
189 !include "inst-compendium.nsi"
190 !endif
191 !ifdef HAVE_PKG_MAN_NOVICE_EN
192 !include "inst-man_novice_en.nsi"
193 !endif
194 !ifdef HAVE_PKG_MAN_ADVANCED_EN
195 !include "inst-man_advanced_en.nsi"
196 !endif
197 !ifdef HAVE_PKG_MAN_NOVICE_DE
198 !include "inst-man_novice_de.nsi"
199 !endif
200 !ifdef HAVE_PKG_MAN_ADVANCED_DE
201 !include "inst-man_advanced_de.nsi"
202 !endif
203
204 !include "inst-final.nsi"
205
206 # We have to invoke the uninstallers in reverse order!
207
208 !ifdef HAVE_PKG_MAN_ADVANCED_DE
209 !include "uninst-man_advanced_de.nsi"
210 !endif
211 !ifdef HAVE_PKG_MAN_NOVICE_DE
212 !include "uninst-man_novice_de.nsi"
213 !endif
214 !ifdef HAVE_PKG_MAN_ADVANCED_EN
215 !include "uninst-man_advanced_en.nsi"
216 !endif
217 !ifdef HAVE_PKG_MAN_NOVICE_EN
218 !include "uninst-man_novice_en.nsi"
219 !endif
220 !ifdef HAVE_PKG_COMPENDIUM
221 !include "uninst-compendium.nsi"
222 !endif
223 !ifdef HAVE_PKG_PAPERKEY
224 !include "uninst-paperkey.nsi"
225 !endif
226 !ifdef HAVE_PKG_GPGEX
227 !include "uninst-gpgex.nsi"
228 !endif
229 !ifdef HAVE_PKG_GPGOL
230 !include "uninst-gpgol.nsi"
231 !endif
232 !ifdef HAVE_PKG_GPA
233 !include "uninst-gpa.nsi"
234 !endif
235 !ifdef HAVE_PKG_KLEOPATRA
236 !include "uninst-kleopatra.nsi"
237 !endif
238
239 !ifdef HAVE_PKG_GPGME
240 !include "uninst-gpgme.nsi"
241 !endif
242 !ifdef HAVE_PKG_GNUPG_W32
243 !include "uninst-gnupg-w32.nsi"
244 !endif
245 !ifdef HAVE_PKG_PINENTRY
246 !include "uninst-pinentry.nsi"
247 !endif
248 !ifdef HAVE_PKG_GNUTLS
249 !include "uninst-gnutls.nsi"
250 !endif
251 !ifdef HAVE_PKG_CURL
252 !include "uninst-curl.nsi"
253 !endif
254 !ifdef HAVE_PKG_GTK_
255 !include "uninst-gtk+.nsi"
256 !endif
257 !ifdef HAVE_PKG_GDK_PIXBUF
258 !include "uninst-gdk-pixbuf.nsi"
259 !endif
260 !ifdef HAVE_PKG_ATK
261 !include "uninst-atk.nsi"
262 !endif
263 !ifdef HAVE_PKG_PANGO
264 !include "uninst-pango.nsi"
265 !endif
266 !ifdef HAVE_PKG_CAIRO
267 !include "uninst-cairo.nsi"
268 !endif
269 !ifdef HAVE_PKG_FONTCONFIG
270 !include "uninst-fontconfig.nsi"
271 !endif
272 !ifdef HAVE_PKG_FREETYPE
273 !include "uninst-freetype.nsi"
274 !endif
275 !ifdef HAVE_PKG_EXPAT
276 !include "uninst-expat.nsi"
277 !endif
278 !ifdef HAVE_PKG_GLIB
279 !include "uninst-glib.nsi"
280 !endif
281 !ifdef HAVE_PKG_LIBFFI
282 !include "uninst-libffi.nsi"
283 !endif
284 !ifdef HAVE_PKG_LIBGPG_ERROR
285 !include "uninst-libgpg-error.nsi"
286 !endif
287 !ifdef HAVE_PKG_LIBASSUAN
288 !include "uninst-libassuan.nsi"
289 !endif
290 !ifdef HAVE_PKG_LIBPNG
291 !include "uninst-libpng.nsi"
292 !endif
293 !ifdef HAVE_PKG_GETTEXT
294 !include "uninst-gettext.nsi"
295 !endif
296 !ifdef HAVE_PKG_QTBASE
297 !include "uninst-qtbase.nsi"
298 !endif
299 !ifdef HAVE_PKG_ZLIB
300 !include "uninst-zlib.nsi"
301 !endif
302 !ifdef HAVE_PKG_W32PTH
303 !include "uninst-w32pth.nsi"
304 !endif
305 !ifdef HAVE_PKG_PKGCONFIG
306 !include "uninst-pkgconfig.nsi"
307 !endif
308 !ifdef HAVE_PKG_BREEZE_ICONS
309 !include "uninst-breeze-icons.nsi"
310 !endif
311 !ifdef HAVE_PKG_MAN_ADVANCED_DE
312 !include "uninst-man_advanced_de.nsi"
313 !endif
314 !ifdef HAVE_PKG_MAN_NOVICE_DE
315 !include "uninst-man_novice_de.nsi"
316 !endif
317 !ifdef HAVE_PKG_MAN_ADVANCED_EN
318 !include "uninst-man_advanced_en.nsi"
319 !endif
320 !ifdef HAVE_PKG_MAN_NOVICE_EN
321 !include "uninst-man_novice_en.nsi"
322 !endif
323 !ifdef HAVE_PKG_LIBICONV
324 !include "uninst-libiconv.nsi"
325 !endif
326 !ifdef HAVE_PKG_QTTOOLS
327 !include "uninst-qttools.nsi"
328 !endif
329 !ifdef HAVE_PKG_QTWINEXTRAS
330 !include "uninst-qtwinextras.nsi"
331 !endif
332 !ifdef HAVE_PKG_BOOST
333 !include "uninst-boost.nsi"
334 !endif
335 !ifdef HAVE_PKG_KCONFIG
336 !include "uninst-kconfig.nsi"
337 !endif
338 !ifdef HAVE_PKG_KI18N
339 !include "uninst-ki18n.nsi"
340 !endif
341 !ifdef HAVE_PKG_KWIDGETSADDONS
342 !include "uninst-kwidgetsaddons.nsi"
343 !endif
344 !ifdef HAVE_PKG_KCOMPLETION
345 !include "uninst-kcompletion.nsi"
346 !endif
347 !ifdef HAVE_PKG_KWINDOWSYSTEM
348 !include "uninst-kwindowsystem.nsi"
349 !endif
350 !ifdef HAVE_PKG_KCOREADDONS
351 !include "uninst-kcoreaddons.nsi"
352 !endif
353 !ifdef HAVE_PKG_KCODECS
354 !include "uninst-kcodecs.nsi"
355 !endif
356 !ifdef HAVE_PKG_KCONFIGWIDGETS
357 !include "uninst-kconfigwidgets.nsi"
358 !endif
359 !ifdef HAVE_PKG_KGUIADDONS
360 !include "uninst-kguiaddons.nsi"
361 !endif
362 !ifdef HAVE_PKG_KXMLGUI
363 !include "uninst-kxmlgui.nsi"
364 !endif
365 !ifdef HAVE_PKG_KICONTHEMES
366 !include "uninst-kiconthemes.nsi"
367 !endif
368 !ifdef HAVE_PKG_KARCHIVE
369 !include "uninst-karchive.nsi"
370 !endif
371 !ifdef HAVE_PKG_KITEMVIEWS
372 !include "uninst-kitemviews.nsi"
373 !endif
374 !ifdef HAVE_PKG_KITEMMODELS
375 !include "uninst-kitemmodels.nsi"
376 !endif
377 !ifdef HAVE_PKG_KMIME
378 !include "uninst-kmime.nsi"
379 !endif
380 !ifdef HAVE_PKG_KDE_L10N
381 !include "uninst-kde-l10n.nsi"
382 !endif
383 !ifdef HAVE_PKG_LIBKLEO
384 !include "uninst-libkleo.nsi"
385 !endif
386 !ifdef HAVE_PKG_EXTRA_CMAKE_MODULES
387 !include "uninst-extra-cmake-modules.nsi"
388 !endif
389 !ifdef HAVE_PKG_BZIP2
390 !include "uninst-bzip2.nsi"
391 !endif
392 !ifdef HAVE_PKG_QTSVG
393 !include "uninst-qtsvg.nsi"
394 !endif
395 !ifdef HAVE_PKG_QTTRANSLATIONS
396 !include "uninst-qttranslations.nsi"
397 !endif
398
399 !include "uninst-gpg4win.nsi"
400
401
402 # Dependency Management
403
404 ${MementoSectionDone}
405
406 Function CalcDefaults
407
408 !ifdef HAVE_PKG_KLEOPATRA
409   g4wihelp::config_fetch_bool "inst_kleopatra"
410   StrCmp $R0 "1" 0 calc_defaults_kleopatra_not_one
411    !insertmacro SelectSection ${SEC_kleopatra}
412    Goto calc_defaults_kleopatra_done
413   calc_defaults_kleopatra_not_one:
414   StrCmp $R0 "0" 0 calc_defaults_kleopatra_done
415    !insertmacro UnselectSection ${SEC_kleopatra}
416 calc_defaults_kleopatra_done:
417 !endif
418
419 !ifdef HAVE_PKG_GPGOL
420   g4wihelp::config_fetch_bool "inst_gpgol"
421   StrCmp $R0 "1" 0 calc_defaults_gpgol_not_one
422    !insertmacro SelectSection ${SEC_gpgol}
423    Goto calc_defaults_gpgol_done
424   calc_defaults_gpgol_not_one:
425   StrCmp $R0 "0" 0 calc_defaults_gpgol_done
426    !insertmacro UnselectSection ${SEC_gpgol}
427 calc_defaults_gpgol_done:
428 !endif
429
430 !ifdef HAVE_PKG_GPGEX
431   g4wihelp::config_fetch_bool "inst_gpgex"
432   StrCmp $R0 "1" 0 calc_defaults_gpgex_not_one
433    !insertmacro SelectSection ${SEC_gpgex}
434    Goto calc_defaults_gpgex_done
435   calc_defaults_gpgex_not_one:
436   StrCmp $R0 "0" 0 calc_defaults_gpgex_done
437    !insertmacro UnselectSection ${SEC_gpgex}
438 calc_defaults_gpgex_done:
439 !endif
440
441 !ifdef HAVE_PKG_PAPERKEY
442   g4wihelp::config_fetch_bool "inst_paperkey"
443   StrCmp $R0 "1" 0 calc_defaults_paperkey_not_one
444    !insertmacro SelectSection ${SEC_paperkey}
445    Goto calc_defaults_paperkey_done
446   calc_defaults_paperkey_not_one:
447   StrCmp $R0 "0" 0 calc_defaults_paperkey_done
448    !insertmacro UnselectSection ${SEC_paperkey}
449 calc_defaults_paperkey_done:
450 !endif
451
452 !ifdef HAVE_PKG_GPA
453   g4wihelp::config_fetch_bool "inst_gpa"
454   StrCmp $R0 "1" 0 calc_defaults_gpa_not_one
455    !insertmacro SelectSection ${SEC_gpa}
456    Goto calc_defaults_gpa_done
457   calc_defaults_gpa_not_one:
458   StrCmp $R0 "0" 0 calc_defaults_gpa_done
459    !insertmacro UnselectSection ${SEC_gpa}
460 calc_defaults_gpa_done:
461 !endif
462
463 !ifdef HAVE_PKG_COMPENDIUM
464   g4wihelp::config_fetch_bool "inst_compendium"
465   StrCmp $R0 "1" 0 calc_defaults_compendium_not_one
466    !insertmacro SelectSection ${SEC_compendium}
467    Goto calc_defaults_compendium_done
468   calc_defaults_compendium_not_one:
469   StrCmp $R0 "0" 0 calc_defaults_compendium_done
470    !insertmacro UnselectSection ${SEC_compendium}
471 calc_defaults_compendium_done:
472 !endif
473
474
475 !ifdef HAVE_PKG_MAN_NOVICE_DE
476   g4wihelp::config_fetch_bool "inst_man_novice_de"
477   StrCmp $R0 "1" 0 calc_defaults_man_novice_de_not_one
478    !insertmacro SelectSection ${SEC_man_novice_de}
479    Goto calc_defaults_man_novice_de_done
480   calc_defaults_man_novice_de_not_one:
481   StrCmp $R0 "0" 0 calc_defaults_man_novice_de_done
482    !insertmacro UnselectSection ${SEC_man_novice_de}
483 calc_defaults_man_novice_de_done:
484 !endif
485
486 !ifdef HAVE_PKG_MAN_NOVICE_EN
487   g4wihelp::config_fetch_bool "inst_man_novice_en"
488   StrCmp $R0 "1" 0 calc_defaults_man_novice_en_not_one
489    !insertmacro SelectSection ${SEC_man_novice_en}
490    Goto calc_defaults_man_novice_en_done
491   calc_defaults_man_novice_en_not_one:
492   StrCmp $R0 "0" 0 calc_defaults_man_novice_en_done
493    !insertmacro UnselectSection ${SEC_man_novice_en}
494 calc_defaults_man_novice_en_done:
495 !endif
496
497 !ifdef HAVE_PKG_MAN_ADVANCED_DE
498   g4wihelp::config_fetch_bool "inst_man_advanced_de"
499   StrCmp $R0 "1" 0 calc_defaults_man_advanced_de_not_one
500    !insertmacro SelectSection ${SEC_man_advanced_de}
501    Goto calc_defaults_man_advanced_de_done
502   calc_defaults_man_advanced_de_not_one:
503   StrCmp $R0 "0" 0 calc_defaults_man_advanced_de_done
504    !insertmacro UnselectSection ${SEC_man_advanced_de}
505 calc_defaults_man_advanced_de_done:
506 !endif
507
508 !ifdef HAVE_PKG_MAN_ADVANCED_EN
509   g4wihelp::config_fetch_bool "inst_man_advanced_en"
510   StrCmp $R0 "1" 0 calc_defaults_man_advanced_en_not_one
511    !insertmacro SelectSection ${SEC_man_advanced_en}
512    Goto calc_defaults_man_advanced_en_done
513   calc_defaults_man_advanced_en_not_one:
514   StrCmp $R0 "0" 0 calc_defaults_man_advanced_en_done
515    !insertmacro UnselectSection ${SEC_man_advanced_en}
516 calc_defaults_man_advanced_en_done:
517 !endif
518
519 # Check if minimal install was requested on the command line
520
521 StrCmp $is_minimal '1' select_minimal continue
522 select_minimal:
523    !insertmacro UnselectSection ${SEC_kleopatra}
524    !insertmacro UnselectSection ${SEC_gpgol}
525    !insertmacro UnselectSection ${SEC_gpgex}
526    !insertmacro UnselectSection ${SEC_gpa}
527    !insertmacro UnselectSection ${SEC_compendium}
528
529 # We only do pinentry and gnupg-w32
530    !insertmacro SelectSection ${SEC_paperkey}
531    !insertmacro SelectSection ${SEC_gnupg_w32}
532    !insertmacro SelectSection ${SEC_pinentry}
533 continue:
534 FunctionEnd
535
536
537 Function CalcDepends
538   # This section could very well be autogenerated from the
539   # information in configure.ac.  Note that it doesn't hurt to have
540   # stuff here for packages that we don't include.
541
542   # First clear all indirect dependencies.
543 !ifdef HAVE_PKG_LIBICONV
544   !insertmacro UnselectSection ${SEC_libiconv}
545 !endif
546 !ifdef HAVE_PKG_GETTEXT
547   !insertmacro UnselectSection ${SEC_gettext}
548 !endif
549 !ifdef HAVE_PKG_ZLIB
550   !insertmacro UnselectSection ${SEC_zlib}
551 !endif
552 !ifdef HAVE_PKG_LIBPNG
553   !insertmacro UnselectSection ${SEC_libpng}
554 !endif
555 !ifdef HAVE_PKG_PKGCONFIG
556   !insertmacro UnselectSection ${SEC_pkgconfig}
557 !endif
558 !ifdef HAVE_PKG_GLIB
559   !insertmacro UnselectSection ${SEC_glib}
560 !endif
561 !ifdef HAVE_PKG_ATK
562   !insertmacro UnselectSection ${SEC_atk}
563 !endif
564 !ifdef HAVE_PKG_PANGO
565   !insertmacro UnselectSection ${SEC_pango}
566 !endif
567 !ifdef HAVE_PKG_EXPAT
568   !insertmacro UnselectSection ${SEC_expat}
569 !endif
570 !ifdef HAVE_PKG_FREETYPE
571   !insertmacro UnselectSection ${SEC_freetype}
572 !endif
573 !ifdef HAVE_PKG_FONTCONFIG
574   !insertmacro UnselectSection ${SEC_fontconfig}
575 !endif
576 !ifdef HAVE_PKG_CAIRO
577   !insertmacro UnselectSection ${SEC_cairo}
578 !endif
579 !ifdef HAVE_PKG_GTK_
580   !insertmacro UnselectSection ${SEC_gtk_}
581 !endif
582 !ifdef HAVE_PKG_BZIP2
583   !insertmacro UnselectSection ${SEC_bzip2}
584 !endif
585 !ifdef HAVE_PKG_LIBGPG_ERROR
586   !insertmacro UnselectSection ${SEC_libgpg_error}
587 !endif
588 !ifdef HAVE_PKG_W32PTH
589   !insertmacro UnselectSection ${SEC_w32pth}
590 !endif
591 !ifdef HAVE_PKG_LIBASSUAN
592   !insertmacro UnselectSection ${SEC_libassuan}
593 !endif
594 !ifdef HAVE_PKG_PINENTRY
595   !insertmacro UnselectSection ${SEC_pinentry}
596 !endif
597 !ifdef HAVE_PKG_GPGME
598   !insertmacro UnselectSection ${SEC_gpgme}
599 !endif
600 !ifdef HAVE_PKG_LIBGSASL
601   !insertmacro UnselectSection ${SEC_libgsasl}
602 !endif
603 !ifdef HAVE_PKG_LIBTASN1
604   !insertmacro UnselectSection ${SEC_libtasn1}
605 !endif
606 !ifdef HAVE_PKG_GNUTLS
607   !insertmacro UnselectSection ${SEC_gnutls}
608 !endif
609 !ifdef HAVE_PKG_CURL
610   !insertmacro UnselectSection ${SEC_curl}
611 !endif
612 !ifdef HAVE_PKG_QTBASE
613   !insertmacro UnselectSection ${SEC_qtbase}
614 !endif
615 !ifdef HAVE_PKG_QTTOOLS
616   !insertmacro UnselectSection ${SEC_qttools}
617 !endif
618 !ifdef HAVE_PKG_QTWINEXTRAS
619   !insertmacro UnselectSection ${SEC_qtwinextras}
620 !endif
621 !ifdef HAVE_PKG_BREEZE_ICONS
622   !insertmacro UnselectSection ${SEC_breeze_icons}
623 !endif
624 !ifdef HAVE_PKG_KCONFIG
625   !insertmacro UnselectSection ${SEC_kconfig}
626 !endif
627 !ifdef HAVE_PKG_KI18N
628   !insertmacro UnselectSection ${SEC_ki18n}
629 !endif
630 !ifdef HAVE_PKG_KWIDGETSADDONS
631   !insertmacro UnselectSection ${SEC_kwidgetsaddons}
632 !endif
633 !ifdef HAVE_PKG_KCOMPLETION
634   !insertmacro UnselectSection ${SEC_kcompletion}
635 !endif
636 !ifdef HAVE_PKG_KWINDOWSYSTEM
637   !insertmacro UnselectSection ${SEC_kwindowsystem}
638 !endif
639 !ifdef HAVE_PKG_KCOREADDONS
640   !insertmacro UnselectSection ${SEC_kcoreaddons}
641 !endif
642 !ifdef HAVE_PKG_KCODECS
643   !insertmacro UnselectSection ${SEC_kcodecs}
644 !endif
645 !ifdef HAVE_PKG_KCONFIGWIDGETS
646   !insertmacro UnselectSection ${SEC_kconfigwidgets}
647 !endif
648 !ifdef HAVE_PKG_KXMLGUI
649   !insertmacro UnselectSection ${SEC_kxmlgui}
650 !endif
651 !ifdef HAVE_PKG_KICONTHEMES
652   !insertmacro UnselectSection ${SEC_kiconthemes}
653 !endif
654 !ifdef HAVE_PKG_KARCHIVE
655   !insertmacro UnselectSection ${SEC_karchive}
656 !endif
657 !ifdef HAVE_PKG_KITEMVIEWS
658   !insertmacro UnselectSection ${SEC_kitemviews}
659 !endif
660 !ifdef HAVE_PKG_KITEMMODELS
661   !insertmacro UnselectSection ${SEC_kitemmodels}
662 !endif
663 !ifdef HAVE_PKG_KGUIADDONS
664   !insertmacro UnselectSection ${SEC_kguiaddons}
665 !endif
666 !ifdef HAVE_PKG_LIBKLEO
667   !insertmacro UnselectSection ${SEC_libkleo}
668 !endif
669 !ifdef HAVE_PKG_KMIME
670   !insertmacro UnselectSection ${SEC_kmime}
671 !endif
672 !ifdef HAVE_PKG_KDE_L10N
673   !insertmacro UnselectSection ${SEC_kde-l10n}
674 !endif
675 !ifdef HAVE_PKG_QTSVG
676   !insertmacro UnselectSection ${SEC_qtsvg}
677 !endif
678 !ifdef HAVE_PKG_QTTRANSLATIONS
679   !insertmacro UnselectSection ${SEC_qttranslations}
680 !endif
681
682   # Always install gnupg2.  This is also ensured by putting
683   # these packages in the RO section and enabling them by default, but
684   # it doesn't harm to add it explicitely here as well.
685
686   # TODO: Handle newer / other gnupg versions
687   !insertmacro SelectSection ${SEC_gnupg_w32}
688
689   # Then enable all dependencies, mostly in reverse build list order!
690
691   # First the explicitely installed packages.
692
693
694 !ifdef HAVE_PKG_PAPERKEY
695   !insertmacro SectionFlagIsSet ${SEC_paperkey} \
696                 ${SF_SELECTED} have_paperkey skip_paperkey
697   have_paperkey:
698   # All dependencies are linked in statically.
699   skip_paperkey:
700 !endif
701
702 !ifdef HAVE_PKG_GPGEX
703   !insertmacro SectionFlagIsSet ${SEC_gpgex} \
704                 ${SF_SELECTED} have_gpgex skip_gpgex
705   have_gpgex:
706
707   # This is not a build dependency, but it is a run-time dependency.
708   !insertmacro SectionFlagIsSet ${SEC_gpa} \
709                 ${SF_SELECTED} skipa_gpgex_dep_kleopatra need_gpgex_dep_kleopatra
710   need_gpgex_dep_kleopatra:
711   !insertmacro SelectSection ${SEC_kleopatra}
712   skipa_gpgex_dep_kleopatra:
713
714   # Other dependencies are linked in statically.
715   skip_gpgex:
716 !endif
717
718 !ifdef HAVE_PKG_GPGOL
719   !insertmacro SectionFlagIsSet ${SEC_gpgol} \
720                 ${SF_SELECTED} have_gpgol skip_gpgol
721   have_gpgol:
722   !insertmacro SelectSection ${SEC_gpgme}
723
724   # This is not a build dependency, but it is a run-time dependency.
725   !insertmacro SectionFlagIsSet ${SEC_gpa} \
726                 ${SF_SELECTED} skipa_gpgol_dep_kleopatra need_gpgol_dep_kleopatra
727   need_gpgol_dep_kleopatra:
728   !insertmacro SelectSection ${SEC_kleopatra}
729   skipa_gpgol_dep_kleopatra:
730
731   skip_gpgol:
732 !endif
733
734 !ifdef HAVE_PKG_KLEOPATRA
735   !insertmacro SectionFlagIsSet ${SEC_kleopatra} ${SF_SELECTED} have_kleopatra skip_kleopatra
736   have_kleopatra:
737   !insertmacro SelectSection ${SEC_gpgme}
738   # This drags in all the other KDE and Qt stuff.
739   !insertmacro SelectSection ${SEC_kleopatra}
740   skip_kleopatra:
741 !endif
742
743 !ifdef HAVE_PKG_GNUPG_W32
744   !insertmacro SectionFlagIsSet ${SEC_gnupg_w32} ${SF_SELECTED} have_gnupg_w32 skip_gnupg_w32
745   have_gnupg_w32:
746   !insertmacro SelectSection ${SEC_pinentry}
747   skip_gnupg_w32:
748 !endif
749
750 !ifdef HAVE_PKG_GPA
751   !insertmacro SectionFlagIsSet ${SEC_gpa} ${SF_SELECTED} have_gpa skip_gpa
752   have_gpa:
753   !insertmacro SelectSection ${SEC_libiconv}
754   !insertmacro SelectSection ${SEC_gettext}
755   !insertmacro SelectSection ${SEC_zlib}
756   !insertmacro SelectSection ${SEC_gtk_}
757   !insertmacro SelectSection ${SEC_libpng}
758   !insertmacro SelectSection ${SEC_glib}
759   !insertmacro SelectSection ${SEC_gpgme}
760   skip_gpa:
761 !endif
762
763   # Now the implicitely installed packages.
764
765 !ifdef HAVE_PKG_KLEOPATRA
766   !insertmacro SectionFlagIsSet ${SEC_kleopatra} \
767                 ${SF_SELECTED} have_kleopatra_libs skip_kleopatra_libs
768   have_kleopatra_libs:
769   !insertmacro SelectSection ${SEC_qtbase}
770   !insertmacro SelectSection ${SEC_breeze_icons}
771   !insertmacro SelectSection ${SEC_kconfig}
772   !insertmacro SelectSection ${SEC_ki18n}
773   !insertmacro SelectSection ${SEC_kwidgetsaddons}
774   !insertmacro SelectSection ${SEC_kcompletion}
775   !insertmacro SelectSection ${SEC_kwindowsystem}
776   !insertmacro SelectSection ${SEC_kcoreaddons}
777   !insertmacro SelectSection ${SEC_kcodecs}
778   !insertmacro SelectSection ${SEC_kconfigwidgets}
779   !insertmacro SelectSection ${SEC_kxmlgui}
780   !insertmacro SelectSection ${SEC_kitemviews}
781   !insertmacro SelectSection ${SEC_kitemmodels}
782   !insertmacro SelectSection ${SEC_kiconthemes}
783   !insertmacro SelectSection ${SEC_karchive}
784   !insertmacro SelectSection ${SEC_kguiaddons}
785   !insertmacro SelectSection ${SEC_qtsvg}
786   !insertmacro SelectSection ${SEC_qttranslations}
787   !insertmacro SelectSection ${SEC_kmime}
788   !insertmacro SelectSection ${SEC_kde-l10n}
789   !insertmacro SelectSection ${SEC_libkleo}
790   !insertmacro SelectSection ${SEC_qttools}
791   !insertmacro SelectSection ${SEC_qtwinextras}
792   !insertmacro SelectSection ${SEC_boost}
793   !insertmacro SelectSection ${SEC_extra-cmake-modules}
794    skip_kleopatra_libs:
795 !endif
796
797 !ifdef HAVE_PKG_GPGME
798   !insertmacro SectionFlagIsSet ${SEC_gpgme} \
799                 ${SF_SELECTED} have_gpgme skip_gpgme
800   have_gpgme:
801   # GPGME does not depend on gnupg2.  Do this in the
802   # actual application instead.
803   !insertmacro SelectSection ${SEC_libgpg_error}
804   !insertmacro SelectSection ${SEC_libassuan}
805 !ifdef HAVE_PKG_QTBASE
806   !insertmacro SelectSection ${SEC_qtbase}
807 !endif
808    skip_gpgme:
809 !endif
810
811 !ifdef HAVE_PKG_PINENTRY
812   !insertmacro SectionFlagIsSet ${SEC_pinentry} \
813                 ${SF_SELECTED} have_pinentry skip_pinentry
814   have_pinentry:
815   !insertmacro SelectSection ${SEC_libiconv}
816 !ifdef HAVE_PKG_QTBASE
817   !insertmacro SelectSection ${SEC_qtbase}
818 !endif
819 !ifdef HAVE_PKG_GTK_
820   !insertmacro SelectSection ${SEC_gtk_}
821 !endif
822    skip_pinentry:
823 !endif
824
825 !ifdef HAVE_PKG_QTBASE
826   !insertmacro SectionFlagIsSet ${SEC_qtbase} \
827                 ${SF_SELECTED} have_qt skip_qt
828   have_qt:
829   !insertmacro SelectSection ${SEC_libpng}
830   !insertmacro SelectSection ${SEC_zlib}
831   !insertmacro SelectSection ${SEC_qttranslations}
832   skip_qt:
833 !endif
834
835 !ifdef HAVE_PKG_LIBASSUAN
836   !insertmacro SectionFlagIsSet ${SEC_libassuan} ${SF_SELECTED} have_libassuan skip_libassuan
837   have_libassuan:
838   !insertmacro SelectSection ${SEC_libgpg_error}
839   !insertmacro SelectSection ${SEC_w32pth}
840   skip_libassuan:
841 !endif
842
843   # Package "w32pth" has no dependencies.
844
845 !ifdef HAVE_PKG_LIBGPG_ERROR
846   !insertmacro SectionFlagIsSet ${SEC_libgpg_error} ${SF_SELECTED} have_libgpg_error skip_libgpg_error
847   have_libgpg_error:
848   !insertmacro SelectSection ${SEC_libiconv}
849   !insertmacro SelectSection ${SEC_gettext}
850   skip_libgpg_error:
851 !endif
852
853   # Package "bzip2" has no dependencies.
854
855 !ifdef HAVE_PKG_GTK_
856   !insertmacro SectionFlagIsSet ${SEC_gtk_} \
857                 ${SF_SELECTED} have_gtk_ skip_gtk_
858   have_gtk_:
859   !insertmacro SelectSection ${SEC_libiconv}
860   !insertmacro SelectSection ${SEC_gettext}
861   !insertmacro SelectSection ${SEC_pkgconfig}
862   !insertmacro SelectSection ${SEC_atk}
863   !insertmacro SelectSection ${SEC_pango}
864   !insertmacro SelectSection ${SEC_glib}
865   !insertmacro SelectSection ${SEC_cairo}
866   skip_gtk_:
867 !endif
868
869 !ifdef HAVE_PKG_CAIRO
870   !insertmacro SectionFlagIsSet ${SEC_cairo} \
871                 ${SF_SELECTED} have_cairo skip_cairo
872   have_cairo:
873   !insertmacro SelectSection ${SEC_glib}
874   !insertmacro SelectSection ${SEC_pkgconfig}
875   !insertmacro SelectSection ${SEC_expat}
876   !insertmacro SelectSection ${SEC_freetype}
877   !insertmacro SelectSection ${SEC_fontconfig}
878   skip_cairo:
879 !endif
880
881 !ifdef HAVE_PKG_FONTCONFIG
882   !insertmacro SectionFlagIsSet ${SEC_fontconfig} \
883                 ${SF_SELECTED} have_fontconfig skip_fontconfig
884   have_fontconfig:
885   !insertmacro SelectSection ${SEC_pkgconfig}
886   !insertmacro SelectSection ${SEC_freetype}
887   skip_fontconfig:
888 !endif
889
890 !ifdef HAVE_PKG_FREETYPE
891   !insertmacro SectionFlagIsSet ${SEC_freetype} \
892                 ${SF_SELECTED} have_freetype skip_freetype
893   have_freetype:
894   !insertmacro SelectSection ${SEC_pkgconfig}
895   !insertmacro SelectSection ${SEC_expat}
896   skip_freetype:
897 !endif
898
899 # Package "expat" has no dependencies.
900
901 !ifdef HAVE_PKG_PANGO
902   !insertmacro SectionFlagIsSet ${SEC_pango} \
903                 ${SF_SELECTED} have_pango skip_pango
904   have_pango:
905   !insertmacro SelectSection ${SEC_glib}
906   !insertmacro SelectSection ${SEC_pkgconfig}
907   skip_pango:
908 !endif
909
910 !ifdef HAVE_PKG_ATK
911   !insertmacro SectionFlagIsSet ${SEC_atk} \
912                 ${SF_SELECTED} have_atk skip_atk
913   have_atk:
914   !insertmacro SelectSection ${SEC_glib}
915   !insertmacro SelectSection ${SEC_pkgconfig}
916   skip_atk:
917 !endif
918
919 !ifdef HAVE_PKG_GLIB
920   !insertmacro SectionFlagIsSet ${SEC_glib} \
921                 ${SF_SELECTED} have_glib skip_glib
922   have_glib:
923   !insertmacro SelectSection ${SEC_libiconv}
924   !insertmacro SelectSection ${SEC_gettext}
925   !insertmacro SelectSection ${SEC_pkgconfig}
926   skip_glib:
927 !endif
928
929   # Package "pkgconfig" has no dependencies.
930
931 !ifdef HAVE_PKG_LIBPNG
932   !insertmacro SectionFlagIsSet ${SEC_libpng} \
933                 ${SF_SELECTED} have_libpng skip_libpng
934   have_libpng:
935   !insertmacro SelectSection ${SEC_pkgconfig}
936   skip_libpng:
937 !endif
938
939   # Package "zlib" has no dependencies.
940
941 !ifdef HAVE_PKG_GETTEXT
942   !insertmacro SectionFlagIsSet ${SEC_gettext} \
943                 ${SF_SELECTED} have_gettext skip_gettext
944   have_gettext:
945   !insertmacro SelectSection ${SEC_libiconv}
946   skip_gettext:
947 !endif
948
949   # Package "libiconv" has no dependencies.
950
951 FunctionEnd
952
953 Function .onInstFailed
954   Delete $TEMP\gpgspltmp.wav
955 FunctionEnd
956
957 Function .onInstSuccess
958   ${MementoSectionSave}
959   Delete $TEMP\gpgspltmp.wav
960 FunctionEnd
961
962 Function .onSelChange
963   Call CalcDepends
964 FunctionEnd
965
966
967 # Note used anymore:
968 # This function is run from the finish page.
969 #Function RunOnFinish
970 #!ifdef HAVE_PKG_GPA
971 #    SectionGetFlags ${SEC_gpa} $R0
972 #    IntOp $R0 $R0 & ${SF_SELECTED}
973 #    IntCmp $R0 ${SF_SELECTED} 0 no_gpa_avail
974 #       Exec "$INSTDIR\gpa.exe"
975 #       Return
976 #   no_gpa_avail:
977 #!endif
978 #  MessageBox MB_OK "$(T_NoKeyManager)"
979 #FunctionEnd
980
981
982
983 # This also must be in a central place.  Also Urgs.
984
985 Section "-startmenu"
986
987   UserInfo::GetAccountType
988   Pop $1
989   StrCmp $1 "Admin" is_admin is_no_admin
990 is_admin:
991   SetShellVarContext all
992
993 is_no_admin:
994
995   # NOT SetOutPath.
996   StrCpy $OUTDIR "%HOMEDRIVE%%HOMEPATH%"
997
998   # Check if the start menu entries where requested.
999   g4wihelp::config_fetch_bool "inst_start_menu"
1000   StrCmp $R0 "0" no_start_menu
1001
1002 !ifdef HAVE_PKG_GPA
1003     SectionGetFlags ${SEC_gpa} $R0
1004     IntOp $R0 $R0 & ${SF_SELECTED}
1005     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_menu
1006     CreateShortCut "$SMPROGRAMS\GPA.lnk" \
1007         "$INSTDIR\bin\gpa.exe" \
1008         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
1009   no_gpa_menu:
1010 !endif
1011
1012 !ifdef HAVE_PKG_KLEOPATRA
1013     SectionGetFlags ${SEC_kleopatra} $R0
1014     IntOp $R0 $R0 & ${SF_SELECTED}
1015     IntCmp $R0 ${SF_SELECTED} 0 no_kleopatra_menu
1016     CreateShortCut "$SMPROGRAMS\Kleopatra.lnk" \
1017         "$INSTDIR\bin\kleopatra.exe" \
1018         "" "$INSTDIR\bin\kleopatra.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_kleopatra)
1019   no_kleopatra_menu:
1020 !endif
1021
1022  no_start_menu:
1023
1024   # Check if the desktop entries where requested.
1025   g4wihelp::config_fetch_bool "inst_desktop"
1026   StrCmp $R0 "0" no_desktop
1027
1028 !ifdef HAVE_PKG_GPA
1029     SectionGetFlags ${SEC_gpa} $R0
1030     IntOp $R0 $R0 & ${SF_SELECTED}
1031     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_desktop
1032     CreateShortCut "$DESKTOP\GPA.lnk" \
1033         "$INSTDIR\bin\gpa.exe" \
1034         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
1035   no_gpa_desktop:
1036 !endif
1037
1038 !ifdef HAVE_PKG_KLEOPATRA
1039     SectionGetFlags ${SEC_kleopatra} $R0
1040     IntOp $R0 $R0 & ${SF_SELECTED}
1041     IntCmp $R0 ${SF_SELECTED} 0 no_kleopatra_desktop
1042     CreateShortCut "$DESKTOP\Kleopatra.lnk" \
1043         "$INSTDIR\bin\kleopatra.exe" \
1044         "" "$INSTDIR\bin\kleopatra.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_kleopatra)
1045   no_kleopatra_desktop:
1046 !endif
1047
1048 no_desktop:
1049
1050 SectionEnd