changeset 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 913867a8bf40
children 5bca48a2fb02
files packaging/create-dist-package.sh.in packaging/trustbridge.nsi packaging/win-createpackage.sh.in
diffstat 3 files changed, 70 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/create-dist-package.sh.in	Mon Sep 22 15:36:57 2014 +0200
+++ b/packaging/create-dist-package.sh.in	Mon Sep 22 15:37:32 2014 +0200
@@ -53,6 +53,39 @@
 cp @CMAKE_SOURCE_DIR@/build-windows/packaging/DesktopShellRun.dll $TMPDIR/resources
 cp -r @CMAKE_BINARY_DIR@/doc/help/client/html $TMPDIR/windows/doc
 
+echo "; This file is autogenerated." > $TMPDIR/resources/filelist_in.nsh
+echo "; This file is autogenerated." > $TMPDIR/resources/filelist_un.nsh
+OLDDIR=$(pwd)
+cd $TMPDIR/windows
+for file in `find * -name \*.exe`; do
+    echo File \"\${files_dir}\${path_sep}$file\" >> $TMPDIR/resources/filelist_in.nsh
+    echo Delete \"\$INSTDIR\\$file\" >> $TMPDIR/resources/filelist_un.nsh
+done
+cd $TMPDIR/windows/doc
+
+for curdir in `find * -maxdepth 0 -type d -not -path .`; do
+    cd $curdir
+    curpath=\"\$INSTDIR\\doc\\$curdir\"
+    echo SetOutPath $curpath >> $TMPDIR/resources/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\" >> $TMPDIR/resources/filelist_in.nsh
+        echo Delete \"\$INSTDIR\\doc\\$curdir\\$file\" >> $TMPDIR/resources/filelist_un.nsh
+    done
+    echo RMDir $curpath >> $TMPDIR/resources/filelist_un.nsh
+    cd -
+done
+
+echo SetOutPath \"\$INSTDIR\\doc\" >> $TMPDIR/resources/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\" >> $TMPDIR/resources/filelist_in.nsh
+    echo Delete \"\$INSTDIR\\doc\\$file\" >> $TMPDIR/resources/filelist_un.nsh
+done
+echo RMDir \"\$INSTDIR\\doc\" >> $TMPDIR/resources/filelist_un.nsh
+
+cd $OLDDIR
+
+
+
 cp @CMAKE_SOURCE_DIR@/packaging/filelist.nsh $TMPDIR
 cp @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi $TMPDIR
 LC_ALL="de_DE.latin-1" echo "company=Bundesamt für Sicherheit in der Informationstechnik" > $TMPDIR/meta.ini
--- a/packaging/trustbridge.nsi	Mon Sep 22 15:36:57 2014 +0200
+++ b/packaging/trustbridge.nsi	Mon Sep 22 15:37:32 2014 +0200
@@ -28,6 +28,7 @@
 !define MULTIUSER_INSTALLMODE_INSTDIR "${productname_short}"
 
 !addplugindir "${plugin_dir}"
+!addincludedir "${plugin_dir}"
 
 !include "MultiUser.nsh"
 !include "MUI2.nsh"
@@ -207,7 +208,8 @@
 continue:
 ; The actual installation
   SetOutPath "$INSTDIR"
-  !include "filelist.nsh"
+  !include "filelist_in.nsh"
+  SetOutPath "$INSTDIR"
 
 ;Create uninstaller
 !ifndef WRITE_UNINSTALLER
@@ -273,10 +275,9 @@
     ExpandEnvStrings $0 %LOCALAPPDATA%
     nsExec::ExecToLog '"$INSTDIR\trustbridge-certificate-installer.exe" "list=$0\BSI\TrustBridge\list-installed.txt" "choices=uninstall"'
 skip_certs:
-  RMDir /r "$INSTDIR" ; TODO (issue137) include uninstall files
-; !include "filelist-un.nsh"
-;  Delete "$INSTDIR\Uninstall.exe"
-;  RMDir "$INSTDIR"
+  !include "filelist_un.nsh"
+  Delete "$INSTDIR\Uninstall.exe"
+  RMDir "$INSTDIR"
 
   !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
 
--- 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/