1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

Automate W32 installer building.

* doc/README.W32: Document new installer build procedure.
* scripts/autogen.sh: Pass all args to the installer (regression fix).
* scripts/conf-w32/README: Remove from repo.
* scripts/conf-w32/bzip2-1.diff: Remove from repo.
* scripts/mk-w32-dist: Rewrite.
* scripts/w32installer.nsi [WITH_PATCHES]: Use constant patch file
name.
This commit is contained in:
Werner Koch 2012-01-16 16:12:24 +01:00
parent cfb193a1de
commit 81839d2861
6 changed files with 190 additions and 248 deletions

View File

@ -101,21 +101,29 @@ directory with the changes relative to the generic version.
The source is distributed as a BZIP2 or GZIP compressed tar archive. The source is distributed as a BZIP2 or GZIP compressed tar archive.
See the instructions in file README on how to check the integrity of See the instructions in file README on how to check the integrity of
that file. Wir a properly setup build environment, you unpack the that file. With a properly setup build environment, you unpack the
tarball change to the created directory and run tarball change to the created directory and run
$ ./autogen.sh --build-w32 $ ./autogen.sh --build-w32
$ make $ make
$ cp g10/gpg*.exe /some_windows_drive/ $ cp g10/gpg*.exe /some_windows_drive/
Building a version with the installer is a bit more complex and Building a version with the installer requires an install NSIS tool
basically works by creating a top directory, unpacking in that top and a directory with the iconv files. The script mk-w32-dist does the
directory, switching to the gnupg-1.x.y directory, running entire build from the tarball and checks most prerequisites; example:
"./autogen.sh --build-w32" and "make", switching back to the top
directory, running a "mkdir dist-w32; mkdir iconv", copying the $ scripts/mk-w32-dist $(pwd)/gnupg-1.4.3.tar.gz
required iconv files (iconv.dll, README.iconv, COPYING.LIB) into the
iconv directory, running gnupg-1.x.y/scripts/mk-w32-dist and voila, If you installed the iconv files in a non-standard place you may use
the installer package will be available in the dist-w32 directory.
$ scripts/mk-w32-dist --iconv-dir /foo/bar/ $(pwd)/gnupg-1.4.3.tar.gz
If you need to patch the standard tarball, you can supply a patch file:
$ scripts/mk-w32-dist $(pwd)/gnupg-1.4.3.tar.gz mypatches
That patch file will then be part of the installer.
Copying: Copying:
@ -123,8 +131,9 @@ Copying:
GnuPG is GnuPG is
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007 Free Software Foundation, Inc. 2005, 2006, 2007, 2008, 2009,
2010, 2012 Free Software Foundation, Inc.
GnuPG is free software; you can redistribute it and/or modify it GnuPG is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by under the terms of the GNU General Public License as published by
@ -145,7 +154,7 @@ information and bug reporting addresses pertaining to GnuPG.
For copying conditions of the GNU LIBICONV library see the file For copying conditions of the GNU LIBICONV library see the file
README.iconv. README.iconv.
The installer software used to create the official binary packages for The installer software used to create the official binary packages for
W32 is NSIS (http://nsis.sourceforge.net/): W32 is NSIS (http://nsis.sourceforge.net/):

View File

@ -94,7 +94,7 @@ if test "$1" = "--build-w32"; then
fi fi
[ $DIE = yes ] && exit 1 [ $DIE = yes ] && exit 1
$tsdir/configure ${conf_CC} --build=${build} --host=${host} $tsdir/configure ${conf_CC} --build=${build} --host=${host} \
${disable_foo_tests} $* ${disable_foo_tests} $*
exit $? exit $?
fi fi

View File

@ -1,2 +0,0 @@
Files useful for building W32 versions.

View File

@ -1,39 +0,0 @@
To include support for BZIP2 compression in GunPG for W32, the patch
below should be applied to a stock bzip2-1.0.6 source. The Build as
usual using the mingw32 cross compiler package from Debian and install
the library and header file on top of the cross compiler installation
(/usr/i586-mingw32msvc/lib/). Note that for ease of maintenance we
don't use a DLL. [wk 2005-03-14]
diff -u orig/bzip2-1.0.2/Makefile bzip2-1.0.2/Makefile
--- orig/bzip2-1.0.2/Makefile 2002-01-26 00:34:53.000000000 +0100
+++ bzip2-1.0.2/Makefile 2004-11-03 14:10:45.000000000 +0100
@@ -2,9 +2,9 @@
SHELL=/bin/sh
# To assist in cross-compiling
-CC=gcc
-AR=ar
-RANLIB=ranlib
+CC=i586-mingw32msvc-gcc
+AR=i586-mingw32msvc-ar
+RANLIB=i586-mingw32msvc-ranlib
LDFLAGS=
# Suitably paranoid flags to avoid bugs in gcc-2.7
diff -u orig/bzip2-1.0.2/bzlib.h bzip2-1.0.2/bzlib.h
--- orig/bzip2-1.0.2/bzlib.h 2001-12-30 03:19:45.000000000 +0100
+++ bzip2-1.0.2/bzlib.h 2004-11-03 14:32:41.000000000 +0100
@@ -113,7 +114,7 @@
/* Need a definitition for FILE */
#include <stdio.h>
-#ifdef _WIN32
+#if defined( _WIN32 ) && 0
# include <windows.h>
# ifdef small
/* windows.h define small to char */

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. # Copyright (C) 2000, 2001, 2002, 2004, 2005,
# 2012 Free Software Foundation, Inc.
# #
# This file is free software; as a special exception the author gives # This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without # unlimited permission to copy and/or distribute it, with or without
@ -11,30 +12,9 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
set -e set -e
cd dist-w32
tmp="`echo $0 | sed 's,.*gnupg-\([^/]*\)/.*,\1,'`" PGM="mk-w32-dist"
[ -z "$w32root" ] && w32root="$HOME/w32root"
topdir=
bindir=..
if [ -f "../gnupg-$tmp/README" ]; then
srcdir="../gnupg-$tmp"
bindir="../gnupg-$tmp"
topdir=".."
elif [ -f ../README ]; then
srcdir=..
elif [ -f ../../README ]; then
srcdir=../..
bindir=..
elif [ -f ../../gnupg-stable/README ]; then
srcdir=../../gnupg-stable
elif [ -f ../../../gnupg-stable/README ]; then
srcdir=../../../gnupg-stable
else
echo "cannot figure out the source dir" >&2
exit 1
fi
# Windows uses an internal build number. We use the last day of the # Windows uses an internal build number. We use the last day of the
# year concatenated with the hour. for it. If it happens that a new # year concatenated with the hour. for it. If it happens that a new
@ -43,24 +23,112 @@ fi
# of days. # of days.
if [ "$1" = "--build-number" -a -n "$2" ]; then if [ "$1" = "--build-number" -a -n "$2" ]; then
build_number="$2" build_number="$2"
shift shift
shift shift
else else
build_number=$(date -u '+%j%H' | sed 's/^0*\(.*\)/\1/') build_number=$(date -u '+%j%H' | sed 's/^0*\(.*\)/\1/')
fi fi
if [ "$1" = "--iconv-dir" -a -n "$2" ]; then
iconvdir="$2"
shift
shift
else
iconvdir="${w32root}/share/gnupg-1-extra/iconv"
fi
if i586-mingw32msvc-strip --version >/dev/null 2>&1 ; then if [ $# -lt 1 -o $# -gt 2 -o "$1" = "--help" ]; then
echo "usage: $PGM [options] TARBALL [PATCHFILE]" >&2
echo " Options:" >&2
echo " --build-number N Windows build number" >&2
echo " --iconv-dir DIR Directory with inconv files" >&2
exit 1
fi
if [ ! -d "$iconvdir" ]; then
echo "$PGM: iconv directory does not exists (use option --iconv-dir)" >&2
exit 1
fi
( set +e
cd "${iconvdir}"
cat <<EOF | sha1sum -c >/dev/null
44f7289042b71631acac29b2f143330d2da2479e COPYING.LIB
3f4262714a3b508cf20428f046d511f7bfb9fd89 README.iconv
a21c860b81ed158e91b2b921b752f48fda6d6f1e iconv.dll
EOF
if [ $? != 0 ]; then
echo "$PGM: iconv files are not available or not correct" >&2
exit 1
fi
set -e
)
here="$(pwd)"
builddir=w32-build-root
tarball="$1"
patchfile="$2"
if [ ! -f "$tarball" -o "$(echo "$tarball" | head -c 1)" != "/" ]; then
echo "$PGM: tarball does not exist or has no absolute name" >&2
exit 1
fi
if [ -n "$patchfile" -a ! -f "$patchfile" ]; then
echo "$PGM: patchfile does not exist" >&2
exit 1
fi
if ! makensis -version >/dev/null 2>&1 ; then
echo "$PGM: error: makensis is not installed" >&2
exit 1
fi
if i686-w64-mingw32-strip --version >/dev/null 2>&1 ; then
STRIP=i686-w64-mingw32-strip
elif i586-mingw32msvc-strip --version >/dev/null 2>&1 ; then
STRIP=i586-mingw32msvc-strip STRIP=i586-mingw32msvc-strip
else else
STRIP="mingw32 strip" echo "$PGM: error: strip tool not found" >&2
exit 1
fi fi
# If we don't have an installer we don't need to prepare for it. echo "tarball: $tarball" >&2
if ! makensis -version >/dev/null 2>&1 ; then version="$(echo "$tarball" | sed 's,.*/gnupg-\(.*\)\.tar\.gz$,\1,')"
topdir= prod_version=$(echo "$version"|awk -F'[^0-9]' '{print $1 "." $2 "." $3 }')
prod_version="${prod_version}.${build_number}"
echo "version: $version ($prod_version)" >&2
[ -n "$patchfile" ] && echo "patchfile: $patchfile" >&2
echo "workdir: $builddir" >&2
echo "preparing work directory ..." >&2
[ -d "$builddir" ] && rm -rf "$builddir"
mkdir "$builddir"
cd "$builddir"
mkdir dist-w32
echo "unpacking tarball ..." >&2
tar xzf "$tarball"
cd gnupg-"$version"
if [ -n "$patchfile" ]; then
echo "applying patchfile ..." >&2
patch -p1 -t < "$patchfile"
fi fi
echo "running configure ..." >&2
./autogen.sh --build-w32 --silent
echo "running make ..." >&2
make -s
cd ../dist-w32
srcdir="../gnupg-$version"
bindir="../gnupg-$version"
# A function to return a plain ASCII (or Latin-1) encoded description # A function to return a plain ASCII (or Latin-1) encoded description
# text for a language identifier. We need this to display the list of # text for a language identifier. We need this to display the list of
@ -103,30 +171,18 @@ get_langname () {
echo "$r" echo "$r"
} }
echo "copying files ..." >&2
# 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 }')
prod_version="${prod_version}.${build_number}"
echo "building version $version ($prod_version)"
rm * >/dev/null 2>/dev/null || true
cp ${bindir}/g10/gpg.exe gpg.exe cp ${bindir}/g10/gpg.exe gpg.exe
$STRIP gpg.exe $STRIP gpg.exe
cp ${bindir}/g10/gpgv.exe gpgv.exe cp ${bindir}/g10/gpgv.exe gpgv.exe
$STRIP gpgv.exe $STRIP gpgv.exe
for name in hkp curl ldap finger; do for name in hkp curl ldap finger; do
cp ${bindir}/keyserver/gpgkeys_$name.exe gpgkeys_$name.exe cp ${bindir}/keyserver/gpgkeys_$name.exe gpgkeys_$name.exe
$STRIP gpgkeys_$name.exe $STRIP gpgkeys_$name.exe
done done
cp ${bindir}/tools/gpgsplit.exe gpgsplit.exe cp ${bindir}/tools/gpgsplit.exe gpgsplit.exe
$STRIP gpgsplit.exe $STRIP gpgsplit.exe
for i in FAQ; do
cp ${bindir}/doc/$i $i.txt
todos $i.txt
done
man -Tlatin1 -l ${srcdir}/doc/gpg.1 | sed `printf "s/_\b//g;s/\b.//g"` >gpg.man man -Tlatin1 -l ${srcdir}/doc/gpg.1 | sed `printf "s/_\b//g;s/\b.//g"` >gpg.man
todos gpg.man todos gpg.man
man -Tlatin1 -l ${srcdir}/doc/gpgv.1 | sed `printf "s/_\b//g;s/\b.//g"` >gpgv.man man -Tlatin1 -l ${srcdir}/doc/gpgv.1 | sed `printf "s/_\b//g;s/\b.//g"` >gpgv.man
@ -141,15 +197,16 @@ done
cp ${srcdir}/doc/README.W32 README-W32.txt cp ${srcdir}/doc/README.W32 README-W32.txt
todos README-W32.txt todos README-W32.txt
patches_defs= if [ -n "$patchfile" ]; then
for i in `find "$topdir/patches" -type f \( -name '*.diff' -o -name '*.tar.gz' \)`; do echo "copying patch file ..." >&2
cp $i . cp $patchfile patches.diff
patches_defs="-DWITH_PATCHES" patches_defs="-DWITH_PATCHES"
done fi
echo "converting MO files ..." >&2
# We must distribute the MO files in UTF-8, the conversion is done by # We must distribute the MO files in UTF-8, the conversion is done by
# gpg at runtime. To include English at the right position in the list we # gpg at runtime. To include English at the right position in the list we
# need a special case. # need a special case.
langlist="" langlist=""
langdesclist="" langdesclist=""
@ -158,15 +215,15 @@ for i in `(ls ${srcdir}/po/*.po; echo ${srcdir}/po/en.po) | sort`; do
if [ $lang != "en" ]; then if [ $lang != "en" ]; then
grep -s $lang ${srcdir}/po/LINGUAS >/dev/null || continue grep -s $lang ${srcdir}/po/LINGUAS >/dev/null || continue
[ -f$lang.mo -a $lang.mo -nt $i ] && continue [ -f$lang.mo -a $lang.mo -nt $i ] && continue
fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $i` fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' $i`
case "$fromset" in case "$fromset" in
utf8|utf-8|UTF8|UTF-8) utf8|utf-8|UTF8|UTF-8)
echo "$lang: keeping $fromset" >&2 echo "$lang: keeping $fromset" >&2
msgfmt --output-file=$lang.mo $i msgfmt --output-file=$lang.mo $i
;; ;;
*) *)
echo "$lang: converting from $fromset to utf-8" >&2 echo "$lang: converting from $fromset to utf-8" >&2
iconv --silent --from-code=$fromset --to-code=utf-8 < $i | \ iconv --silent --from-code=$fromset --to-code=utf-8 < $i | \
sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/"|\ sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/"|\
msgfmt --output-file=$lang.mo - msgfmt --output-file=$lang.mo -
@ -195,107 +252,26 @@ ListItems="$langdesclist"
EOF EOF
# If we have a topdir, assume the full build environment and src_defs=
# prepare the installer buildinfo="`date -u '+%Y-%m-%d %H:%M UTC'`"
if [ -n "$topdir" ]; then
winpt_defs=
src_defs=
buildinfo="`date -u '+%Y-%m-%d %H:%M UTC'`"
# iconv.dll is a hard requirement echo "copying iconv ..." >&2
if [ ! -f "$topdir/iconv/iconv.dll" ]; then cp "${iconvdir}/iconv.dll" iconv.dll
echo "iconv.dll not available" >&2 for i in COPYING.LIB README.iconv; do
exit 1 cp ${iconvdir}/$i $i.txt
fi todos $i.txt
ln "$topdir/iconv/iconv.dll" iconv.dll done
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 and figure out the # Now run the installer
# version numbers of the source files. echo "invoking installer as:"
if [ -d "$topdir/tarballs" ]; then echo makensis -v0 -nocd -DVERSION="${version}" \
have_gnupg_src=no -DPROD_VERSION="${prod_version}" \
have_libiconv_src=no -DGNUPG_SRCDIR="${srcdir}" ${winpt_defs} ${src_defs} \
have_winpt_src=no ${patches_defs} ${srcdir}/scripts/w32installer.nsi
for i in `find "$topdir/tarballs" -type f -name '*.tar.gz'`; do BUILDINFO=$buildinfo makensis -v0 -nocd -DVERSION="${version}" \
fname=$(basename "$i" .gz) -DPROD_VERSION="${prod_version}" \
zcat "$i" > "$fname" -DGNUPG_SRCDIR="${srcdir}" ${winpt_defs} ${src_defs} \
case "$fname" in ${patches_defs} ${srcdir}/scripts/w32installer.nsi
gnupg-*) mv gnupg-w32cli-${version}.exe "${here}"/
tmp=$(echo "$fname" | \ cd "${here}"
sed -n 's/^[^-]*-\([0-9.a-z-]*\)\.tar$/\1/p') echo "gnupg-w32cli-${version}.exe ready." >&2
echo "gnupg source version is $tmp" >&2
if [ "$version" != "$tmp" ]; then
echo "gnupg source version does not match" >&2
exit 1
fi
have_gnupg_src=yes
;;
libiconv-*)
tmp=$(echo "$fname" | \
sed -n 's/^[^-]*-\([0-9.a-z-]*\)\.tar$/\1/p')
echo "libiconv source version is $tmp" >&2
src_defs="$src_defs -DLIBICONV_VERSION=$tmp"
have_libiconv_src=yes
;;
winpt-*)
tmp=$(echo "$fname" | \
sed -n 's/^[^-]*-\([0-9.a-z-]*\)\.tar$/\1/p')
echo "winpt source version is $tmp" >&2
src_defs="$src_defs -DWINPT_VERSION=$tmp"
have_winpt_src=yes
;;
*)
echo "WARNING: unknown source file $fname ignored" >&2
;;
esac
done
if [ -n "$src_defs" ]; then
if [ $have_gnupg_src = "no" ]; then
echo "gnupg source missing" >&2
exit 1
fi
if [ $have_libiconv_src = "no" ]; then
echo "libiconv source missing" >&2
exit 1
fi
if [ -n "$winpt_defs" ]; then
if [ $have_winpt_src = "no" ]; then
echo "winpt source missing" >&2
exit 1
fi
fi
src_defs="$src_defs -DWITH_SOURCE"
fi
fi
# Now run the installer
echo "invoking installer as:"
echo makensis -v0 -nocd -DVERSION="${version}" \
-DPROD_VERSION="${prod_version}" \
-DGNUPG_SRCDIR="${srcdir}" ${winpt_defs} ${src_defs} \
${patches_defs} ${srcdir}/scripts/w32installer.nsi
BUILDINFO=$buildinfo makensis -v0 -nocd -DVERSION="${version}" \
-DPROD_VERSION="${prod_version}" \
-DGNUPG_SRCDIR="${srcdir}" ${winpt_defs} ${src_defs} \
${patches_defs} ${srcdir}/scripts/w32installer.nsi
echo "Installer created" >&2
else
zip -9 "gnupg-w32cli-${version}.zip" *
echo "ZIP archive created" >&2
fi

