[62] | 1 | #!/bin/sh
|
---|
| 2 | # $Id: installer.sh 288 2024-10-09 03:06:28Z nishi $
|
---|
| 3 |
|
---|
[153] | 4 | if [ "x$1" = "x" ]; then
|
---|
| 5 | echo "Usage: $0 win32"
|
---|
| 6 | echo " $0 win64"
|
---|
| 7 | exit 1
|
---|
| 8 | fi
|
---|
| 9 |
|
---|
[62] | 10 | fail() {
|
---|
| 11 | rm -f tewi-service.exe
|
---|
| 12 | rm -f tewi.exe
|
---|
[128] | 13 | rm -f generated.conf
|
---|
| 14 | rm -f itworks.html
|
---|
[62] | 15 | exit 1
|
---|
| 16 | }
|
---|
| 17 |
|
---|
[80] | 18 | rm -f install-nossl.exe install-ssl.exe
|
---|
| 19 |
|
---|
[78] | 20 | VERSION=`make get-version`
|
---|
| 21 |
|
---|
[79] | 22 | sed "s/undef NO_SSL/define NO_SSL/g" config.h.tmpl > config.h
|
---|
[288] | 23 | if [ ! "x$2" = "x" ]; then
|
---|
| 24 | sed -i "s/undef $2/define $2/g" config.h
|
---|
| 25 | fi
|
---|
[79] | 26 |
|
---|
[62] | 27 | make clean || fail
|
---|
[208] | 28 | make PLATFORM=$1 PREFIX=C:/Tewi -j4 || fail
|
---|
[62] | 29 | cp Server/tewi.exe tewi.exe
|
---|
| 30 | make clean || fail
|
---|
[208] | 31 | make PLATFORM=$1-service -j4 PREFIX=C:/Tewi || fail
|
---|
[62] | 32 | cp Server/tewi.exe tewi-service.exe
|
---|
| 33 | cd Server
|
---|
[208] | 34 | ../Tool/genconf "C:/Tewi" modules dll > ../generated.conf
|
---|
[128] | 35 | ../Tool/itworks > ../itworks.html
|
---|
[251] | 36 | makensis -DVERSION=$VERSION install.nsi || fail
|
---|
[79] | 37 | cp install.exe ../install-nossl.exe
|
---|
[62] | 38 | rm -f tewi.exe tewi-service.exe
|
---|
| 39 | cd ..
|
---|
[79] | 40 |
|
---|
| 41 | sed "s/define NO_SSL/undef NO_SSL/g" config.h.tmpl > config.h
|
---|
[288] | 42 | if [ ! "x$2" = "x" ]; then
|
---|
| 43 | sed -i "s/undef $2/define $2/g" config.h
|
---|
| 44 | fi
|
---|
[79] | 45 |
|
---|
| 46 | make clean || fail
|
---|
[208] | 47 | make PLATFORM=$1 -j4 PREFIX=C:/Tewi|| fail
|
---|
[79] | 48 | cp Server/tewi.exe tewi.exe
|
---|
| 49 | make clean || fail
|
---|
[208] | 50 | make PLATFORM=$1-service -j4 PREFIX=C:/Tewi || fail
|
---|
[79] | 51 | cp Server/tewi.exe tewi-service.exe
|
---|
| 52 | cd Server
|
---|
[208] | 53 | ../Tool/genconf "C:/Tewi" modules dll > ../generated.conf
|
---|
[128] | 54 | ../Tool/itworks > ../itworks.html
|
---|
[251] | 55 | makensis -DVERSION=$VERSION install.nsi || fail
|
---|
[79] | 56 | cp install.exe ../install-ssl.exe
|
---|
| 57 | rm -f tewi.exe tewi-service.exe
|
---|
| 58 | cd ..
|
---|
[128] | 59 |
|
---|
| 60 | rm itworks.html
|
---|
| 61 | rm generated.conf
|
---|