view packaging/create-dist-package.sh.in @ 831:747a48996c1f

(Issue13) Precompile uninstaller Create-dist-packge now creates a temporary installer that only writes the uninstaller. Then it excutes this installer (using wine) to create the uninstaller. That uninstaller is then packaged normaly and packaged instead of the written uninstaller.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 24 Jul 2014 15:59:00 +0200
parents eef8e0ca82b9
children 8081ed84589d
line wrap: on
line source
#!/bin/bash
# Helper script to package the files expected by the -admin application
# Windows build is expected to live in CMAKE_SOURCE_DIR/build-windows
set -x
set -e

if [ ! -d "$WINDOWS_NSSDIR" ]; then
    echo "ERROR: Please set WINDOWS_NSSDIR to the location of your nss binaries"
    exit 1
fi

if [ ! -x `which wine` ]; then
    echo "ERROR: Could not find wine."
    exit 1
fi

TMPD=$(mktemp -d)
TMPDIR=$TMPD/TrustBridge-@PROJECT_VERSION@
cd @CMAKE_BINARY_DIR@
/bin/bash packaging/linux-createpackage.sh
mkdir -p $TMPDIR/linux
mkdir -p $TMPDIR/windows
cp @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh $TMPDIR/linux
cp @CMAKE_SOURCE_DIR@/build-windows/ui/trustbridge.exe $TMPDIR/windows
cp @CMAKE_SOURCE_DIR@/build-windows/cinst/cinst.exe $TMPDIR/windows
cp @CMAKE_SOURCE_DIR@/build-windows/cinst/mozilla.exe $TMPDIR/windows
cp @CMAKE_SOURCE_DIR@/packaging/filelist.nsh $TMPDIR
cp @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi $TMPDIR
cp -r @CMAKE_SOURCE_DIR@/packaging/resources $TMPDIR/resources
LC_ALL="de_DE.latin-1" echo "company=Bundesamt f�r Sicherheit in der Informationstechnik" > $TMPDIR/meta.ini
EST_SIZE=$(du -s $TMPDIR/windows | cut -f 1)
echo "version_number=@PROJECT_VERSION@" >>  $TMPDIR/meta.ini
echo "setupname=%1TrustBridge-@PROJECT_VERSION@.exe" >> $TMPDIR/meta.ini
echo "productname=TrustBridge" >> $TMPDIR/meta.ini
echo "info_url=https://wald.intevation.org/projects/trustbridge/" >> $TMPDIR/meta.ini
echo "productname_short=TrustBridge" >> $TMPDIR/meta.ini
echo "description=TrustBridge" >> $TMPDIR/meta.ini
echo "size=$EST_SIZE" >> $TMPDIR/meta.ini
cp $WINDOWS_NSSDIR/*.dll $TMPDIR/windows

# Create a temporary NSIS file for the uninstaller cration
LC_ALL="de_DE.latin-1" makensis -Dfiles_dir=$TMPDIR/windows \
    -Dcompany="Bundesamt f�r Sicherheit in der Informationstechnik" \
    -Dversion_number=@PROJECT_VERSION@ \
    -Dsetupname="$TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe" \
    -Dproductname="TrustBridge" \
    -Dpath_sep="/" \
    -Dinfo_url="https://wald.intevation.org/projects/trustbridge/" \
    -Dsize=$EST_SIZE \
    -DWRITE_UNINSTALLER \
    -Dproductname_short="TrustBridge" @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi
wine $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe /S || true
mv ~/.wine/drive_c/tmp-uninstaller/Uninstall.exe $TMPDIR/windows
rmdir ~/.wine/drive_c/tmp-uninstaller
rm $TMPDIR/TrustBridge-@PROJECT_VERSION@-uni.exe

cd $TMPD
zip -r TrustBridge-@PROJECT_VERSION@.zip TrustBridge-@PROJECT_VERSION@
mv TrustBridge-@PROJECT_VERSION@.zip @CMAKE_BINARY_DIR@
rm -r $TMPD
echo "Package is: @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.zip"

http://wald.intevation.org/projects/trustbridge/