diff packaging/win-createpackage.sh.in @ 1188:eb77ddd7e1ab

(issue137) Generate and include install / uninstall file lists
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 22 Sep 2014 15:37:32 +0200
parents 3de099c8129e
children e4aff35ef8fd
line wrap: on
line diff
--- a/packaging/win-createpackage.sh.in	Mon Sep 22 15:36:57 2014 +0200
+++ b/packaging/win-createpackage.sh.in	Mon Sep 22 15:37:32 2014 +0200
@@ -1,3 +1,4 @@
+#!/bin/bash
 # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
 # Software engineering by Intevation GmbH
 #
@@ -5,11 +6,8 @@
 # and comes with ABSOLUTELY NO WARRANTY!
 # See LICENSE.txt for details.
 
-#!/bin/bash
-
 #NSSDIR is hackish as this will be replaced by static compiling 
 # anyway
-
 TMPDIR=$(mktemp -d)
 TMPINST=$(mktemp)
 
@@ -19,6 +17,36 @@
 cp $EXEFILES $TMPDIR
 cp -r $HELPDIR $TMPDIR/doc
 
+echo "; This file is autogenerated." > @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+echo "; This file is autogenerated." > @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+OLDDIR=$(pwd)
+cd $TMPDIR
+for file in `find * -name \*.exe`; do
+    echo File \"\${files_dir}\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+    echo Delete \"\$INSTDIR\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+done
+cd $TMPDIR/doc
+
+for curdir in `find * -maxdepth 0 -type d -not -path .`; do
+    cd $curdir
+    curpath=\"\$INSTDIR\\doc\\$curdir\"
+    echo SetOutPath $curpath >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+    for file in `find * -maxdepth 0 -type f`; do
+        echo File \"\${files_dir}\${path_sep}doc\${path_sep}$curdir\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+        echo Delete \"\$INSTDIR\\doc\\$curdir\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+    done
+    echo RMDir $curpath >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+    cd -
+done
+
+echo SetOutPath \"\$INSTDIR\\doc\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+for file in `find * -maxdepth 0 -type f -not -path .buildinfo`; do
+    echo File \"\${files_dir}\${path_sep}doc\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+    echo Delete \"\$INSTDIR\\doc\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+done
+echo RMDir \"\$INSTDIR\\doc\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+
+cd $OLDDIR
 EST_SIZE=$(du -s $TMPDIR | cut -f 1)
 
 echo $TMPDIR

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