diff 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 diff
--- a/packaging/create-dist-package.sh.in	Thu Jul 24 12:09:28 2014 +0200
+++ b/packaging/create-dist-package.sh.in	Thu Jul 24 15:59:00 2014 +0200
@@ -9,6 +9,11 @@
     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@
@@ -32,6 +37,23 @@
 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@

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