tools/deploy-win.sh (view raw)
1#!/bin/bash
2BINARY=$1
3INSTALLPATH="$2"
4WORKDIR="$3"
5
6
7if [ -z "$DESTDIR" ]; then
8 OUTDIR="$INSTALLPATH"
9else
10 if [ -n $(echo ${INSTALLPATH} | grep "^[A-Z]:") ]; then
11 INSTALLPATH="${INSTALLPATH:3}"
12 fi
13 OUTDIR="$WORKDIR/$DESTDIR/$INSTALLPATH"
14fi
15
16IFS=$'\n'
17if [ -n $(which ntldd 2>&1 | grep /ntldd) ]; then
18 DLLS=$(ntldd -R "$BINARY" | grep -i mingw | cut -d">" -f2 | sed -e 's/(0x[0-9a-f]\+)//' -e 's/^ \+//' -e 's/ \+$//' -e 's,\\,/,g')
19elif [ -n $(which gdb 2>&1 | grep /gdb) ]; then
20 DLLS=$(gdb "$BINARY" --command=$(dirname $0)/dlls.gdb | grep -i mingw | cut -d" " -f7- | sed -e 's/^ \+//' -e 's/ \+$//' -e 's,\\,/,g')
21else
22 echo "Please install gdb or ntldd for deploying DLLs"
23fi
24cp -vu $DLLS "$OUTDIR"
25if [ -n $(which windeployqt 2>&1 | grep /windeployqt) ]; then
26 windeployqt --no-opengl-sw --no-svg --release --dir "$OUTDIR" "$BINARY"
27fi