View File

@ -68,12 +68,12 @@ Var STARTMENU_FOLDER
!define MUI_UNFINISHPAGE_NOAUTOCLOSE !define MUI_UNFINISHPAGE_NOAUTOCLOSE
; Remember the installer language ; Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU" !define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\GNU\GnuPG" !define MUI_LANGDLL_REGISTRY_KEY "Software\GNU\GnuPG"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
; ----- ; -----
; Pages ; Pages
; ----- ; -----
!define MUI_WELCOMEPAGE_TEXT "$(T_About)" !define MUI_WELCOMEPAGE_TEXT "$(T_About)"
@ -96,10 +96,10 @@ Page custom CustomPageOptions
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\GNU\GnuPG" !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\GNU\GnuPG"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
@ -110,7 +110,7 @@ Page custom CustomPageOptions
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.gnupg.org/" !define MUI_FINISHPAGE_LINK_LOCATION "http://www.gnupg.org/"
!insertmacro MUI_PAGE_FINISH !insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_INSTFILES
@ -128,7 +128,7 @@ Page custom CustomPageOptions
!insertmacro MUI_RESERVEFILE_LANGDLL !insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
ReserveFile "opt.ini" ReserveFile "opt.ini"
ReserveFile "COPYING.txt" ReserveFile "COPYING.txt"
ReserveFile "README-W32.txt" ReserveFile "README-W32.txt"
#ReserveFile "${NSISDIR}/Plugins/System.dll" #ReserveFile "${NSISDIR}/Plugins/System.dll"
@ -220,7 +220,6 @@ Section "Documentation" SecDoc
File "gpg.man" File "gpg.man"
File "gpgv.man" File "gpgv.man"
File "NEWS.txt" File "NEWS.txt"
File "FAQ.txt"
!ifdef WITH_WINPT !ifdef WITH_WINPT
File "NEWS.winpt.txt" File "NEWS.winpt.txt"
@ -228,8 +227,7 @@ Section "Documentation" SecDoc
!ifdef WITH_PATCHES !ifdef WITH_PATCHES
SetOutPath "$INSTDIR\Src" SetOutPath "$INSTDIR\Src"
File '*.diff' File 'patches.diff'
File '*.tar.gz'
!endif !endif
SectionEnd ; Section Documentation SectionEnd ; Section Documentation
@ -285,7 +283,7 @@ Section "-Finish"
;; Create Menu entries ;; Create Menu entries
;;--------------------- ;;---------------------
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG README.lnk" \ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG README.lnk" \
@ -295,25 +293,25 @@ Section "-Finish"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG NEWS.lnk" \ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG NEWS.lnk" \
"$INSTDIR\Doc\NEWS.txt" "$INSTDIR\Doc\NEWS.txt"
SectionGetFlags ${SecDoc} $R0 SectionGetFlags ${SecDoc} $R0
IntOp $R0 $R0 & ${SF_SELECTED} IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} 0 +2 IntCmp $R0 ${SF_SELECTED} 0 +2
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG Manual Page.lnk" \ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\GnuPG Manual Page.lnk" \
"$INSTDIR\Doc\gpg.man" "$INSTDIR\Doc\gpg.man"
!ifdef WITH_WINPT !ifdef WITH_WINPT
SectionGetFlags ${SecWinPT} $R0 SectionGetFlags ${SecWinPT} $R0
IntOp $R0 $R0 & ${SF_SELECTED} IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} 0 no_winpt_menu IntCmp $R0 ${SF_SELECTED} 0 no_winpt_menu
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\winpt.lnk" \ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\winpt.lnk" \
"$INSTDIR\winpt.exe" "$INSTDIR\winpt.exe"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\WinPT README.lnk" \ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\WinPT README.lnk" \
"$INSTDIR\Doc\README.winpt.txt" "$INSTDIR\Doc\README.winpt.txt"
SectionGetFlags ${SecDoc} $R0 SectionGetFlags ${SecDoc} $R0
IntOp $R0 $R0 & ${SF_SELECTED} IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} 0 +2 IntCmp $R0 ${SF_SELECTED} 0 +2
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\WinPT NEWS.lnk" \ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\WinPT NEWS.lnk" \
"$INSTDIR\Doc\NEWS.winpt.txt" "$INSTDIR\Doc\NEWS.winpt.txt"
@ -330,17 +328,17 @@ Section "-Finish"
;;----------------- ;;-----------------
;; Set the language ;; Set the language
;;----------------- ;;-----------------
SectionGetFlags ${SecNLS} $R0 SectionGetFlags ${SecNLS} $R0
IntOp $R0 $R0 & ${SF_SELECTED} IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} 0 lang_none IntCmp $R0 ${SF_SELECTED} 0 lang_none
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "opt.ini" "Field 1" "ListItems" !insertmacro MUI_INSTALLOPTIONS_READ $R0 "opt.ini" "Field 1" "ListItems"
DetailPrint "Available languages: $R0" DetailPrint "Available languages: $R0"
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "opt.ini" "Field 1" "State" !insertmacro MUI_INSTALLOPTIONS_READ $R1 "opt.ini" "Field 1" "State"
DetailPrint "Selected language: $R1" DetailPrint "Selected language: $R1"
StrCmp $R1 "" lang_none +1 StrCmp $R1 "" lang_none +1
${StrStr} $R2 $R0 $R1 ${StrStr} $R2 $R0 $R1
StrCmp $R2 "" lang_none +1 StrCmp $R2 "" lang_none +1
${StrTok} $R3 $R2 " " "0" "1" ${StrTok} $R3 $R2 " " "0" "1"
goto lang_set_finish goto lang_set_finish
@ -463,13 +461,13 @@ Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "opt.ini" !insertmacro MUI_INSTALLOPTIONS_EXTRACT "opt.ini"
FunctionEnd FunctionEnd
Function un.onInit Function un.onInit
!insertmacro MUI_UNGETLANGUAGE !insertmacro MUI_UNGETLANGUAGE
FunctionEnd FunctionEnd
@ -490,19 +488,19 @@ Function PrintNonAdminWarning
FunctionEnd FunctionEnd
Function CustomPageOptions Function CustomPageOptions
SectionGetFlags ${SecNLS} $R0 SectionGetFlags ${SecNLS} $R0
IntOp $R0 $R0 & ${SF_SELECTED} IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} show IntCmp $R0 ${SF_SELECTED} show
Abort Abort
show: show:
!insertmacro MUI_HEADER_TEXT "$(T_InstallOptions)" "$(T_SelectLanguage)" !insertmacro MUI_HEADER_TEXT "$(T_InstallOptions)" "$(T_SelectLanguage)"
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "opt.ini" "Field 1" "ListItems" !insertmacro MUI_INSTALLOPTIONS_READ $R0 "opt.ini" "Field 1" "ListItems"
ReadRegStr $R1 HKCU "Software\GNU\GnuPG" "Lang" ReadRegStr $R1 HKCU "Software\GNU\GnuPG" "Lang"
StrCmp $R1 "" use_default +1 StrCmp $R1 "" use_default +1
${StrStr} $R2 $R0 "$R1 - " ${StrStr} $R2 $R0 "$R1 - "
StrCmp $R2 "" +1 set_lang StrCmp $R2 "" +1 set_lang
use_default: use_default:
StrCpy $R2 "$(T_langid) - $(T_langname)" StrCpy $R2 "$(T_langid) - $(T_langname)"