MSI: Fix possible use of unintialized variable
[gpg4win.git] / src / inst-kleopatra.nsi
1 # inst-kleopatra.nsi - Installer snippet for kleopatra.      -*- coding: latin-1; -*-
2 # Copyright (C) 2005, 2007, 2008 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
20
21 !ifdef prefix
22 !undef prefix
23 !endif
24 !define prefix ${ipdir}/kleopatra-${gpg4win_pkg_kleopatra_version}
25
26 ${MementoSection} "Kleopatra" SEC_kleopatra
27   SetOutPath "$INSTDIR"
28 !ifdef SOURCES
29   # Kleopatra Source Package also contains kdepimlibs, kdelibs and
30   # kde-runtime, as well as win-iconv and attica
31   File "${gpg4win_pkg_kleopatra}"
32 !else
33
34   SetOutPath "$INSTDIR\bin"
35   File ${prefix}/bin/kleopatra.exe
36   #File ${prefix}/bin/kwatchgnupg.exe
37
38   File ${prefix}/bin/libkleopatraclientcore.dll
39   File ${prefix}/bin/libkleopatraclientgui.dll
40
41   # The KCM lib is directly linked
42   File ${prefix}/lib/plugins/kcm_kleopatra.dll
43
44   SetOutPath "$INSTDIR\share\kleopatra\pics"
45
46   File ${prefix}/share/kleopatra/pics/gpg4win.png
47   File ${prefix}/share/kleopatra/pics/kleopatra_splashscreen.png
48   File ${prefix}/share/kleopatra/pics/kleopatra_splashscreen.svgz
49   File ${prefix}/share/kleopatra/pics/kleopatra_wizard.png
50   File ${prefix}/share/kleopatra/pics/kleopatra_wizard.svgz
51
52   SetOutPath "$INSTDIR\share\kservices5"
53   File ${prefix}/share/kservices5/kleopatra_config_appear.desktop
54   File ${prefix}/share/kservices5/kleopatra_config_gnupgsystem.desktop
55   File ${prefix}/share/kservices5/kleopatra_config_cryptooperations.desktop
56   File ${prefix}/share/kservices5/kleopatra_config_smimevalidation.desktop
57   File ${prefix}/share/kservices5/kleopatra_config_dirserv.desktop
58
59 #  SetOutPath "$INSTDIR\share\apps\kwatchgnupg\pics"
60
61 #  File ${prefix}/share/apps/kwatchgnupg/pics/kwatchgnupg.png
62 #  File ${prefix}/share/apps/kwatchgnupg/pics/kwatchgnupg2.png
63
64 #  # TODO Can't mix localized and en commons when we install
65 #  # more then one kde langanuage
66 #  SetOutPath "$INSTDIR\share\doc\HTML\common"
67 #
68 #  File ${prefix}/share/doc/HTML/en/common/1.png
69 #  File ${prefix}/share/doc/HTML/en/common/10.png
70 #  File ${prefix}/share/doc/HTML/en/common/2.png
71 #  File ${prefix}/share/doc/HTML/en/common/3.png
72 #  File ${prefix}/share/doc/HTML/en/common/4.png
73 #  File ${prefix}/share/doc/HTML/en/common/5.png
74 #  File ${prefix}/share/doc/HTML/en/common/6.png
75 #  File ${prefix}/share/doc/HTML/en/common/7.png
76 #  File ${prefix}/share/doc/HTML/en/common/8.png
77 #  File ${prefix}/share/doc/HTML/en/common/9.png
78 #  File ${prefix}/share/doc/HTML/en/common/artistic-license.html
79 #  File ${prefix}/share/doc/HTML/en/common/block_title_bottom.png
80 #  File ${prefix}/share/doc/HTML/en/common/block_title_mid.png
81 #  File ${prefix}/share/doc/HTML/en/common/block_title_top.png
82 #  File ${prefix}/share/doc/HTML/en/common/bottom-left.png
83 #  File ${prefix}/share/doc/HTML/en/common/bottom-middle.png
84 #  File ${prefix}/share/doc/HTML/en/common/bottom-right.png
85 #  File ${prefix}/share/doc/HTML/en/common/bsd-license.html
86 #  File ${prefix}/share/doc/HTML/en/common/doxygen.css
87 #  File ${prefix}/share/doc/HTML/en/common/favicon.ico
88 #  File ${prefix}/share/doc/HTML/en/common/fdl-license.html
89 #  File ${prefix}/share/doc/HTML/en/common/fdl-license
90 #  File ${prefix}/share/doc/HTML/en/common/fdl-notice.html
91 #  File ${prefix}/share/doc/HTML/en/common/kde-docs.css
92 #  File ${prefix}/share/doc/HTML/en/common/footer.html
93 #  File ${prefix}/share/doc/HTML/en/common/gpl-license.html
94 #  File ${prefix}/share/doc/HTML/en/common/gpl-license
95 #  File ${prefix}/share/doc/HTML/en/common/header.html
96 #  File ${prefix}/share/doc/HTML/en/common/kde-default.css
97 #  File ${prefix}/share/doc/HTML/en/common/kde-docs.css
98 #  File ${prefix}/share/doc/HTML/en/common/kde_logo_bg.png
99 #  File ${prefix}/share/doc/HTML/en/common/lgpl-license.html
100 #  File ${prefix}/share/doc/HTML/en/common/lgpl-license
101 #  File ${prefix}/share/doc/HTML/en/common/mainfooter.html
102 #  File ${prefix}/share/doc/HTML/en/common/mainheader.html
103 #  File ${prefix}/share/doc/HTML/en/common/qpl-license.html
104 #  File ${prefix}/share/doc/HTML/en/common/tabs.css
105 #  File ${prefix}/share/doc/HTML/en/common/top-kde.jpg
106 #  File ${prefix}/share/doc/HTML/en/common/top-left.jpg
107 #  File ${prefix}/share/doc/HTML/en/common/top-left.png
108 #  File ${prefix}/share/doc/HTML/en/common/top-middle.png
109 #  File ${prefix}/share/doc/HTML/en/common/top-right.jpg
110 #  File ${prefix}/share/doc/HTML/en/common/top-right.png
111 #  File ${prefix}/share/doc/HTML/en/common/top.jpg
112 #  File ${prefix}/share/doc/HTML/en/common/x11-license.html
113 #  File ${prefix}/share/doc/HTML/en/common/xml.dcl
114 #
115 #  File ${prefix}/share/doc/HTML/de/common/fdl-translated.html
116 #  File ${prefix}/share/doc/HTML/de/common/gpl-translated.html
117 #  File ${prefix}/share/doc/HTML/de/common/kde-localised.css
118 #  File ${prefix}/share/doc/HTML/de/common/lgpl-translated.html
119 #
120 #  SetOutPath "$INSTDIR\share\doc\HTML\de\kleopatra"
121 #
122 #  File ${prefix}/share/doc/HTML/de/kleopatra/admin-archive-definitions.html
123 #  File ${prefix}/share/doc/HTML/de/kleopatra/admin-checksum-definitions.html
124 #  File ${prefix}/share/doc/HTML/de/kleopatra/admin-key-filters.html
125 #  File ${prefix}/share/doc/HTML/de/kleopatra/admin.html
126 #  File ${prefix}/share/doc/HTML/de/kleopatra/commandline-options.html
127 #  File ${prefix}/share/doc/HTML/de/kleopatra/configuration-appearance.html
128 #  File ${prefix}/share/doc/HTML/de/kleopatra/configuration-crypto-operations.html
129 #  File ${prefix}/share/doc/HTML/de/kleopatra/configuration-gnupg-system.html
130 #  File ${prefix}/share/doc/HTML/de/kleopatra/configuration-smime-validation.html
131 #  File ${prefix}/share/doc/HTML/de/kleopatra/configuration.html
132 #  File ${prefix}/share/doc/HTML/de/kleopatra/credits-and-license.html
133 #  File ${prefix}/share/doc/HTML/de/kleopatra/functions-newkey.html
134 #  File ${prefix}/share/doc/HTML/de/kleopatra/functions-search.html
135 #  File ${prefix}/share/doc/HTML/de/kleopatra/functions.html
136 #  File ${prefix}/share/doc/HTML/de/kleopatra/index.html
137 #  File ${prefix}/share/doc/HTML/de/kleopatra/introduction.html
138 #  File ${prefix}/share/doc/HTML/de/kleopatra/menu.html
139 #  File ${prefix}/share/doc/HTML/de/kleopatra/menucertificates.html
140 #  File ${prefix}/share/doc/HTML/de/kleopatra/menuhelp.html
141 #  File ${prefix}/share/doc/HTML/de/kleopatra/menusettings.html
142 #  File ${prefix}/share/doc/HTML/de/kleopatra/menutools.html
143 #  File ${prefix}/share/doc/HTML/de/kleopatra/menuview.html
144 #  File ${prefix}/share/doc/HTML/de/kleopatra/menuwindow.html
145 #
146 #  SetOutPath "$INSTDIR\share\doc\HTML\en\kleopatra"
147 #
148 #  File ${prefix}/share/doc/HTML/en/kleopatra/admin-archive-definitions.html
149 #  File ${prefix}/share/doc/HTML/en/kleopatra/admin-checksum-definitions.html
150 #  File ${prefix}/share/doc/HTML/en/kleopatra/admin-key-filters.html
151 #  File ${prefix}/share/doc/HTML/en/kleopatra/admin.html
152 #  File ${prefix}/share/doc/HTML/en/kleopatra/commandline-options.html
153 #  File ${prefix}/share/doc/HTML/en/kleopatra/configuration-appearance.html
154 #  File ${prefix}/share/doc/HTML/en/kleopatra/configuration-crypto-operations.html
155 #  File ${prefix}/share/doc/HTML/en/kleopatra/configuration-gnupg-system.html
156 #  File ${prefix}/share/doc/HTML/en/kleopatra/configuration-smime-validation.html
157 #  File ${prefix}/share/doc/HTML/en/kleopatra/configuration.html
158 #  File ${prefix}/share/doc/HTML/en/kleopatra/credits-and-license.html
159 #  File ${prefix}/share/doc/HTML/en/kleopatra/functions-newkey.html
160 #  File ${prefix}/share/doc/HTML/en/kleopatra/functions-search.html
161 #  File ${prefix}/share/doc/HTML/en/kleopatra/functions.html
162 #  File ${prefix}/share/doc/HTML/en/kleopatra/index.html
163 #  File ${prefix}/share/doc/HTML/en/kleopatra/introduction.html
164 #  File ${prefix}/share/doc/HTML/en/kleopatra/menu.html
165 #  File ${prefix}/share/doc/HTML/en/kleopatra/menucertificates.html
166 #  File ${prefix}/share/doc/HTML/en/kleopatra/menuhelp.html
167 #  File ${prefix}/share/doc/HTML/en/kleopatra/menusettings.html
168 #  File ${prefix}/share/doc/HTML/en/kleopatra/menutools.html
169 #  File ${prefix}/share/doc/HTML/en/kleopatra/menuview.html
170 #  File ${prefix}/share/doc/HTML/en/kleopatra/menuwindow.html
171
172   SetOutPath "$INSTDIR\share\icons\hicolor\128x128\apps"
173
174   File ${prefix}/share/icons/hicolor/128x128/apps/kleopatra.png
175
176   SetOutPath "$INSTDIR\share\icons\hicolor\16x16\apps"
177
178   File ${prefix}/share/kleopatra/pics/gpg4win-compact.png
179   File ${prefix}/share/icons/hicolor/16x16/apps/kleopatra.png
180
181   SetOutPath "$INSTDIR\share\icons\hicolor\22x22\apps"
182
183   File ${prefix}/share/icons/hicolor/22x22/apps/kleopatra.png
184
185   SetOutPath "$INSTDIR\share\icons\hicolor\256x256\apps"
186
187   File ${prefix}/share/icons/hicolor/256x256/apps/kleopatra.png
188
189   SetOutPath "$INSTDIR\share\icons\hicolor\32x32\apps"
190
191   File ${prefix}/share/icons/hicolor/32x32/apps/kleopatra.png
192
193   SetOutPath "$INSTDIR\share\icons\hicolor\48x48\apps"
194
195   File ${prefix}/share/icons/hicolor/48x48/apps/kleopatra.png
196
197   SetOutPath "$INSTDIR\share\icons\hicolor\64x64\apps"
198
199   File ${prefix}/share/icons/hicolor/64x64/apps/kleopatra.png
200
201   SetOutPath "$INSTDIR\share\icons\hicolor"
202   File ${prefix}/share/icons/hicolor/icon-theme.cache
203   File index.theme
204
205   # In KDE 4.10 the locale detection in kdelibs is broken so we
206   # install a kdeglobals with the language setting chosen in the
207   # installer
208   push $1
209   FileOpen $1 "$INSTDIR\share\kdeglobals" "w"
210   # Writing out icon theme is important here otherwise you have
211   # weird effects like no toolbar icons.
212   FileWrite $1 '[Icons]$\r$\n'
213   FileWrite $1 'Theme=breeze$\r$\n$\r$\n'
214   FileClose $1
215   pop $1
216
217   SetOutPath "$INSTDIR\share\QtProject"
218   # We want kleopatra logging for debugging
219   push $1
220   FileOpen $1 "$INSTDIR\share\QtProject\qtlogging.ini" "w"
221   FileWrite $1 '[Rules]$\r$\n'
222   FileWrite $1 'org.kde.pim.*=true$\r$\n'
223   FileClose $1
224   pop $1
225
226   SetOutPath "$INSTDIR\..\GnuPG\share\doc\gnupg\examples"
227   # Install profiles
228   push $1
229   FileOpen $1 "$INSTDIR\..\GnuPG\share\doc\gnupg\examples\VS-NfD.prf" "w"
230   FileWrite $1 '# VS-NfD.prf - Configure options for the VS-NfD mode           -*- conf -*-$\r$\n'
231   FileWrite $1 '$\r$\n'
232   FileWrite $1 '[gpg]$\r$\n'
233   FileWrite $1 'compliance de-vs$\r$\n'
234   FileWrite $1 'default-new-key-algo rsa3072/cert,sign+rsa3072/encr$\r$\n'
235   FileWrite $1 '$\r$\n'
236   FileWrite $1 '[gpgsm]$\r$\n'
237   FileWrite $1 'enable-crl-checks$\r$\n'
238   FileWrite $1 'compliance de-vs$\r$\n'
239   FileWrite $1 '$\r$\n'
240   FileWrite $1 '[gpg-agent]$\r$\n'
241   FileWrite $1 'enable-extended-key-format$\r$\n'
242   FileWrite $1 'default-cache-ttl 900$\r$\n'
243   FileWrite $1 'max-cache-ttl 3600$\r$\n'
244   FileWrite $1 'no-allow-mark-trusted$\r$\n'
245   FileWrite $1 'no-allow-external-cache$\r$\n'
246   FileWrite $1 'enforce-passphrase-constraints$\r$\n'
247   FileWrite $1 'min-passphrase-len 9$\r$\n'
248   FileWrite $1 'min-passphrase-nonalpha 0$\r$\n'
249   FileWrite $1 '$\r$\n'
250   FileWrite $1 '[dirmngr]$\r$\n'
251   FileWrite $1 'allow-ocsp$\r$\n'
252   FileClose $1
253   pop $1
254
255   push $1
256   FileOpen $1 "$INSTDIR\..\GnuPG\share\doc\gnupg\examples\Automatic.prf" "w"
257   FileWrite $1 '# Automatic.prf - Configure options for a more automatic mode           -*- conf -*-$\r$\n'
258   FileWrite $1 '$\r$\n'
259   FileWrite $1 '[gpg]$\r$\n'
260   FileWrite $1 'auto-key-locate local,wkd,dane$\r$\n'
261   FileWrite $1 'auto-key-retrieve$\r$\n'
262   FileWrite $1 'trust-model tofu+pgp$\r$\n'
263   FileWrite $1 '$\r$\n'
264   FileClose $1
265   pop $1
266
267   WriteRegStr SHCTX "Software\Gpg4win\kleopatra\Capabilities" "ApplicationDescription" "$(DESC_SEC_kleopatra)"
268   WriteRegStr SHCTX "Software\Gpg4win\kleopatra\Capabilities" "ApplicationIcon" "$INSTDIR\bin\kleopatra.exe,0"
269   WriteRegStr SHCTX "Software\Gpg4win\kleopatra\Capabilities" "ApplicationName" "Kleopatra"
270
271
272   # Openpgp4fpr URI scheme
273   WriteRegStr SHCTX "Software\Classes\openpgp4fpr" "" "URL:OpenPGP master key fingerprint"
274   WriteRegStr SHCTX "Software\Classes\openpgp4fpr" "URL Protocol" ""
275   WriteRegStr SHCTX "Software\Classes\openpgp4fpr\DefaultIcon" "" "$INSTDIR\bin\kleopatra.exe,0"
276   WriteRegStr SHCTX "Software\Classes\openpgp4fpr\shell\open\command" "" "$\"$INSTDIR\bin\kleopatra.exe$\" --query $\"%1$\""
277
278   # p7s / p7m are special because they are already known
279   WriteRegExpandStr SHCTX "Software\Classes\P7MFile\shell\open\command" "" "$\"$INSTDIR\bin\kleopatra.exe$\" $\"%1$\""
280   WriteRegStr SHCTX "Software\Classes\P7MFile\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
281
282   WriteRegExpandStr SHCTX "Software\Classes\P7SFile\shell\open\command" "" "$\"$INSTDIR\bin\kleopatra.exe$\" $\"%1$\""
283   WriteRegStr SHCTX "Software\Classes\P7SFile\DefaultIcon" "" "$INSTDIR\share\gpg4win\file-ext.ico"
284
285 !endif
286 ${MementoSectionEnd}
287
288
289 LangString DESC_SEC_kleopatra ${LANG_ENGLISH} \
290    "Keymanager for OpenPGP and X.509 and common crypto dialogs."
291
292
293 LangString DESC_Menu_kleopatra ${LANG_ENGLISH} \
294    "Run the Kleopatra key management tool."