Update gpgol
[gpg4win.git] / src / inst-gpgol.nsi
index 125aa85..984f115 100644 (file)
@@ -1,4 +1,4 @@
-# inst-gpgol.nsi - Installer snippet for gpgol.
+# inst-gpgol.nsi - Installer snippet for gpgol.      -*- coding: latin-1; -*-
 # Copyright (C) 2005 g10 Code GmbH
 # 
 # This file is part of GPG4Win.
 !undef prefix
 !endif
 !define prefix ${ipdir}/gpgol-${gpg4win_pkg_gpgol_version}
+!define bdir ${bpdir}/gpgol-${gpg4win_pkg_gpgol_version}-build
 
 
-Section "gpgol" SEC_gpgol
+${MementoSection} "GpgOL" SEC_gpgol
   SetOutPath "$INSTDIR"
 !ifdef SOURCES
   File "${gpg4win_pkg_gpgol}"
 !else
-  File ${prefix}/bin/libgpgol-0-9-3-cvs.dll
-!endif
-SectionEnd
 
+  ClearErrors
+  SetOverwrite try
+  File ${prefix}/bin/gpgol.dll
+  SetOverwrite lastused
+  ifErrors 0 do_reg
+      File /oname=gpgol.dll.tmp ${prefix}/bin/gpgol.dll
+      Rename /REBOOTOK gpgol.dll.tmp gpgol.dll
+
+ do_reg:
+  # Register the DLL.
+  RegDLL "$INSTDIR\gpgol.dll"
+  ifErrors 0 +2
+     MessageBox MB_OK "$(T_GpgOL_RegFailed)"
+
+  SetOutPath "$INSTDIR\share\locale\de\LC_MESSAGES"
+  File ${prefix}/share/locale/de/LC_MESSAGES/gpgol.mo
+  SetOutPath "$INSTDIR\share\locale\sv\LC_MESSAGES"
+  File ${prefix}/share/locale/sv/LC_MESSAGES/gpgol.mo
+  SetOutPath "$INSTDIR\share\locale\pt\LC_MESSAGES"
+  File ${prefix}/share/locale/pt/LC_MESSAGES/gpgol.mo
+
+  SetOutPath "$INSTDIR\share\gpgol"
+  File "${prefix}/share/gpgol/*.cfg"
+  File "${prefix}/share/gpgol/*.ico"
+
+  SetOutPath "$INSTDIR\share\doc\gpgol"
+  File "${bdir}/doc/gpgol.pdf"
 
-; Uninstaller section.
-Section "-un.gpgol"
-!ifdef SOURCES
-  Push "${gpg4win_pkg_gpgol}"
-  Call un.SourceDelete
-!else
-  Delete "$INSTDIR\libgpgol-0-9-3-cvs.dll"
-  RMDir "$INSTDIR"
 !endif
-SectionEnd
+${MementoSectionEnd}
+
 
+LangString T_GpgOL_RegFailed ${LANG_ENGLISH} \
+   "Warning: Registration of the GpgOL Outlook pluginfailed."
 
 LangString DESC_SEC_gpgol ${LANG_ENGLISH} \
    "GnuPG for Outlook"
-LangString DESC_SEC_gpgol ${LANG_GERMAN} \
-   "GnuPG für Outlook"