andre@1188: #!/bin/bash aheinecke@588: # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik aheinecke@405: # Software engineering by Intevation GmbH aheinecke@405: # aheinecke@405: # This file is Free Software under the GNU GPL (v>=2) aheinecke@405: # and comes with ABSOLUTELY NO WARRANTY! aheinecke@405: # See LICENSE.txt for details. aheinecke@405: aheinecke@340: #NSSDIR is hackish as this will be replaced by static compiling aheinecke@340: # anyway aheinecke@340: TMPDIR=$(mktemp -d) andre@860: TMPINST=$(mktemp) aheinecke@340: andre@1176: EXEFILES=$(find . -name trustbridge-certificate-installer.exe -o -name trustbridge.exe -o -name trustbridge-nss-installer.exe) andre@1186: HELPDIR=@CMAKE_BINARY_DIR@/doc/help/client/html andre@1249: LICENSE_DIR=@CMAKE_SOURCE_DIR@/licenses aheinecke@340: aheinecke@340: cp $EXEFILES $TMPDIR andre@963: cp -r $HELPDIR $TMPDIR/doc andre@1249: cp -r $LICENSE_DIR $TMPDIR/licenses aheinecke@340: andre@1188: echo "; This file is autogenerated." > @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh andre@1188: echo "; This file is autogenerated." > @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh andre@1188: OLDDIR=$(pwd) andre@1188: cd $TMPDIR andre@1188: for file in `find * -name \*.exe`; do andre@1188: echo File \"\${files_dir}\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh andre@1242: if [ "$file" = "trustbridge-nss-installer.exe" ]; then andre@1242: # The nss installer is handled specially on uninstallation. andre@1242: continue andre@1242: fi andre@1188: echo Delete \"\$INSTDIR\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh andre@1188: done andre@1249: andre@1249: cd $TMPDIR/licenses andre@1249: echo SetOutPath \"\$INSTDIR\\licenses\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh andre@1249: for file in `find * -type f`; do andre@1249: echo File \"\${files_dir}\${path_sep}licenses\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh andre@1249: echo Delete \"\$INSTDIR\\licenses\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh andre@1249: done andre@1249: echo RmDir \"\$INSTDIR\\licenses\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh andre@1249: andre@1188: cd $TMPDIR/doc andre@1188: andre@1188: for curdir in `find * -maxdepth 0 -type d -not -path .`; do andre@1188: cd $curdir andre@1188: curpath=\"\$INSTDIR\\doc\\$curdir\" andre@1188: echo SetOutPath $curpath >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh andre@1188: for file in `find * -maxdepth 0 -type f`; do andre@1188: echo File \"\${files_dir}\${path_sep}doc\${path_sep}$curdir\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh andre@1188: echo Delete \"\$INSTDIR\\doc\\$curdir\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh andre@1188: done andre@1188: echo RMDir $curpath >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh andre@1188: cd - andre@1188: done andre@1188: andre@1188: echo SetOutPath \"\$INSTDIR\\doc\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh andre@1188: for file in `find * -maxdepth 0 -type f -not -path .buildinfo`; do andre@1188: echo File \"\${files_dir}\${path_sep}doc\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh andre@1188: echo Delete \"\$INSTDIR\\doc\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh andre@1188: done andre@1188: echo RMDir \"\$INSTDIR\\doc\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh andre@1188: andre@1188: cd $OLDDIR andre@794: EST_SIZE=$(du -s $TMPDIR | cut -f 1) andre@794: aheinecke@340: echo $TMPDIR andre@860: export LC_ALL="de_DE.latin-1" andre@860: andre@860: makensis -Dfiles_dir=$TMPDIR \ andre@860: -Dcompany="Bundesamt für Sicherheit in der Informationstechnik" \ andre@1010: -Dplugin_dir="@CMAKE_CURRENT_BINARY_DIR@" \ andre@860: -Dversion_number=@PROJECT_VERSION@ \ andre@860: -Dsetupname="$TMPINST" \ andre@860: -Dproductname="TrustBridge" \ andre@1027: -Ddescription="TrustBridge" \ andre@860: -Dpath_sep="/" \ andre@1385: -Dinfo_url="https://www.trustbridge.de" \ andre@860: -Dsize=$EST_SIZE \ andre@860: -DWRITE_UNINSTALLER \ andre@860: -Dproductname_short="TrustBridge" @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi andre@860: wine $TMPINST /S || true andre@860: mv ~/.wine/drive_c/tmp-uninstaller/Uninstall.exe $TMPDIR andre@860: rmdir ~/.wine/drive_c/tmp-uninstaller andre@860: rm $TMPINST andre@860: aheinecke@340: makensis -Dfiles_dir=$TMPDIR \ aheinecke@588: -Dcompany="Bundesamt für Sicherheit in der Informationstechnik" \ andre@1010: -Dplugin_dir="@CMAKE_CURRENT_BINARY_DIR@" \ aheinecke@495: -Dversion_number=@PROJECT_VERSION@ \ aheinecke@500: -Dsetupname="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.exe" \ aheinecke@410: -Dproductname="TrustBridge" \ andre@1027: -Ddescription="TrustBridge" \ aheinecke@552: -Dpath_sep="/" \ andre@1385: -Dinfo_url="https://www.trustbridge.de" \ andre@832: -Dsize=$EST_SIZE \ aheinecke@552: -Dproductname_short="TrustBridge" @CMAKE_SOURCE_DIR@/packaging/trustbridge.nsi andre@860: andre@922: osslsigncode sign -certs @CMAKE_SOURCE_DIR@/ui/tests/data/codesign/codesigning.pem \ andre@922: -key @CMAKE_SOURCE_DIR@/ui/tests/data/codesign/codesigning.key \ andre@922: -h sha256 -in @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.exe \ andre@922: -out @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@-signed.exe andre@1028: mv @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@-signed.exe @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.exe andre@922: aheinecke@340: rm -r $TMPDIR