gnupg/scripts (ChangeLog distfiles mk-w32-dist w32installer.nsi)

cvs user wk cvs at cvs.gnupg.org
Wed Jan 26 18:36:17 CET 2005


    Date: Wednesday, January 26, 2005 @ 18:44:48
  Author: wk
    Path: /cvs/gnupg/gnupg/scripts

Modified: ChangeLog distfiles mk-w32-dist w32installer.nsi

* w32installer.nsi: Create a start menu entry and enhanced the
build environment.
* mk-w32-dist: Add more support for above.


------------------+
 ChangeLog        |    6 +
 distfiles        |    1 
 mk-w32-dist      |   67 +++++++++++++++++---
 w32installer.nsi |  173 +++++++++++++++++++++++++++++++++++++++++++++++++----
 4 files changed, 224 insertions(+), 23 deletions(-)


Index: gnupg/scripts/ChangeLog
diff -u gnupg/scripts/ChangeLog:1.60 gnupg/scripts/ChangeLog:1.61
--- gnupg/scripts/ChangeLog:1.60	Tue Jan 11 13:03:22 2005
+++ gnupg/scripts/ChangeLog	Wed Jan 26 18:44:48 2005
@@ -1,3 +1,9 @@
+2005-01-26  Werner Koch  <wk at g10code.com>
+
+	* w32installer.nsi: Create a start menu entry and enhanced the
+	build environment.
+	* mk-w32-dist: Add more support for above.
+
 2005-01-11  Werner Koch  <wk at g10code.com>
 
 	* w32installer.nsi: New.
Index: gnupg/scripts/distfiles
diff -u gnupg/scripts/distfiles:1.17 gnupg/scripts/distfiles:1.18
--- gnupg/scripts/distfiles:1.17	Sun Feb 23 06:14:57 2003
+++ gnupg/scripts/distfiles	Wed Jan 26 18:44:47 2005
@@ -4,3 +4,4 @@
 autogen.sh
 mk-gpg-texi
 mk-w32-dist
+w32installer.nsi
Index: gnupg/scripts/mk-w32-dist
diff -u gnupg/scripts/mk-w32-dist:1.15 gnupg/scripts/mk-w32-dist:1.16
--- gnupg/scripts/mk-w32-dist:1.15	Thu Jan 20 12:42:02 2005
+++ gnupg/scripts/mk-w32-dist	Wed Jan 26 18:44:47 2005
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
@@ -10,14 +10,19 @@
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
-
 set -e
-
 cd dist-w32
 
+tmp="`echo $0 | sed 's,.*gnupg-\([^/]*\)/.*,\1,'`"
+
+topdir=
 bindir=..
 
-if [ -f ../README ]; then
+if [ -f "../gnupg-$tmp/README" ]; then
+    srcdir="../gnupg-$tmp"
+    bindir="../gnupg-$tmp"
+    topdir=".."
+elif [ -f ../README ]; then
     srcdir=..
 elif [ -f ../../README ]; then
     srcdir=../..
@@ -37,7 +42,12 @@
    STRIP="mingw32 strip"
 fi
 
+# If we don't have an installer we don't need to prepare for it.
+if ! makensis -version >/dev/null 2>&1 ; then
+    topdir=
+fi
 
+# Figure out the version
 version=$(sed -n 's/^#[ ]*define[ ][ ]*VERSION[ ][ ]*\"\([0-9.a-z-]*\)\"/\1/p' $bindir/config.h)
 prod_version=$(echo "$version"|awk -F'[^0-9]' '{print $1 "." $2 "." $3 ".1"}')
 echo "building version $version ($prod_version)"
