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