df016090c250f7a674c3239e321f56d980c29b66
[gpg4win.git] / src / inst-sections.nsi
1 # inst-sections.nsi - Installer for GPG4Win sections.  -*- coding: latin-1; -*-
2 # Copyright (C) 2005, 2006 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, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19 # USA.
20
21
22 # Sections
23
24 !include "inst-gpg4win.nsi"
25
26 !ifdef HAVE_PKG_GNUPG
27 !include "inst-gnupg.nsi"
28 !endif
29 !ifdef HAVE_PKG_GNUPG2
30 !include "inst-gnupg2.nsi"
31 !endif
32 !ifdef HAVE_PKG_PINENTRY
33 !include "inst-pinentry.nsi"
34 !endif
35 !ifdef HAVE_PKG_LIBGPG_ERROR
36 !include "inst-libgpg-error.nsi"
37 !endif
38 !ifdef HAVE_PKG_W32PTH
39 !include "inst-w32pth.nsi"
40 !endif
41 !ifdef HAVE_PKG_LIBASSUAN
42 !include "inst-libassuan.nsi"
43 !endif
44 !ifdef HAVE_PKG_LIBKSBA
45 !include "inst-libksba.nsi"
46 !endif
47 !ifdef HAVE_PKG_LIBGCRYPT
48 !include "inst-libgcrypt.nsi"
49 !endif
50 !ifdef HAVE_PKG_LIBICONV
51 !include "inst-libiconv.nsi"
52 !endif
53 !ifdef HAVE_PKG_PKGCONFIG
54 !include "inst-pkgconfig.nsi"
55 !endif
56 !ifdef HAVE_PKG_ZLIB
57 !include "inst-zlib.nsi"
58 !endif
59 !ifdef HAVE_PKG_CRYPT
60 !include "inst-crypt.nsi"
61 !endif
62 !ifdef HAVE_PKG_REGEX
63 !include "inst-regex.nsi"
64 !endif
65 !ifdef HAVE_PKG_PTHREADS_W32
66 !include "inst-pthreads-w32.nsi"
67 !endif
68 !ifdef HAVE_PKG_GPGME
69 !include "inst-gpgme.nsi"
70 !endif
71 !ifdef HAVE_PKG_GETTEXT
72 !include "inst-gettext.nsi"
73 !endif
74 !ifdef HAVE_PKG_GLIB
75 !include "inst-glib.nsi"
76 !endif
77 !ifdef HAVE_PKG_LIBPNG
78 !include "inst-libpng.nsi"
79 !endif
80 !ifdef HAVE_PKG_JPEG
81 !include "inst-jpeg.nsi"
82 !endif
83 !ifdef HAVE_PKG_GPGOL
84 !include "inst-gpgol.nsi"
85 !endif
86 !ifdef HAVE_PKG_PANGO
87 !include "inst-pango.nsi"
88 !endif
89 !ifdef HAVE_PKG_CAIRO
90 !include "inst-cairo.nsi"
91 !endif
92 !ifdef HAVE_PKG_ATK
93 !include "inst-atk.nsi"
94 !endif
95 !ifdef HAVE_PKG_GTK_
96 !include "inst-gtk+.nsi"
97 !endif
98 !ifdef HAVE_PKG_GPA
99 !include "inst-gpa.nsi"
100 !endif
101 !ifdef HAVE_PKG_WINPT
102 !include "inst-winpt.nsi"
103 !endif
104 !ifdef HAVE_PKG_GPGEE
105 !include "inst-gpgee.nsi"
106 !endif
107 !ifdef HAVE_PKG_SYLPHEED_CLAWS
108 !include "inst-sylpheed-claws.nsi"
109 !endif
110 !ifdef HAVE_PKG_CLAWS_MAIL
111 !include "inst-claws-mail.nsi"
112 !endif
113 #!ifdef HAVE_PKG_EUDORAGPG
114 #!include "inst-eudoragpg.nsi"
115 #!endif
116 !ifdef HAVE_PKG_MAN_NOVICE_EN
117 !include "inst-man_novice_en.nsi"
118 !endif
119 !ifdef HAVE_PKG_MAN_ADVANCED_EN
120 !include "inst-man_advanced_en.nsi"
121 !endif
122 !ifdef HAVE_PKG_MAN_NOVICE_DE
123 !include "inst-man_novice_de.nsi"
124 !endif
125 !ifdef HAVE_PKG_MAN_ADVANCED_DE
126 !include "inst-man_advanced_de.nsi"
127 !endif
128
129 # We have to invoke the uninstallers in reverse order!
130
131 !ifdef HAVE_PKG_MAN_ADVANCED_DE
132 !include "uninst-man_advanced_de.nsi"
133 !endif
134 !ifdef HAVE_PKG_MAN_NOVICE_DE
135 !include "uninst-man_novice_de.nsi"
136 !endif
137 !ifdef HAVE_PKG_MAN_ADVANCED_EN
138 !include "uninst-man_advanced_en.nsi"
139 !endif
140 !ifdef HAVE_PKG_MAN_NOVICE_EN
141 !include "uninst-man_novice_en.nsi"
142 !endif
143 #!ifdef HAVE_PKG_EUDORAGPG
144 #!include "uninst-eudoragpg.nsi"
145 #!endif
146 !ifdef HAVE_PKG_SYLPHEED_CLAWS
147 !include "uninst-sylpheed-claws.nsi"
148 !endif
149 !ifdef HAVE_PKG_CLAWS_MAIL
150 !include "uninst-claws-mail.nsi"
151 !endif
152 !ifdef HAVE_PKG_GPGEE
153 !include "uninst-gpgee.nsi"
154 !endif
155 !ifdef HAVE_PKG_WINPT
156 !include "uninst-winpt.nsi"
157 !endif
158 !ifdef HAVE_PKG_GPA
159 !include "uninst-gpa.nsi"
160 !endif
161 !ifdef HAVE_PKG_GTK_
162 !include "uninst-gtk+.nsi"
163 !endif
164 !ifdef HAVE_PKG_ATK
165 !include "uninst-atk.nsi"
166 !endif
167 !ifdef HAVE_PKG_CAIRO
168 !include "uninst-cairo.nsi"
169 !endif
170 !ifdef HAVE_PKG_PANGO
171 !include "uninst-pango.nsi"
172 !endif
173 !ifdef HAVE_PKG_GPGOL
174 !include "uninst-gpgol.nsi"
175 !endif
176 !ifdef HAVE_PKG_LIBPNG
177 !include "uninst-libpng.nsi"
178 !endif
179 !ifdef HAVE_PKG_JPEG
180 !include "uninst-jpeg.nsi"
181 !endif
182 !ifdef HAVE_PKG_GLIB
183 !include "uninst-glib.nsi"
184 !endif
185 !ifdef HAVE_PKG_GETTEXT
186 !include "uninst-gettext.nsi"
187 !endif
188 !ifdef HAVE_PKG_GPGME
189 !include "uninst-gpgme.nsi"
190 !endif
191 !ifdef HAVE_PKG_PTHREADS_W32
192 !include "uninst-pthreads-w32.nsi"
193 !endif
194 !ifdef HAVE_PKG_REGEX
195 !include "uninst-regex.nsi"
196 !endif
197 !ifdef HAVE_PKG_CRYPT
198 !include "uninst-crypt.nsi"
199 !endif
200 !ifdef HAVE_PKG_ZLIB
201 !include "uninst-zlib.nsi"
202 !endif
203 !ifdef HAVE_PKG_PKGCONFIG
204 !include "uninst-pkgconfig.nsi"
205 !endif
206 !ifdef HAVE_PKG_LIBICONV
207 !include "uninst-libiconv.nsi"
208 !endif
209 !ifdef HAVE_PKG_LIBGCRYPT
210 !include "uninst-libgcrypt.nsi"
211 !endif
212 !ifdef HAVE_PKG_LIBKSBA
213 !include "uninst-libksba.nsi"
214 !endif
215 !ifdef HAVE_PKG_LIBASSUAN
216 !include "uninst-libassuan.nsi"
217 !endif
218 !ifdef HAVE_PKG_W32PTH
219 !include "uninst-w32pth.nsi"
220 !endif
221 !ifdef HAVE_PKG_LIBGPG_ERROR
222 # Note that the uninstaller of libgpg-error is supposed to remove the shareed
223 # directories.  We might want to move this to an extra section.
224 !include "uninst-libgpg-error.nsi"
225 !endif
226 !ifdef HAVE_PKG_PINENTRY
227 !include "uninst-pinentry.nsi"
228 !endif
229 !ifdef HAVE_PKG_GNUPG2
230 !include "uninst-gnupg2.nsi"
231 !endif
232 !ifdef HAVE_PKG_GNUPG
233 !include "uninst-gnupg.nsi"
234 !endif
235
236 !include "uninst-gpg4win.nsi"
237
238
239 # Dependency Management
240
241 !include "Sections.nsh"
242
243 Function CalcDepends
244   # This section could very well be autogenerated from the
245   # information in configure.ac.  Note that it doesn't hurt to have
246   # stuff here for packages that we don't include.
247
248   # First clear all indirect dependencies.
249 !ifdef HAVE_PKG_LIBICONV
250   !insertmacro UnselectSection ${SEC_libiconv}
251 !endif
252 !ifdef HAVE_PKG_GETTEXT
253   !insertmacro UnselectSection ${SEC_gettext}
254 !endif
255 !ifdef HAVE_PKG_ZLIB
256   !insertmacro UnselectSection ${SEC_zlib}
257 !endif
258 !ifdef HAVE_PKG_CRYPT
259   !insertmacro UnselectSection ${SEC_crypt}
260 !endif
261 !ifdef HAVE_PKG_REGEX
262   !insertmacro UnselectSection ${SEC_regex}
263 !endif
264 !ifdef HAVE_PKG_PTHREADS_W32
265   !insertmacro UnselectSection ${SEC_pthreads_w32}
266 !endif
267 !ifdef HAVE_PKG_LIBPNG
268   !insertmacro UnselectSection ${SEC_libpng}
269 !endif
270 !ifdef HAVE_PKG_JPEG
271   !insertmacro UnselectSection ${SEC_jpeg}
272 !endif
273 !ifdef HAVE_PKG_PKGCONFIG
274   !insertmacro UnselectSection ${SEC_pkgconfig}
275 !endif
276 !ifdef HAVE_PKG_GLIB
277   !insertmacro UnselectSection ${SEC_glib}
278 !endif
279 !ifdef HAVE_PKG_ATK
280   !insertmacro UnselectSection ${SEC_atk}
281 !endif
282 !ifdef HAVE_PKG_CAIRO
283   !insertmacro UnselectSection ${SEC_cairo}
284 !endif
285 !ifdef HAVE_PKG_PANGO
286   !insertmacro UnselectSection ${SEC_pango}
287 !endif
288 !ifdef HAVE_PKG_GTK_
289   !insertmacro UnselectSection ${SEC_gtk_}
290 !endif
291 !ifdef HAVE_PKG_LIBGPG_ERROR
292   !insertmacro UnselectSection ${SEC_libgpg_error}
293 !endif
294 !ifdef HAVE_PKG_GPGME
295   !insertmacro UnselectSection ${SEC_gpgme}
296 !endif
297 !ifdef HAVE_PKG_LIBKSBA
298   !insertmacro UnselectSection ${SEC_libksba}
299 !endif
300 !ifdef HAVE_PKG_W32PTH
301   !insertmacro UnselectSection ${SEC_w32pth}
302 !endif
303 !ifdef HAVE_PKG_LIBASSUAN
304   !insertmacro UnselectSection ${SEC_libassuan}
305 !endif
306 !ifdef HAVE_PKG_LIBGCRYPT
307   !insertmacro UnselectSection ${SEC_libgcrypt}
308 !endif
309 !ifdef HAVE_PKG_PINENTRY
310   !insertmacro UnselectSection ${SEC_pinentry}
311 !endif
312
313   # Then enable all dependencies in reverse build list order!
314
315 !ifdef HAVE_PKG_GNUPG2
316   !insertmacro SectionFlagIsSet ${SEC_gnupg2} ${SF_SELECTED} have_gnupg2 skip_gnupg2
317   have_gnupg2:
318   !insertmacro SelectSection ${SEC_libiconv}
319   !insertmacro SelectSection ${SEC_libgcrypt}
320   !insertmacro SelectSection ${SEC_libksba}
321   !insertmacro SelectSection ${SEC_libassuan}
322   !insertmacro SelectSection ${SEC_libgpg_error}
323   !insertmacro SelectSection ${SEC_w32pth}
324   !insertmacro SelectSection ${SEC_zlib}
325   !insertmacro SelectSection ${SEC_pinentry}
326   skip_gnupg2:
327 !endif
328
329 !ifdef HAVE_PKG_GPGEE
330   !insertmacro SectionFlagIsSet ${SEC_gpgee} ${SF_SELECTED} have_gpgee skip_gpgee
331   have_gpgee:
332   !insertmacro SelectSection ${SEC_gpgme}
333   !insertmacro SelectSection ${SEC_gnupg}
334   skip_gpgee:
335 !endif
336
337 !ifdef HAVE_PKG_WINPT
338   !insertmacro SectionFlagIsSet ${SEC_winpt} ${SF_SELECTED} have_winpt skip_winpt
339   have_winpt:
340   !insertmacro SelectSection ${SEC_gpgme}
341   !insertmacro SelectSection ${SEC_gnupg}
342   skip_winpt:
343 !endif
344
345 !ifdef HAVE_PKG_GPA
346   !insertmacro SectionFlagIsSet ${SEC_gpa} ${SF_SELECTED} have_gpa skip_gpa
347   have_gpa:
348   !insertmacro SelectSection ${SEC_zlib}
349   !insertmacro SelectSection ${SEC_gtk_}
350   !insertmacro SelectSection ${SEC_libpng}
351   !insertmacro SelectSection ${SEC_glib}
352   !insertmacro SelectSection ${SEC_gpgme}
353   !insertmacro SelectSection ${SEC_gnupg}
354   skip_gpa:
355 !endif
356
357 !ifdef HAVE_PKG_SYLPHEED_CLAWS
358   !insertmacro SectionFlagIsSet ${SEC_sylpheed} ${SF_SELECTED} have_sylpheed skip_sylpheed
359   have_sylpheed:
360   !insertmacro SelectSection ${SEC_zlib}
361   !insertmacro SelectSection ${SEC_gtk_}
362   !insertmacro SelectSection ${SEC_libpng}
363   !insertmacro SelectSection ${SEC_jpeg}
364   !insertmacro SelectSection ${SEC_glib}
365   !insertmacro SelectSection ${SEC_gpgme}
366   !insertmacro SelectSection ${SEC_gnupg}
367   !insertmacro SelectSection ${SEC_pthreads_w32}
368   !insertmacro SelectSection ${SEC_crypt}
369   !insertmacro SelectSection ${SEC_regex}
370   skip_sylpheed:
371 !endif
372
373
374 !ifdef HAVE_PKG_CLAWS_MAIL
375   !insertmacro SectionFlagIsSet ${SEC_claws_mail} ${SF_SELECTED} have_claws_mail skip_claws_mail
376   have_claws_mail:
377   !insertmacro SelectSection ${SEC_zlib}
378   !insertmacro SelectSection ${SEC_gtk_}
379   !insertmacro SelectSection ${SEC_libpng}
380   !insertmacro SelectSection ${SEC_jpeg}
381   !insertmacro SelectSection ${SEC_glib}
382   !insertmacro SelectSection ${SEC_gpgme}
383   !insertmacro SelectSection ${SEC_gnupg}
384   !insertmacro SelectSection ${SEC_pthreads_w32}
385   !insertmacro SelectSection ${SEC_crypt}
386   !insertmacro SelectSection ${SEC_regex}
387   skip_claws_mail:
388 !endif
389
390
391 !ifdef HAVE_PKG_GTK_
392   !insertmacro SectionFlagIsSet ${SEC_gtk_} \
393                 ${SF_SELECTED} have_gtk_ skip_gtk_
394   have_gtk_:
395   !insertmacro SelectSection ${SEC_atk}
396   !insertmacro SelectSection ${SEC_cairo}
397   !insertmacro SelectSection ${SEC_pango}
398   !insertmacro SelectSection ${SEC_glib}
399   !insertmacro SelectSection ${SEC_libiconv}
400   !insertmacro SelectSection ${SEC_gettext}
401   !insertmacro SelectSection ${SEC_pkgconfig}
402   skip_gtk_:
403 !endif
404
405 !ifdef HAVE_PKG_ATK
406   !insertmacro SectionFlagIsSet ${SEC_atk} \
407                 ${SF_SELECTED} have_atk skip_atk
408   have_atk:
409   !insertmacro SelectSection ${SEC_glib}
410   !insertmacro SelectSection ${SEC_pkgconfig}
411   skip_atk:
412 !endif
413
414 !ifdef HAVE_PKG_CAIRO
415   !insertmacro SectionFlagIsSet ${SEC_cairo} \
416                 ${SF_SELECTED} have_cairo skip_cairo
417   have_cairo:
418   !insertmacro SelectSection ${SEC_glib}
419   !insertmacro SelectSection ${SEC_pkgconfig}
420   skip_cairo:
421 !endif
422
423 !ifdef HAVE_PKG_PANGO
424   !insertmacro SectionFlagIsSet ${SEC_pango} \
425                 ${SF_SELECTED} have_pango skip_pango
426   have_pango:
427   !insertmacro SelectSection ${SEC_glib}
428   !insertmacro SelectSection ${SEC_pkgconfig}
429   skip_pango:
430 !endif
431
432 !ifdef HAVE_PKG_GPGOL
433   !insertmacro SectionFlagIsSet ${SEC_gpgol} \
434                 ${SF_SELECTED} have_gpgol skip_gpgol
435   have_gpgol:
436   !insertmacro SelectSection ${SEC_gpgme}
437   !insertmacro SelectSection ${SEC_gnupg}
438   skip_gpgol:
439 !endif
440
441 !ifdef HAVE_PKG_LIBPNG
442   !insertmacro SectionFlagIsSet ${SEC_libpng} \
443                 ${SF_SELECTED} have_libpng skip_libpng
444   have_libpng:
445   !insertmacro SelectSection ${SEC_pkgconfig}
446   skip_libpng:
447 !endif
448
449 !ifdef HAVE_PKG_GLIB
450   !insertmacro SectionFlagIsSet ${SEC_glib} \
451                 ${SF_SELECTED} have_glib skip_glib
452   have_glib:
453   !insertmacro SelectSection ${SEC_pkgconfig}
454   skip_glib:
455 !endif
456
457 !ifdef HAVE_PKG_GETTEXT
458   !insertmacro SectionFlagIsSet ${SEC_gettext} \
459                 ${SF_SELECTED} have_gettext skip_gettext
460   have_gettext:
461   !insertmacro SelectSection ${SEC_libiconv}
462   skip_gettext:
463 !endif
464
465 !ifdef HAVE_PKG_GPGME
466   !insertmacro SectionFlagIsSet ${SEC_gpgme} \
467                 ${SF_SELECTED} have_gpgme skip_gpgme
468   have_gpgme:
469   !insertmacro SelectSection ${SEC_libgpg_error}
470   skip_gpgme:
471 !endif
472
473   # Package "zlib" has no dependencies.
474   # Package "pkgconfig" has no dependencies.
475   # Package "libgpg-error" has no dependencies.
476
477 !ifdef HAVE_PKG_GNUPG
478   !insertmacro SectionFlagIsSet ${SEC_gnupg} ${SF_SELECTED} have_gnupg skip_gnupg
479   have_gnupg:
480   !insertmacro SelectSection ${SEC_libiconv}
481   skip_gnupg:
482 !endif
483
484   # Package "libiconv" has no dependencies.
485
486 FunctionEnd
487
488
489 Function .onInit
490 Call G4wRunOnce
491
492   SetOutPath $TEMP
493 !ifdef SOURCES
494   File /oname=gpgspltmp.bmp "${TOP_SRCDIR}/doc/logo/gpg4win-logo-400px.bmp"
495   # We play the tune only for the soruce installer
496   File /oname=gpgspltmp.wav "${TOP_SRCDIR}/src/gpg4win-splash.wav"
497   g4wihelp::playsound $TEMP\gpgspltmp.wav
498   g4wihelp::showsplash 2500 $TEMP\gpgspltmp.bmp
499
500   Delete $TEMP\gpgspltmp.bmp
501   # Note that we delete gpgspltmp.wav in .onInst{Failed,Success}
502 !endif
503
504   # We can't use TOP_SRCDIR dir as the name of the file needs to be
505   # the same while building and running the installer.  Thus we
506   # generate the file from a template.
507   !insertmacro MUI_INSTALLOPTIONS_EXTRACT "installer-options.ini"
508
509   Call CalcDepends
510   Call CheckOtherGnuPGApps
511 FunctionEnd
512
513
514 Function .onInstFailed
515   Delete $TEMP\gpgspltmp.wav
516 FunctionEnd
517
518 Function .onInstSuccess
519   Delete $TEMP\gpgspltmp.wav
520 FunctionEnd
521
522 Function .onSelChange
523   Call CalcDepends
524 FunctionEnd
525
526
527 # Note used anymore:
528 # This function is run from the finish page.
529 #Function RunOnFinish
530 #!ifdef HAVE_PKG_GPA
531 #    SectionGetFlags ${SEC_gpa} $R0 
532 #    IntOp $R0 $R0 & ${SF_SELECTED} 
533 #    IntCmp $R0 ${SF_SELECTED} 0 no_gpa_avail
534 #       Exec "$INSTDIR\gpa.exe"
535 #       Return
536 #   no_gpa_avail:
537 #!endif
538 #!ifdef HAVE_PKG_WINPT
539 #    SectionGetFlags ${SEC_winpt} $R0 
540 #    IntOp $R0 $R0 & ${SF_SELECTED} 
541 #    IntCmp $R0 ${SF_SELECTED} 0 no_winpt_avail
542 #       Exec "$INSTDIR\WinPT.exe --keymanager"
543 #       Return
544 #   no_winpt_avail:
545 #!endif
546 #  MessageBox MB_OK "$(T_NoKeyManager)"
547 #FunctionEnd
548
549
550 # This must be in a central place.  Urgs.
551
552 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
553 !ifdef HAVE_PKG_GNUPG
554   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gnupg} $(DESC_SEC_gnupg)
555 !endif
556 !ifdef HAVE_PKG_GPGOL
557   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gpgol} $(DESC_SEC_gpgol)
558 !endif
559 !ifdef HAVE_PKG_GPA
560   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gpa} $(DESC_SEC_gpa)
561 !endif
562 !ifdef HAVE_PKG_WINPT
563   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_winpt} $(DESC_SEC_winpt)
564 !endif
565 !ifdef HAVE_PKG_GPGEE
566   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_gpgee} $(DESC_SEC_gpgee)
567 !endif
568 !ifdef HAVE_PKG_SYLPHEED_CLAWS
569   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_sylpheed} $(DESC_SEC_sylpheed)
570 !endif
571 !ifdef HAVE_PKG_CLAWS_MAIL
572   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_claws_mail} $(DESC_SEC_claws_mail)
573 !endif
574 #!ifdef HAVE_PKG_EUDORAGPG
575 #  !insertmacro MUI_DESCRIPTION_TEXT ${SEC_eudoragpg} $(DESC_SEC_eudoragpg)
576 #!endif
577 !ifdef HAVE_PKG_MAN_NOVICE_EN
578   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_man_novice_en} $(DESC_SEC_man_novice_en)
579 !endif
580 !ifdef HAVE_PKG_MAN_ADVANCED_EN
581   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_man_advanced_en} $(DESC_SEC_man_advanced_en)
582 !endif
583 !ifdef HAVE_PKG_MAN_NOVICE_DE
584   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_man_novice_de} $(DESC_SEC_man_novice_de)
585 !endif
586 !ifdef HAVE_PKG_MAN_ADVANCED_DE
587   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_man_advanced_de} $(DESC_SEC_man_advanced_de)
588 !endif
589 !insertmacro MUI_FUNCTION_DESCRIPTION_END
590
591
592 # This also must be in a central place.  Also Urgs.
593
594 Section "-startmenu"
595
596 !ifdef HAVE_STARTMENU
597   # Make sure that the context of the automatic variables has been set to
598   # the "all users" shell folder.  This guarantees that the menu gets written
599   # for all users.  We have already checked that we are running as Admin; or
600   # we printed a warning that installation will not succeed.
601   SetShellVarContext all
602
603   # Check if the start menu entries where requested.
604   !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
605         "Field 2" "State"
606   IntCmp $R0 0 no_start_menu
607
608 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
609     CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
610
611 !ifdef HAVE_PKG_WINPT
612     SectionGetFlags ${SEC_winpt} $R0 
613     IntOp $R0 $R0 & ${SF_SELECTED} 
614     IntCmp $R0 ${SF_SELECTED} 0 no_winpt_menu 
615     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\WinPT.lnk" \
616         "$INSTDIR\winpt.exe" \
617         "" "$INSTDIR\winpt.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_winpt)
618    no_winpt_menu:
619 !endif
620
621 !ifdef HAVE_PKG_GPA
622     SectionGetFlags ${SEC_gpa} $R0 
623     IntOp $R0 $R0 & ${SF_SELECTED} 
624     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_menu 
625     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GPA.lnk" \
626         "$INSTDIR\gpa.exe" \
627         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
628   no_gpa_menu:
629 !endif
630
631 !ifdef HAVE_PKG_SYLPHEED_CLAWS
632     SectionGetFlags ${SEC_sylpheed} $R0 
633     IntOp $R0 $R0 & ${SF_SELECTED} 
634     IntCmp $R0 ${SF_SELECTED} 0 no_sylpheed_menu 
635     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Sylpheed-Claws.lnk" \
636         "$INSTDIR\sylpheed-claws.exe" \
637         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_sylpheed)
638 !ifndef GPG4WIN_LIGHT
639     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Sylpheed-Claws Manual.lnk" \
640         "$INSTDIR\sylpheed-claws-manual.pdf" \
641         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_sylpheed_pdf)
642 !endif
643   no_sylpheed_menu:
644 !endif
645
646 !ifdef HAVE_PKG_CLAWS_MAIL
647     SectionGetFlags ${SEC_claws_mail} $R0 
648     IntOp $R0 $R0 & ${SF_SELECTED} 
649     IntCmp $R0 ${SF_SELECTED} 0 no_claws_mail_menu 
650     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Claws-Mail.lnk" \
651         "$INSTDIR\claws-mail.exe" \
652         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail)
653 !ifndef GPG4WIN_LIGHT
654     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Claws-Mail Manual.lnk" \
655         "$INSTDIR\claws-mail-manual.pdf" \
656         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail_pdf)
657 !endif
658   no_claws_mail_menu:
659 !endif
660
661 #!ifdef HAVE_PKG_EUDORAGPG
662 #    SectionGetFlags ${SEC_eudoragpg} $R0 
663 #    IntOp $R0 $R0 & ${SF_SELECTED} 
664 #    IntCmp $R0 ${SF_SELECTED} 0 no_eudoragpg_menu 
665 #    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\EudoraGPG Plugin.lnk" \
666 #       "$INSTDIR\share\eudoragpg\eudoragpg.html" \
667 #        "" "" "" SW_SHOWNORMAL "" ""
668 #  no_eudoragpg_menu:
669 #!endif
670
671 !ifdef HAVE_PKG_MAN_NOVICE_EN
672     SectionGetFlags ${SEC_man_novice_en} $R0 
673     IntOp $R0 $R0 & ${SF_SELECTED} 
674     IntCmp $R0 ${SF_SELECTED} 0 no_man_novice_en_menu 
675     CreateShortCut \
676         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Name_man_novice_en).lnk" \
677         "$INSTDIR\share\gpg4win\novices.pdf" \
678         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_novice_en)
679   no_man_novice_en_menu:
680 !endif
681
682 !ifdef HAVE_PKG_MAN_ADVANCED_EN
683     SectionGetFlags ${SEC_man_advanced_en} $R0 
684     IntOp $R0 $R0 & ${SF_SELECTED} 
685     IntCmp $R0 ${SF_SELECTED} 0 no_man_advanced_en_menu 
686     CreateShortCut \
687         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Name_man_advanced_en).lnk" \
688         "$INSTDIR\share\gpg4win\advanced.pdf" \
689         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_advanced_en)
690   no_man_advanced_en_menu:
691 !endif
692
693 !ifdef HAVE_PKG_MAN_NOVICE_DE
694     SectionGetFlags ${SEC_man_novice_de} $R0 
695     IntOp $R0 $R0 & ${SF_SELECTED} 
696     IntCmp $R0 ${SF_SELECTED} 0 no_man_novice_de_menu 
697     CreateShortCut \
698         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Name_man_novice_de).lnk" \
699         "$INSTDIR\share\gpg4win\einsteiger.pdf" \
700         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_novice_de)
701   no_man_novice_de_menu:
702 !endif
703
704 !ifdef HAVE_PKG_MAN_ADVANCED_DE
705     SectionGetFlags ${SEC_man_advanced_de} $R0 
706     IntOp $R0 $R0 & ${SF_SELECTED} 
707     IntCmp $R0 ${SF_SELECTED} 0 no_man_advanced_de_menu 
708     CreateShortCut \
709         "$SMPROGRAMS\$STARTMENU_FOLDER\$(DESC_Name_man_advanced_de).lnk" \
710         "$INSTDIR\share\gpg4win\durchblicker.pdf" \
711         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_advanced_de)
712   no_man_advanced_de_menu:
713 !endif
714
715 !ifdef HAVE_PKG_GPGEE
716     SectionGetFlags ${SEC_gpgee} $R0 
717     IntOp $R0 $R0 & ${SF_SELECTED} 
718     IntCmp $R0 ${SF_SELECTED} 0 no_gpgee_menu 
719     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GPGee Manual.lnk" \
720         "$INSTDIR\GPGee.hlp" "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpgee_hlp)
721   no_gpgee_menu:
722 !endif
723
724     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG FAQ.lnk" \
725                    "$INSTDIR\share\gnupg\faq.html" \
726                    "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gnupg_faq)
727
728     CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Gpg4Win README.lnk" \
729                    "$INSTDIR\share\gpg4win\README.$(T_LangCode).txt" \
730                    "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpg4win_readme)
731
732 # No more uninstall link because Windows has its own feature to call
733 #  the uninstaller.
734 #    CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" \
735 #       "$INSTDIR\${PACKAGE}-uninstall.exe"
736 !insertmacro MUI_STARTMENU_WRITE_END
737
738  no_start_menu:
739
740
741
742   # Check if the desktop entries where requested.
743   !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
744         "Field 3" "State"
745   IntCmp $R0 0 no_desktop
746
747 !ifdef HAVE_PKG_WINPT
748     SectionGetFlags ${SEC_winpt} $R0 
749     IntOp $R0 $R0 & ${SF_SELECTED}
750     IntCmp $R0 ${SF_SELECTED} 0 no_winpt_desktop
751     # Create link which directly starts the WinPT key manager
752     CreateShortCut "$DESKTOP\WinPT.lnk" \
753         "$INSTDIR\winpt.exe" \
754         "--keymanager" "$INSTDIR\winpt.exe" "" \
755         SW_SHOWNORMAL "" $(DESC_Menu_winpt)
756    no_winpt_desktop:
757 !endif
758
759 !ifdef HAVE_PKG_GPA
760     SectionGetFlags ${SEC_gpa} $R0 
761     IntOp $R0 $R0 & ${SF_SELECTED} 
762     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_desktop
763     CreateShortCut "$DESKTOP\GPA.lnk" \
764         "$INSTDIR\gpa.exe" \
765         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
766   no_gpa_desktop:
767 !endif
768
769 !ifdef HAVE_PKG_SYLPHEED_CLAWS
770     SectionGetFlags ${SEC_sylpheed} $R0 
771     IntOp $R0 $R0 & ${SF_SELECTED} 
772     IntCmp $R0 ${SF_SELECTED} 0 no_sylpheed_desktop
773     CreateShortCut "$DESKTOP\Sylpheed-Claws.lnk" \
774         "$INSTDIR\sylpheed-claws.exe" \
775         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_sylpheed)
776 !ifndef GPG4WIN_LIGHT
777     CreateShortCut "$DESKTOP\Sylpheed-Claws Manual.lnk" \
778         "$INSTDIR\sylpheed-claws-manual.pdf" \
779         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_sylpheed_pdf)
780 !endif
781   no_sylpheed_desktop:
782 !endif
783
784 !ifdef HAVE_PKG_CLAWS_MAIL
785     SectionGetFlags ${SEC_claws_mail} $R0 
786     IntOp $R0 $R0 & ${SF_SELECTED} 
787     IntCmp $R0 ${SF_SELECTED} 0 no_claws_mail_desktop
788     CreateShortCut "$DESKTOP\Claws-Mail.lnk" \
789         "$INSTDIR\claws-mail.exe" \
790         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail)
791 !ifndef GPG4WIN_LIGHT
792     CreateShortCut "$DESKTOP\Claws-Mail Manual.lnk" \
793         "$INSTDIR\claws-mail-manual.pdf" \
794         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail_pdf)
795 !endif
796   no_claws_mail_desktop:
797 !endif
798
799 !ifdef HAVE_PKG_MAN_NOVICE_EN
800     SectionGetFlags ${SEC_man_novice_en} $R0 
801     IntOp $R0 $R0 & ${SF_SELECTED} 
802     IntCmp $R0 ${SF_SELECTED} 0 no_man_novice_en_desktop
803     CreateShortCut \
804         "$DESKTOP\$(DESC_Name_man_novice_en).lnk" \
805         "$INSTDIR\share\gpg4win\novices.pdf" \
806         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_novice_en)
807   no_man_novice_en_desktop:
808 !endif
809
810 !ifdef HAVE_PKG_MAN_ADVANCED_EN
811     SectionGetFlags ${SEC_man_advanced_en} $R0 
812     IntOp $R0 $R0 & ${SF_SELECTED} 
813     IntCmp $R0 ${SF_SELECTED} 0 no_man_advanced_en_desktop
814     CreateShortCut \
815         "$DESKTOP\$(DESC_Name_man_advanced_en).lnk" \
816         "$INSTDIR\share\gpg4win\advanced.pdf" \
817         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_advanced_en)
818   no_man_advanced_en_desktop:
819 !endif
820
821 !ifdef HAVE_PKG_MAN_NOVICE_DE
822     SectionGetFlags ${SEC_man_novice_de} $R0 
823     IntOp $R0 $R0 & ${SF_SELECTED} 
824     IntCmp $R0 ${SF_SELECTED} 0 no_man_novice_de_desktop
825     CreateShortCut \
826         "$DESKTOP\$(DESC_Name_man_novice_de).lnk" \
827         "$INSTDIR\share\gpg4win\einsteiger.pdf" \
828         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_novice_de)
829   no_man_novice_de_desktop:
830 !endif
831
832 !ifdef HAVE_PKG_MAN_ADVANCED_DE
833     SectionGetFlags ${SEC_man_advanced_de} $R0 
834     IntOp $R0 $R0 & ${SF_SELECTED} 
835     IntCmp $R0 ${SF_SELECTED} 0 no_man_advanced_de_desktop
836     CreateShortCut \
837         "$DESKTOP\$(DESC_Name_man_advanced_de).lnk" \
838         "$INSTDIR\share\gpg4win\durchblicker.pdf" \
839         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_man_advanced_de)
840   no_man_advanced_de_desktop:
841 !endif
842
843 !ifdef HAVE_PKG_GPGEE
844     SectionGetFlags ${SEC_gpgee} $R0 
845     IntOp $R0 $R0 & ${SF_SELECTED} 
846     IntCmp $R0 ${SF_SELECTED} 0 no_gpgee_desktop
847     CreateShortCut "$DESKTOP\GPGee Manual.lnk" \
848         "$INSTDIR\GPGee.hlp" "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpgee_hlp)
849   no_gpgee_desktop:
850 !endif
851
852     CreateShortCut "$DESKTOP\GnuPG FAQ.lnk" \
853                    "$INSTDIR\share\gnupg\faq.html" \
854                    "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gnupg_faq)
855
856 no_desktop:
857
858         
859   # Check if the quick launch bar entries where requested.
860   !insertmacro MUI_INSTALLOPTIONS_READ $R0 "installer-options.ini" \
861         "Field 4" "State"
862   IntCmp $R0 0 no_quick_launch
863   StrCmp $QUICKLAUNCH $TEMP no_quick_launch
864
865 !ifdef HAVE_PKG_WINPT
866     SectionGetFlags ${SEC_winpt} $R0 
867     IntOp $R0 $R0 & ${SF_SELECTED}
868     IntCmp $R0 ${SF_SELECTED} 0 no_winpt_quicklaunch 
869     CreateShortCut "$QUICKLAUNCH\WinPT.lnk" \
870         "$INSTDIR\winpt.exe" \
871         "" "$INSTDIR\winpt.exe" "" SW_SHOWNORMAL "" $(DESC_Menu_winpt)
872    no_winpt_quicklaunch:
873 !endif
874
875 !ifdef HAVE_PKG_GPA
876     SectionGetFlags ${SEC_gpa} $R0 
877     IntOp $R0 $R0 & ${SF_SELECTED} 
878     IntCmp $R0 ${SF_SELECTED} 0 no_gpa_quicklaunch
879     CreateShortCut "$QUICKLAUNCH\GPA.lnk" \
880         "$INSTDIR\gpa.exe" \
881         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_gpa)
882   no_gpa_quicklaunch:
883 !endif
884
885 !ifdef HAVE_PKG_SYLPHEED_CLAWS
886     SectionGetFlags ${SEC_sylpheed} $R0 
887     IntOp $R0 $R0 & ${SF_SELECTED} 
888     IntCmp $R0 ${SF_SELECTED} 0 no_sylpheed_quicklaunch
889     CreateShortCut "$QUICKLAUNCH\Sylpheed-Claws.lnk" \
890         "$INSTDIR\sylpheed-claws.exe" \
891         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_sylpheed)
892   no_sylpheed_quicklaunch:
893 !endif
894
895 !ifdef HAVE_PKG_CLAWS_MAIL
896     SectionGetFlags ${SEC_claws_mail} $R0 
897     IntOp $R0 $R0 & ${SF_SELECTED} 
898     IntCmp $R0 ${SF_SELECTED} 0 no_claws_mail_quicklaunch
899     CreateShortCut "$QUICKLAUNCH\Claws-Mail.lnk" \
900         "$INSTDIR\claws-mail.exe" \
901         "" "" "" SW_SHOWNORMAL "" $(DESC_Menu_claws_mail)
902   no_claws_mail_quicklaunch:
903 !endif
904
905
906 no_quick_launch:
907
908
909 !endif
910 SectionEnd
911
912
913 # FIXME: Now write desktop and quick launch bar.
914 # Don't forget to delete the corr. entries in installer-finish. Uninstall.
915