@@ -79,6 +89,7 @@
 for i in ${srcdir}/po/*.po; do
    lang=$(basename $i .po)
    grep -s $lang ${srcdir}/po/LINGUAS >/dev/null || continue
+   [ -f$lang.mo -a $lang.mo -nt $i ] && continue
 
    fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $i`
    case "$fromset" in 
@@ -95,14 +106,50 @@
    esac
 done
 
-if makensis -version >/dev/null 2>&1 ; then
-  echo "invokin installer as:"
-  echo makensis -v3 -nocd -DVERSION="${version}" \
+# If we have a topdir, assume the full build environment and 
+# prepare the installer
+if [ -n "$topdir" ]; then
+  winpt_defs=
+  src_defs=
+  buildinfo="`date -u '+%Y-%m-%d %H:%M UTC'`"
+
+  # iconv.dll is a hard requirement
+  if [ ! -f "$topdir/iconv/iconv.dll" ]; then
+    echo "iconv.dll not availavle" >&2
+    exit 1
+  fi
+  ln "$topdir/iconv/iconv.dll" iconv.dll
+  for i in COPYING.LIB README.iconv; do
+     cp ${topdir}/iconv/$i $i.txt
+     todos $i.txt
+  done
+  
+  # WinPT is optional
+  if [ -f "$topdir/winpt/WinPT.exe" ]; then
+     ln "$topdir/winpt/WinPT.exe"      WinPT.exe
+     ln "$topdir/winpt/PTD.dll"        PTD.dll
+     cp "$topdir/winpt/README-0.9.txt" README.winpt.txt
+     cp "$topdir/winpt/NEWS-0.9.txt"   NEWS.winpt.txt
+     cp "$topdir/winpt/keyserver.conf" keyserver.conf
+     winpt_defs="-DWITH_WINPT"
+  fi
+
+  # See whether we should include the source.
+  if [ ! -d "$topdir/tarballs" ]; then
+      # FIXME
+      :
+  fi
+
+  # Now run the installer
+  echo "invoking installer as:"
+  echo makensis -v2 -nocd -DVERSION="${version}" \
            -DPROD_VERSION="${prod_version}" \
-           -DGNUPG_SRCDIR="${srcdir}" ${srcdir}/scripts/w32installer.nsi
-  makensis -v3 -nocd -DVERSION="${version}" \
+           -DGNUPG_SRCDIR="${srcdir}" ${winpt_defs} ${src_defs} \
+           ${srcdir}/scripts/w32installer.nsi
+  BUILDINFO=$buildinfo makensis -v2 -nocd -DVERSION="${version}" \
            -DPROD_VERSION="${prod_version}" \
-           -DGNUPG_SRCDIR="${srcdir}" ${srcdir}/scripts/w32installer.nsi
+           -DGNUPG_SRCDIR="${srcdir}" ${winpt_defs} ${src_defs} \
+           ${srcdir}/scripts/w32installer.nsi
   echo "Installer created" >&2
 else
   zip -9 "gnupg-w32cli-${version}.zip" *
Index: gnupg/scripts/w32installer.nsi
diff -u gnupg/scripts/w32installer.nsi:1.3 gnupg/scripts/w32installer.nsi:1.4
--- gnupg/scripts/w32installer.nsi:1.3	Thu Jan 20 12:42:02 2005
+++ gnupg/scripts/w32installer.nsi	Wed Jan 26 18:44:47 2005
@@ -15,12 +15,6 @@
 ; using NSIS.  It is usually used by the mk-w32-dist script.
 ;----------------------------------------------------------------------
 
-; TODO:
-; - Display credit for the installer
-; - Provide the location of the corresponding source
-; - Translate all strings
-
-
 ; We use the modern UI.
 !include "MUI.nsh"
 
@@ -29,7 +23,11 @@
 ; -------------
 Name "GNU Privacy Guard"
 
+!ifdef WITH_WINPT
+OutFile "gnupg-w32-${VERSION}.exe"
+!else
 OutFile "gnupg-w32cli-${VERSION}.exe"
+!endif
 
 InstallDir "$PROGRAMFILES\GNU\GnuPG"
 
@@ -54,6 +52,15 @@
     "GnuPG: Encryption and digital signature tool"
 VIAddVersionKey "FileVersion" "${PROD_VERSION}"
 
+; ----------------------
+; Variable declarations
+; ----------------------
+
+Var MYTMP
+Var STARTMENU_FOLDER
+
+Var DOC_INSTALLED
+Var WINPT_INSTALLED
 
 ; ------------------
 ; Interface Settings
@@ -97,6 +104,13 @@
 !insertmacro MUI_PAGE_COMPONENTS
 
 !insertmacro MUI_PAGE_DIRECTORY
+
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" 
+!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\GNU\GnuPG" 
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
+  
+!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
+
 !insertmacro MUI_PAGE_INSTFILES
 
 !define MUI_FINISHPAGE_SHOWREADME "README.txt"
@@ -156,8 +170,6 @@
 
   WriteRegStr HKLM "Software\GNU\GnuPG" "Install Directory" $INSTDIR
 
-  WriteUninstaller "$INSTDIR\Uninstall.exe"
-  
 SectionEnd ; Section Base
 
 ;----------------------
@@ -180,6 +192,29 @@
 
 SectionEnd ; Section Tools
 
+;------------------
+!ifdef WITH_WINPT
+Section "WinPT" SecWinPT
+;  SectionIn 1
+
+  SetOutPath "$INSTDIR"
+
+  File "WinPT.exe"
+  File "PTD.dll"
+  File "keyserver.conf"
+
+  SetOutPath "$INSTDIR\Doc"
+
+  File "README.winpt.txt"
+
+  WriteRegStr HKCU "Software\GNU\GnuPG" "gpgProgram" "$INSTDIR\gpg.exe"
+
+  StrCpy $WINPT_INSTALLED 1
+
+SectionEnd ; Section WinPT
+!endif
+
+
 ;----------------------
 Section "Documentation" SecDoc
 ;  SectionIn 1
@@ -192,6 +227,12 @@
   File "NEWS.txt"
   File "FAQ.txt"
 
+!ifdef WITH_WINPT
+  File "NEWS.winpt.txt"
+!endif ; WITH_WINPT
+
+  StrCpy $DOC_INSTALLED 1
+
 SectionEnd ; Section Documentation
 
 
@@ -204,15 +245,73 @@
   ; Note that we include the uncompressed tarball because this allows
   ; far better compression results for the distribution.  We might
   ; want to compress it again after installation.
-  File "gnupg-1.4.0.tar"
+  File "gnupg-${VERSION}.tar"
 
 SectionEnd ; Section Source
 !endif
 
 
-;------------------
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; The last section is a hidden one; used to finish up things.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+Section "-Finish"
+
+  ;;--------------------------
+  ;;  Create the uninstaller
+  ;;--------------------------
+  WriteUninstaller "$INSTDIR\uninst-gnupg.exe"
+
+  ;;---------------------
+  ;; Create Menu entries
+  ;;---------------------
+  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
+    
+  CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
+
+  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG README.lnk" \
+                 "$INSTDIR\Doc\README.txt"
+  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG NEWS.lnk" \
+                 "$INSTDIR\Doc\NEWS.txt"
+
+  IntCmp $DOC_INSTALLED 1 0 +2 +2
+  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG Manual Page.lnk" \
+                 "$INSTDIR\Doc\gpg.man"
+
+
+  IntCmp $WINPT_INSTALLED 1 0 no_winpt_menu no_winpt_menu
+  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\winpt.lnk" \
+                 "$INSTDIR\winpt.exe"
+  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\WinPT README.lnk" \
+                 "$INSTDIR\Doc\README.winpt.txt"
+  IntCmp $DOC_INSTALLED 1 0 +2 +2
+  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\WinPT NEWS.lnk" \
+                 "$INSTDIR\Doc\NEWS.winpt.txt"
+
+ no_winpt_menu:
+
+  CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\uninst-gnupg.lnk" \
+                 "$INSTDIR\uninst-gnupg.exe"
+
+
+  !insertmacro MUI_STARTMENU_WRITE_END
+
+
+SectionEnd ; "-Finish"
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Create the section for the uninstaller
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 Section "Uninstall"
 
+  ;;------------------------
+  ;; Delete files
+  ;;------------------------
   Delete "$INSTDIR\gpg.exe"
   Delete "$INSTDIR\gpgkeys_finger.exe"
   Delete "$INSTDIR\gpgkeys_hkp.exe"
@@ -222,6 +321,8 @@
   Delete "$INSTDIR\Doc\README.txt"
   Delete "$INSTDIR\Doc\README.W32"
   Delete "$INSTDIR\Doc\COPYING.txt"
+  Delete "$INSTDIR\Doc\COPYING.LIB.txt"
+  Delete "$INSTDIR\Doc\README.iconv.txt"
 
   Delete "$INSTDIR\iconv.dll"
 
@@ -229,6 +330,11 @@
 
   Delete "$INSTDIR\gpgsplit.exe"
   Delete "$INSTDIR\gpgv.exe"
+  Delete "$INSTDIR\WinPT.exe"
+  Delete "$INSTDIR\PTD.dll"
+  Delete "$INSTDIR\Doc\README.winpt.txt"
+  Delete "$INSTDIR\Doc\NEWS.winpt.txt"
+  Delete "$INSTDIR\Doc\keyserver.conf"
 
   Delete "$INSTDIR\Doc\gnupg.man"
   Delete "$INSTDIR\Doc\gpg.man"
@@ -236,13 +342,36 @@
   Delete "$INSTDIR\Doc\NEWS.txt"
   Delete "$INSTDIR\Doc\FAQ.txt"
 
-  Delete "$INSTDIR\Uninstall.exe"
+  Delete "$INSTDIR\uninst-gnupg.exe"
 
+  ;;------------------------
+  ;; Delete directories
+  ;;------------------------
   RMDir "$INSTDIR\Doc"
   RMDir "$INSTDIR\Src"
   RMDir "$INSTDIR\gnupg.nls"
   RMDir "$INSTDIR"
 
+
+  ;;---------------------------------------------------
+  ;; Delete the menu entries and any empty parent menus
+  ;;---------------------------------------------------
+  !insertmacro MUI_STARTMENU_GETFOLDER Application $MYTMP
+  Delete "$SMPROGRAMS\$MYTMP\*.lnk"
+  StrCpy $MYTMP "$SMPROGRAMS\$MYTMP"
+  startMenuDeleteLoop:
+    ClearErrors
+    RMDir $MYTMP
+    GetFullPathName $MYTMP "$MYTMP\.."
+    IfErrors startMenuDeleteLoopDone
+    StrCmp $MYTMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
+  startMenuDeleteLoopDone:
+
+
+  ;;-----------------------
+  ;;  Cleanup the registry
+  ;;-----------------------
+  DeleteRegValue HKCU "Software\GNU\GnuPG" "Start Menu Folder"
   DeleteRegValue HKLM "Software\GNU\GnuPG" "Install Directory"
   DeleteRegKey /ifempty HKLM "Software\GNU\GnuPG"
 
@@ -314,6 +443,10 @@
   SetOutPath "$INSTDIR"
   File "iconv.dll"
 
+  SetOutPath "$INSTDIR\doc"
+  File "COPYING.LIB.txt"
+  File "README.iconv.txt"
+
 FunctionEnd
 
 
@@ -327,11 +460,15 @@
   It can be used to encrypt data and to create digital signatures. \
   It includes an advanced key management facility and is compliant \
   with the proposed OpenPGP Internet standard as described in RFC2440. \
-  \r\n\r\nThis is GnuPG version ${VERSION}"
+  \r\n\r\n$_CLICK \
+  \r\n\r\n\r\n\r\n\r\nThis is GnuPG version ${VERSION}\r\n\
+  built on $%BUILDINFO%"
 LangString T_About ${LANG_GERMAN} \
   "GnuPG is das Werzeug aus dem GNU Projekt zur sicheren Kommunikation \
    sowie zum sicheren Speichern von Daten. \
-   \r\n\r\nThis is GnuPG version ${VERSION}"
+   \r\n\r\n$_CLICK \
+   \r\n\r\n\r\n\r\n\r\nDies ist GnuPG version ${VERSION}\r\n\
+   erstellt am $%BUILDINFO%"
 LangString T_ShowReadme ${LANG_ENGLISH} "Show the README file"
 LangString T_ShowReadme ${LANG_GERMAN} "Die README Datei anzeigen"
 
@@ -351,6 +488,13 @@
 LangString DESC_SecTools ${LANG_GERMAN} \
       "Weitere Tools wie gpgv und gpgsplit"
 
+!ifdef WITH_WINPT
+LangString DESC_SecWinPT ${LANG_ENGLISH} \
+      "The Windows Privacy Tray (WinPT)"
+LangString DESC_SecWinPT ${LANG_GERMAN} \
+      "Der Windows Privacy Tray (WinPT)"
+!endif
+
 LangString DESC_SecDoc ${LANG_ENGLISH} \
       "Manual pages and a FAQ"
 LangString DESC_SecDoc ${LANG_GERMAN} \
@@ -360,6 +504,9 @@
   !insertmacro MUI_DESCRIPTION_TEXT ${SecBase} $(DESC_SecBase)
   !insertmacro MUI_DESCRIPTION_TEXT ${SecNLS} $(DESC_SecNLS)
   !insertmacro MUI_DESCRIPTION_TEXT ${SecTools} $(DESC_SecTools)
+!ifdef WITH_WINPT
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecWinPT} $(DESC_SecWinPT)
+!endif
   !insertmacro MUI_DESCRIPTION_TEXT ${SecDoc} $(DESC_SecDoc)
 !insertmacro MUI_FUNCTION_DESCRIPTION_END
 




More information about the Gnupg-commits mailing list