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