2005-10-20 Marcus Brinkmann <marcus@g10code.de>
[gpg4win.git] / src / installer-finish.nsi
1 # installer-finish.nsi - Installer for GPG4Win.      -*- coding: latin-1; -*-
2 # Copyright (C) 2005 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 Var MYTMP
21
22 # Last section is a hidden one.
23 Section
24   WriteUninstaller "$INSTDIR\${PACKAGE}-uninstall.exe"
25
26   # Windows Add/Remove Programs support
27   StrCpy $MYTMP "Software\Microsoft\Windows\CurrentVersion\Uninstall\{PRETTY_PACKAGE_SHORT}"
28   WriteRegExpandStr HKLM $MYTMP "UninstallString" '"$INSTDIR\${PACKAGE}-uninstall.exe"'
29   WriteRegExpandStr HKLM $MYTMP "InstallLocation" "$INSTDIR"
30   WriteRegStr       HKLM $MYTMP "DisplayName"     "${PRETTY_PACKAGE}"
31   WriteRegStr       HKLM $MYTMP "DisplayIcon"     "$INSTDIR\gpg.exe,0"
32   WriteRegStr       HKLM $MYTMP "DisplayVersion"  "${VERSION}"
33   WriteRegStr       HKLM $MYTMP "Publisher"       "g10 Code GmbH"
34   WriteRegStr       HKLM $MYTMP "URLInfoAbout"    "http://www.gnupg.org/"
35   WriteRegDWORD     HKLM $MYTMP "NoModify"        "1"
36   WriteRegDWORD     HKLM $MYTMP "NoRepair"        "1"
37 SectionEnd
38
39
40 Section Uninstall
41 !ifdef HAVE_STARTMENU
42 !insertmacro MUI_STARTMENU_GETFOLDER ${STARTMENU_FOLDER} $R0
43 !ifdef HAVE_PKG_GPA
44   Delete "$SMPROGRAMS\$R0\GPA.lnk"
45 !endif
46   Delete "$SMPROGRAMS\$R0\Uninstall.lnk"
47   RMDir "$SMPROGRAMS\$R0"
48   DeleteRegValue HKLM "Software\GNU\${PRETTY_PACKAGE_SHORT}" \
49         "Start Menu Folder"
50 !endif
51
52   Delete "$INSTDIR\${PACKAGE}-uninstall.exe"
53   RMDir "$INSTDIR"
54
55   # Clean the registry.
56   DeleteRegValue HKLM "Software\GNU\${PRETTY_PACKAGE_SHORT}" \
57         "Install Directory"
58   DeleteRegKey /ifempty HKLM "Software\GNU\${PRETTY_PACKAGE_SHORT}" \
59   # Remove Windows Add/Remove Programs support.
60   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GnuPG"
61 SectionEnd