forked from Blazemeter/taurus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-windows-installer.sh
executable file
·48 lines (37 loc) · 1.12 KB
/
build-windows-installer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -euo pipefail
BUILD_DIR="$(dirname $0)/build/nsis"
# clean up build dir
rm -rf "$BUILD_DIR"
mkdir -p "$BUILD_DIR"
# ensure that argument was given
if [ "$#" -ne 1 ]
then
echo "Usage: $0 <build_file>"
exit 1
fi
if ! [ -e "$1" ]; then
echo "$1 not found" >&2
exit 1
fi
TAURUS_DIST="$1"
# install pythonz
curl -kL https://raw.github.com/saghul/pythonz/master/pythonz-install | bash
PYTHONZ_HOME="${HOME}/.pythonz/bin/pythonz"
PYTHONZ_SYSTEM="/usr/local/pythonz/bin/pythonz"
[ -f "$PYTHONZ_HOME" ] && PYTHONZ="$PYTHONZ_HOME" || PYTHONZ="$PYTHONZ_SYSTEM"
# install specific version of python
$PYTHONZ install 3.6.3
# set up python virtualenv
virtualenv venv --python=$($PYTHONZ locate 3.6.3)
# this is a workaround for venv bug: https://github.com/pypa/virtualenv/issues/1029
set +u
source venv/bin/activate
set -u
# setup packages needed for build
python -m pip install -U pip-custom-platform wheel
python -m pip install pynsist==2.1
python scripts/installer/gen_installer.py "$TAURUS_DIST"
# deactivate venv afterwards
deactivate
# Installer was saved to ${BUILD_DIR}/TaurusInstaller_${TAURUS_VERSION}_x64.exe