Add dll find fallback for mingw from buster
[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
550 # Check if browser integration was selected on the command line
551 # or in the ini
552 # You can either select the browser integration by adding
553 # inst_browser = true to a gpg4win.ini or adding a
554 # /WITH_BROWSER=1 command line switch to the installer.
555 g4wihelp::config_fetch_bool "inst_browser"
556 StrCmp $R0 "1" select_browser 0
557 StrCmp $with_browser '1' select_browser skip_browser
558 select_browser:
559     !insertmacro SelectSection ${SEC_gpgme_browser}
560 skip_browser:
561
562 FunctionEnd
563
564
565
566 Function CalcDepends
567   # This section could very well be autogenerated from the
568   # information in configure.ac.  Note that it doesn't hurt to have
569   # stuff here for packages that we don't include.
570
571   # First clear all indirect dependencies.
572 !ifdef HAVE_PKG_LIBICONV
573   !insertmacro UnselectSection ${SEC_libiconv}
574 !endif
575 !ifdef HAVE_PKG_GETTEXT
576   !insertmacro UnselectSection ${SEC_gettext}
577 !endif
578 !ifdef HAVE_PKG_ZLIB
579   !insertmacro UnselectSection ${SEC_zlib}
580 !endif
581 !ifdef HAVE_PKG_LIBPNG
582   !insertmacro UnselectSection ${SEC_libpng}
583 !endif
584 !ifdef HAVE_PKG_PKGCONFIG
585   !insertmacro UnselectSection ${SEC_pkgconfig}
586 !endif
587 !ifdef HAVE_PKG_GLIB
588   !insertmacro UnselectSection ${SEC_glib}
589 !endif
590 !ifdef HAVE_PKG_ATK
591   !insertmacro UnselectSection ${SEC_atk}
592 !endif
593 !ifdef HAVE_PKG_PANGO
594   !insertmacro UnselectSection ${SEC_pango}
595 !endif
596 !ifdef HAVE_PKG_EXPAT
597   !insertmacro UnselectSection ${SEC_expat}
598 !endif
599 !ifdef HAVE_PKG_FREETYPE
600   !insertmacro UnselectSection ${SEC_freetype}
601 !endif
602 !ifdef HAVE_PKG_FONTCONFIG
603   !insertmacro UnselectSection ${SEC_fontconfig}
604 !endif
605 !ifdef HAVE_PKG_CAIRO
606   !insertmacro UnselectSection ${SEC_cairo}
607 !endif
608 !ifdef HAVE_PKG_GTK_
609   !insertmacro UnselectSection ${SEC_gtk_}
610 !endif
611 !ifdef HAVE_PKG_BZIP2
612   !insertmacro UnselectSection ${SEC_bzip2}
613 !endif
614 !ifdef HAVE_PKG_LIBGPG_ERROR
615   !insertmacro UnselectSection ${SEC_libgpg_error}
616 !endif
617 !ifdef HAVE_PKG_W32PTH
618   !insertmacro UnselectSection ${SEC_w32pth}
619 !endif
620 !ifdef HAVE_PKG_LIBASSUAN
621   !insertmacro UnselectSection ${SEC_libassuan}
622 !endif
623 !ifdef HAVE_PKG_PINENTRY
624   !insertmacro UnselectSection ${SEC_pinentry}
625 !endif
626 !ifdef HAVE_PKG_GPGME
627   !insertmacro UnselectSection ${SEC_gpgme}
628 !endif
629 !ifdef HAVE_PKG_LIBGSASL
630   !insertmacro UnselectSection ${SEC_libgsasl}
631 !endif
632 !ifdef HAVE_PKG_LIBTASN1
633   !insertmacro UnselectSection ${SEC_libtasn1}
634 !endif
635 !ifdef HAVE_PKG_GNUTLS
636   !insertmacro UnselectSection ${SEC_gnutls}
637 !endif
638 !ifdef HAVE_PKG_CURL
639   !insertmacro UnselectSection ${SEC_curl}
640 !endif
641 !ifdef HAVE_PKG_QTBASE
642   !insertmacro UnselectSection ${SEC_qtbase}
643 !endif
644 !ifdef HAVE_PKG_QTTOOLS
645   !insertmacro UnselectSection ${SEC_qttools}
646 !endif
647 !ifdef HAVE_PKG_QTWINEXTRAS
648   !insertmacro UnselectSection ${SEC_qtwinextras}
649 !endif
650 !ifdef HAVE_PKG_BREEZE_ICONS
651   !insertmacro UnselectSection ${SEC_breeze_icons}
652 !endif
653 !ifdef HAVE_PKG_KCONFIG
654   !insertmacro UnselectSection ${SEC_kconfig}
655 !endif
656 !ifdef HAVE_PKG_KI18N
657   !insertmacro UnselectSection ${SEC_ki18n}
658 !endif
659 !ifdef HAVE_PKG_KWIDGETSADDONS
660   !insertmacro UnselectSection ${SEC_kwidgetsaddons}
661 !endif
662 !ifdef HAVE_PKG_KCOMPLETION
663   !insertmacro UnselectSection ${SEC_kcompletion}
664 !endif
665 !ifdef HAVE_PKG_KWINDOWSYSTEM
666   !insertmacro UnselectSection ${SEC_kwindowsystem}
667 !endif
668 !ifdef HAVE_PKG_KCOREADDONS
669   !insertmacro UnselectSection ${SEC_kcoreaddons}
670 !endif
671 !ifdef HAVE_PKG_KCODECS
672   !insertmacro UnselectSection ${SEC_kcodecs}
673 !endif
674 !ifdef HAVE_PKG_KCONFIGWIDGETS
675   !insertmacro UnselectSection ${SEC_kconfigwidgets}
676 !endif
677 !ifdef HAVE_PKG_KXMLGUI
678   !insertmacro UnselectSection ${SEC_kxmlgui}
679 !endif
680 !ifdef HAVE_PKG_KICONTHEMES
681   !insertmacro UnselectSection ${SEC_kiconthemes}
682 !endif
683 !ifdef HAVE_PKG_KARCHIVE
684   !insertmacro UnselectSection ${SEC_karchive}
685 !endif
686 !ifdef HAVE_PKG_KCRASH
687   !insertmacro UnselectSection ${SEC_kcrash}
688 !endif
689 !ifdef HAVE_PKG_KITEMVIEWS
690   !insertmacro UnselectSection ${SEC_kitemviews}
691 !endif
692 !ifdef HAVE_PKG_KITEMMODELS
693   !insertmacro UnselectSection ${SEC_kitemmodels}
694 !endif
695 !ifdef HAVE_PKG_KGUIADDONS
696   !insertmacro UnselectSection ${SEC_kguiaddons}
697 !endif
698 !ifdef HAVE_PKG_LIBKLEO
699   !insertmacro UnselectSection ${SEC_libkleo}
700 !endif
701 !ifdef HAVE_PKG_KMIME
702   !insertmacro UnselectSection ${SEC_kmime}
703 !endif
704 !ifdef HAVE_PKG_KDE_L10N
705   !insertmacro UnselectSection ${SEC_kde-l10n}
706 !endif
707 !ifdef HAVE_PKG_QTSVG
708   !insertmacro UnselectSection ${SEC_qtsvg}
709 !endif
710 !ifdef HAVE_PKG_QTTRANSLATIONS
711   !insertmacro UnselectSection ${SEC_qttranslations}
712 !endif
713 !ifdef HAVE_PKG_GPG4WIN_TOOLS
714   !insertmacro UnselectSection ${SEC_gpg4win-tools}
715 !endif
716
717   # Always install gnupg2.  This is also ensured by putting
718   # these packages in the RO section and enabling them by default, but
719   # it doesn't harm to add it explicitely here as well.
720
721   # TODO: Handle newer / other gnupg versions
722   !insertmacro SelectSection ${SEC_gnupg_w32}
723
724   # Then enable all dependencies, mostly in reverse build list order!
725
726   # First the explicitely installed packages.
727
728
729 !ifdef HAVE_PKG_PAPERKEY
730   !insertmacro SectionFlagIsSet ${SEC_paperkey} \
731                 ${SF_SELECTED} have_paperkey skip_paperkey
732   have_paperkey:
733   # All dependencies are linked in statically.
734   skip_paperkey:
735 !endif
736
737 !ifdef HAVE_PKG_GPGEX
738   !insertmacro SectionFlagIsSet ${SEC_gpgex} \
739                 ${SF_SELECTED} have_gpgex skip_gpgex
740   have_gpgex:
741
742   # This is not a build dependency, but it is a run-time dependency.
743   !insertmacro SectionFlagIsSet ${SEC_gpa} \
744                 ${SF_SELECTED} skipa_gpgex_dep_kleopatra need_gpgex_dep_kleopatra
745   need_gpgex_dep_kleopatra:
746   !insertmacro SelectSection ${SEC_kleopatra}
747   skipa_gpgex_dep_kleopatra:
748
749   # Other dependencies are linked in statically.
750   skip_gpgex:
751 !endif
752
753 !ifdef HAVE_PKG_GPGOL
754   !insertmacro SectionFlagIsSet ${SEC_gpgol} \
755                 ${SF_SELECTED} have_gpgol skip_gpgol
756   have_gpgol:
757   !insertmacro SelectSection ${SEC_gpgme}
758   !insertmacro SelectSection ${SEC_gpg4win-tools}
759
760   # This is not a build dependency, but it is a run-time dependency.
761   !insertmacro SectionFlagIsSet ${SEC_gpa} \
762                 ${SF_SELECTED} skipa_gpgol_dep_kleopatra need_gpgol_dep_kleopatra
763   need_gpgol_dep_kleopatra:
764   !insertmacro SelectSection ${SEC_kleopatra}
765   skipa_gpgol_dep_kleopatra:
766
767   skip_gpgol:
768 !endif
769
770 !ifdef HAVE_PKG_KLEOPATRA
771   !insertmacro SectionFlagIsSet ${SEC_kleopatra} ${SF_SELECTED} have_kleopatra skip_kleopatra
772   have_kleopatra:
773   !insertmacro SelectSection ${SEC_gpgme}
774   # This drags in all the other KDE and Qt stuff.
775   !insertmacro SelectSection ${SEC_kleopatra}
776   skip_kleopatra:
777 !ifndef SOURCES
778   ${IfNot} ${AtLeastWin7}
779     # Disable Kleo for Windows below 7
780     SectionSetFlags ${SEC_kleopatra} 16
781     !insertmacro SelectSection ${SEC_gpa}
782   ${Endif}
783 !endif
784 !endif
785
786 !ifdef HAVE_PKG_GNUPG_W32
787   !insertmacro SectionFlagIsSet ${SEC_gnupg_w32} ${SF_SELECTED} have_gnupg_w32 skip_gnupg_w32
788   have_gnupg_w32:
789   !insertmacro SelectSection ${SEC_pinentry}
790   skip_gnupg_w32:
791 !endif
792
793 !ifdef HAVE_PKG_GPA
794   !insertmacro SectionFlagIsSet ${SEC_gpa} ${SF_SELECTED} have_gpa skip_gpa
795   have_gpa:
796   !insertmacro SelectSection ${SEC_libiconv}
797   !insertmacro SelectSection ${SEC_gettext}
798   !insertmacro SelectSection ${SEC_zlib}
799   !insertmacro SelectSection ${SEC_gtk_}
800   !insertmacro SelectSection ${SEC_libpng}
801   !insertmacro SelectSection ${SEC_glib}
802   !insertmacro SelectSection ${SEC_gpgme}
803   skip_gpa:
804 !endif
805
806 !insertmacro SectionFlagIsSet ${SEC_gpgme_browser} ${SF_SELECTED} have_gpgme_browser skip_gpgme_browser
807 have_gpgme_browser:
808 !insertmacro SelectSection ${SEC_gpgme}
809 skip_gpgme_browser:
810
811   # Now the implicitely installed packages.
812
813 !ifdef HAVE_PKG_KLEOPATRA
814   !insertmacro SectionFlagIsSet ${SEC_kleopatra} \
815                 ${SF_SELECTED} have_kleopatra_libs skip_kleopatra_libs
816   have_kleopatra_libs:
817   !insertmacro SelectSection ${SEC_compendium}
818   !insertmacro SelectSection ${SEC_qtbase}
819   !insertmacro SelectSection ${SEC_breeze_icons}
820   !insertmacro SelectSection ${SEC_kconfig}
821   !insertmacro SelectSection ${SEC_ki18n}
822   !insertmacro SelectSection ${SEC_kwidgetsaddons}
823   !insertmacro SelectSection ${SEC_kcompletion}
824   !insertmacro SelectSection ${SEC_kwindowsystem}
825   !insertmacro SelectSection ${SEC_kcoreaddons}
826   !insertmacro SelectSection ${SEC_kcodecs}
827   !insertmacro SelectSection ${SEC_kconfigwidgets}
828   !insertmacro SelectSection ${SEC_kxmlgui}
829   !insertmacro SelectSection ${SEC_kitemviews}
830   !insertmacro SelectSection ${SEC_kitemmodels}
831   !insertmacro SelectSection ${SEC_kiconthemes}
832   !insertmacro SelectSection ${SEC_karchive}
833   !insertmacro SelectSection ${SEC_kcrash}
834   !insertmacro SelectSection ${SEC_kguiaddons}
835   !insertmacro SelectSection ${SEC_qtsvg}
836   !insertmacro SelectSection ${SEC_qttranslations}
837   !insertmacro SelectSection ${SEC_kmime}
838   !insertmacro SelectSection ${SEC_kde-l10n}
839   !insertmacro SelectSection ${SEC_libkleo}
840   !insertmacro SelectSection ${SEC_qttools}
841   !insertmacro SelectSection ${SEC_qtwinextras}
842   !insertmacro SelectSection ${SEC_boost}
843   !insertmacro SelectSection ${SEC_extra-cmake-modules}
844    skip_kleopatra_libs:
845 !endif
846
847 !ifdef HAVE_PKG_GPGME
848   !insertmacro SectionFlagIsSet ${SEC_gpgme} \
849                 ${SF_SELECTED} have_gpgme skip_gpgme
850   have_gpgme:
851   # GPGME does not depend on gnupg2.  Do this in the
852   # actual application instead.
853   !insertmacro SelectSection ${SEC_libgpg_error}
854   !insertmacro SelectSection ${SEC_libassuan}
855 !ifdef HAVE_PKG_QTBASE
856   !insertmacro SelectSection ${SEC_qtbase}
857 !endif
858    skip_gpgme:
859 !endif
860
861 !ifdef HAVE_PKG_PINENTRY
862   !insertmacro SectionFlagIsSet ${SEC_pinentry} \
863                 ${SF_SELECTED} have_pinentry skip_pinentry
864   have_pinentry:
865   !insertmacro SelectSection ${SEC_libiconv}
866 !ifdef HAVE_PKG_QTBASE
867   !insertmacro SelectSection ${SEC_qtbase}
868 !endif
869 !ifdef HAVE_PKG_GTK_
870   !insertmacro SelectSection ${SEC_gtk_}
871 !endif
872    skip_pinentry:
873 !endif
874
875 !ifdef HAVE_PKG_QTBASE
876   !ifndef SOURCES
877   ${IfNot} ${AtLeastWin7}
878     # Disable qt for Windows below 7
879     !insertmacro UnSelectSection ${SEC_qtbase}
880   ${Endif}
881   !endif
882   !insertmacro SectionFlagIsSet ${SEC_qtbase} \
883                 ${SF_SELECTED} have_qt skip_qt
884   have_qt:
885   !insertmacro SelectSection ${SEC_libpng}
886   !insertmacro SelectSection ${SEC_zlib}
887   !insertmacro SelectSection ${SEC_qttranslations}
888   skip_qt:
889 !endif
890
891 !ifdef HAVE_PKG_LIBASSUAN
892   !insertmacro SectionFlagIsSet ${SEC_libassuan} ${SF_SELECTED} have_libassuan skip_libassuan
893   have_libassuan:
894   !insertmacro SelectSection ${SEC_libgpg_error}
895   !insertmacro SelectSection ${SEC_w32pth}
896   skip_libassuan:
897 !endif
898
899   # Package "w32pth" has no dependencies.
900
901 !ifdef HAVE_PKG_LIBGPG_ERROR
902   !insertmacro SectionFlagIsSet ${SEC_libgpg_error} ${SF_SELECTED} have_libgpg_error skip_libgpg_error
903   have_libgpg_error:
904   !insertmacro SelectSection ${SEC_libiconv}
905   !insertmacro SelectSection ${SEC_gettext}
906   skip_libgpg_error:
907 !endif
908
909   # Package "bzip2" has no dependencies.
910
911 !ifdef HAVE_PKG_GTK_
912   !insertmacro SectionFlagIsSet ${SEC_gtk_} \
913                 ${SF_SELECTED} have_gtk_ skip_gtk_
914   have_gtk_:
915   !insertmacro SelectSection ${SEC_libiconv}
916   !insertmacro SelectSection ${SEC_gettext}
917   !insertmacro SelectSection ${SEC_pkgconfig}
918   !insertmacro SelectSection ${SEC_atk}
919   !insertmacro SelectSection ${SEC_pango}
920   !insertmacro SelectSection ${SEC_glib}
921   !insertmacro SelectSection ${SEC_cairo}
922   skip_gtk_:
923 !endif
924
925 !ifdef HAVE_PKG_CAIRO
926   !insertmacro SectionFlagIsSet ${SEC_cairo} \
927                 ${SF_SELECTED} have_cairo skip_cairo
928   have_cairo:
929   !insertmacro SelectSection ${SEC_glib}
930   !insertmacro SelectSection ${SEC_pkgconfig}
931   !insertmacro SelectSection ${SEC_expat}
932   !insertmacro SelectSection ${SEC_freetype}
933   !insertmacro SelectSection ${SEC_fontconfig}
934   skip_cairo:
935 !endif
936
937 !ifdef HAVE_PKG_FONTCONFIG
938   !insertmacro SectionFlagIsSet ${SEC_fontconfig} \
939                 ${SF_SELECTED} have_fontconfig skip_fontconfig
940   have_fontconfig:
941   !insertmacro SelectSection ${SEC_pkgconfig}
942   !insertmacro SelectSection ${SEC_freetype}
943   skip_fontconfig:
944 !endif
945
946 !ifdef HAVE_PKG_FREETYPE
947   !insertmacro SectionFlagIsSet ${SEC_freetype} \
948                 ${SF_SELECTED} have_freetype skip_freetype
949   have_freetype:
950   !insertmacro SelectSection ${SEC_pkgconfig}
951   !insertmacro SelectSection ${SEC_expat}
952   skip_freetype:
953 !endif
954
955 # Package "expat" has no dependencies.
956
957 !ifdef HAVE_PKG_PANGO
958   !insertmacro SectionFlagIsSet ${SEC_pango} \
959                 ${SF_SELECTED} have_pango skip_pango
960   have_pango:
961   !insertmacro SelectSection ${SEC_glib}
962   !insertmacro SelectSection ${SEC_pkgconfig}
963   skip_pango:
964 !endif
965
966 !ifdef HAVE_PKG_ATK
967   !insertmacro SectionFlagIsSet ${SEC_atk} \
968                 ${SF_SELECTED} have_atk skip_atk
969   have_atk:
970   !insertmacro SelectSection ${SEC_glib}
971   !insertmacro SelectSection ${SEC_pkgconfig}
972   skip_atk:
973 !endif
974
975 !ifdef HAVE_PKG_GLIB
976   !insertmacro SectionFlagIsSet ${SEC_glib} \
977                 ${SF_SELECTED} have_glib skip_glib
978   have_glib:
979   !insertmacro SelectSection ${SEC_libiconv}
980   !insertmacro SelectSection ${SEC_gettext}
981   !insertmacro SelectSection ${SEC_pkgconfig}
982   skip_glib:
983 !endif
984
985   # Package "pkgconfig" has no dependencies.
986
987 !ifdef HAVE_PKG_LIBPNG
988   !insertmacro SectionFlagIsSet ${SEC_libpng} \
989                 ${SF_SELECTED} have_libpng skip_libpng
990   have_libpng:
991   !insertmacro SelectSection ${SEC_pkgconfig}
992   skip_libpng:
993 !endif
994
995   # Package "zlib" has no dependencies.
996
997 !ifdef HAVE_PKG_GETTEXT
998   !insertmacro SectionFlagIsSet ${SEC_gettext} \
999                 ${SF_SELECTED} have_gettext skip_gettext
1000   have_gettext:
1001   !insertmacro SelectSection ${SEC_libiconv}
1002   skip_gettext:
1003 !endif
1004
1005   # Package "libiconv" has no dependencies.
1006
1007 FunctionEnd
1008
1009 Function .onInstFailed
1010   Delete $TEMP\gpgspltmp.wav
1011 FunctionEnd
1012
1013 Function .onInstSuccess
1014   ${MementoSectionSave}
1015   Delete $TEMP\gpgspltmp.wav
1016 FunctionEnd
1017
1018 Function .onSelChange
1019   Call CalcDepends
1020 FunctionEnd
1021
1022
1023 # Note used anymore:
1024 # This function is run from the finish page.
1025 #Function RunOnFinish
1026 #!ifdef HAVE_PKG_GPA
1027 #    SectionGetFlags ${SEC_gpa} $R0
1028 #    IntOp $R0 $R0 & ${SF_SELECTED}
1029 #    IntCmp $R0 ${SF_SELECTED} 0 no_gpa_avail
1030 #       Exec "$INSTDIR\gpa.exe"
1031 #       Return
1032 #   no_gpa_avail:
1033 #!endif
1034 #  MessageBox MB_OK "$(T_NoKeyManager)"
1035 #FunctionEnd
1036
1037
1038
1039 # This also must be in a central place.  Also Urgs.
1040
1041 Section "-startmenu"
1042
1043   UserInfo::GetAccountType
1044   Pop $1
1045   StrCmp $1 "Admin" is_admin is_no_admin
1046 is_admin:
1047   SetShellVarContext all
1048
1049 is_no_admin:
1050
1051   # NOT SetOutPath.
1052   StrCpy $OUTDIR "%HOMEDRIVE%%HOMEPATH%"
1053
1054   # Check if the start menu entries where requested.
1055   g4wihelp::config_fetch_bool "inst_start_menu"
1056   StrCmp $R0 "0" no_start_menu
1057
1058 !ifdef HAVE_PKG_GPA
1059     SectionGetFlags ${SEC_gpa} $R0
1060     IntOp $R0 $R0 & ${SF_SELECTED}
1061     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_menu
1062     CreateShortCut "$SMPROGRAMS\GPA.lnk" \
1063         "$INSTDIR\bin\gpa.exe" \
1064         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
1065   no_gpa_menu:
1066 !endif
1067
1068 !ifdef HAVE_PKG_KLEOPATRA
1069     SectionGetFlags ${SEC_kleopatra} $R0
1070     IntOp $R0 $R0 & ${SF_SELECTED}
1071     IntCmp $R0 ${SF_SELECTED} 0 no_kleopatra_menu
1072     CreateShortCut "$SMPROGRAMS\Kleopatra.lnk" \
1073         "$INSTDIR\bin\kleopatra.exe" \
1074         "" "$INSTDIR\bin\kleopatra.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_kleopatra)
1075   no_kleopatra_menu:
1076 !endif
1077
1078  no_start_menu:
1079
1080   # Check if the desktop entries where requested.
1081   g4wihelp::config_fetch_bool "inst_desktop"
1082   StrCmp $R0 "0" no_desktop
1083
1084 !ifdef HAVE_PKG_GPA
1085     SectionGetFlags ${SEC_gpa} $R0
1086     IntOp $R0 $R0 & ${SF_SELECTED}
1087     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_desktop
1088     StrCmp $is_update '1' no_gpa_desktop
1089     CreateShortCut "$DESKTOP\GPA.lnk" \
1090         "$INSTDIR\bin\gpa.exe" \
1091         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
1092   no_gpa_desktop:
1093 !endif
1094
1095 !ifdef HAVE_PKG_KLEOPATRA
1096     SectionGetFlags ${SEC_kleopatra} $R0
1097     IntOp $R0 $R0 & ${SF_SELECTED}
1098     IntCmp $R0 ${SF_SELECTED} 0 no_kleopatra_desktop
1099     StrCmp $is_update '1' no_kleopatra_desktop
1100     CreateShortCut "$DESKTOP\Kleopatra.lnk" \
1101         "$INSTDIR\bin\kleopatra.exe" \
1102         "" "$INSTDIR\bin\kleopatra.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_kleopatra)
1103   no_kleopatra_desktop:
1104 !endif
1105
1106 no_desktop:
1107
1108 SectionEnd