1 # installer-finish.nsi - Installer for GPG4Win. -*- coding: latin-1; -*-
2 # Copyright (C) 2005, 2008 g10 Code GmbH
4 # This file is part of GPG4Win.
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.
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.
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
22 # Last section is a hidden one.
24 WriteUninstaller "$INSTDIR\${PACKAGE}-uninstall.exe"
26 # Windows Add/Remove Programs support
27 # Note that the version is appended to the DisplayName, despite that
28 # this is not necessary as a click on "support information" gives
29 # the version number. Some tools do that, other don't. I don't
30 # like it but others want me to do that. -wk
31 StrCpy $MYTMP "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRETTY_PACKAGE_SHORT}"
32 WriteRegExpandStr HKLM $MYTMP "UninstallString" '"$INSTDIR\${PACKAGE}-uninstall.exe"'
33 WriteRegExpandStr HKLM $MYTMP "InstallLocation" "$INSTDIR"
34 WriteRegStr HKLM $MYTMP "DisplayName" "${PRETTY_PACKAGE} (${VERSION})"
35 WriteRegStr HKLM $MYTMP "DisplayIcon" "$INSTDIR\bin\kleopatra.exe,0"
36 WriteRegStr HKLM $MYTMP "DisplayVersion" "${VERSION}"
37 WriteRegStr HKLM $MYTMP "Publisher" "The Gpg4win Project"
38 WriteRegStr HKLM $MYTMP "URLInfoAbout" "http://www.gpg4win.org/"
39 WriteRegDWORD HKLM $MYTMP "NoModify" "1"
40 WriteRegDWORD HKLM $MYTMP "NoRepair" "1"
46 # Make sure that the context of the automatic variables has been set to
47 # the "all users" shell folder. This guarantees that the menu gets written
48 # for all users. We have already checked that we are running as Admin; or
49 # we printed a warning that installation will not succeed.
50 SetShellVarContext all
52 #---------------------------------------------------
53 # Delete the menu entries and any empty parent menus
54 #---------------------------------------------------
55 Delete "$SMPROGRAMS\GPA.lnk"
56 Delete "$SMPROGRAMS\Kleopatra.lnk"
58 # Delete Desktop links.
60 Delete "$DESKTOP\GPA.lnk"
62 !ifdef HAVE_PKG_KLEOPATRA
63 Delete "$DESKTOP\Kleopatra.lnk"
66 Delete "$INSTDIR\${PACKAGE}-uninstall.exe"
69 # If we installed in the default location, try to be really, really
70 # nice with sugar on it to clean up behind us. In any case, try very
71 # hard to get rid of directories which could have REBOOTOK files.
72 RMDir /REBOOTOK "$INSTDIR\bin"
73 RMDir /REBOOTOK "$INSTDIR"
76 DeleteRegValue HKLM "Software\${PRETTY_PACKAGE_SHORT}" \
78 DeleteRegKey /ifempty HKLM "Software\${PRETTY_PACKAGE_SHORT}"
80 # Remove Windows Add/Remove Programs support.
81 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRETTY_PACKAGE_SHORT}"