summarylogtreecommitdiffstats
path: root/evelauncher.sh.in
blob: 725bb6ee36273c02f223ab10d5aa2f71f924d736 (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh

set -e

check_env() {
    if [ -d "$CONFDIR" ] ;then
	if [ -r "$CONFDIR/EVE.conf" ] ;then
	    SHAREDIR=$(grep SharedCacheFolder $CONFDIR/EVE.conf | cut -d= -f2)
	fi
    fi
    SHAREDIR=${SHAREDIR:-$HOME/.eve/}
    [ ! -d "$SHAREDIR" ] && SHAREDIR=""
    if [ "x$SHAREDIR" != "x$EVEDIR/SharedCache/" ] ;then
	desktop_msg "Please wait, preparing environment in $EVEDIR"
	mkdir -p $CONFDIR
	echo "[General]" >$CONFDIR/EVE.conf
	echo "SharedCacheFolder=$EVEDIR/SharedCache/" >>$CONFDIR/EVE.conf
	echo "UseCustomWine=true" >>$CONFDIR/EVE.conf
	echo "CustomWinePath=$WINEPATH/wine" >>$CONFDIR/EVE.conf
	mkdir -p $EVEDIR/SharedCache
	tar xf $SETUPDIR/lib/evelauncher-$ELVER.tar.gz -C $EVEDIR
	mv $EVEDIR/evelauncher/ $LAUNCHER/
	if [ -d "$SHAREDIR/ResFiles/" ] ;then
	    mv $SHAREDIR/ResFiles/ $EVEDIR/SharedCache/
	    mv $SHAREDIR/*.txt $EVEDIR/SharedCache/
	    rm -rf $SHAREDIR
	fi
    fi
}

check_transl() {
    if [ ! -r "$LAUNCHER/translations/qt_en.qm" ] ;then
	if [ -r "$LAUNCHER/libQt5Core.so.$QTVER.0" ] ;then
	    for eta in $(ls $SETUPDIR/lib/eve-transl${QTVER}-??.tar.gz) ;do
		tar xf $eta -C $LAUNCHER
	    done
	fi
    fi
}

check_steam() {
    if [ ! -r "$LAUNCHER/steam_appid.txt" -a -x "$(which steam 2>/dev/null)" ] ;then
	echo "8500" >$LAUNCHER/steam_appid.txt
    fi
}

ELVER=""
QTVER="5.11"
SHAREDIR=""
CONFDIR="$HOME/.config/CCP"
EVEDIR="$HOME/.local/lib/EVE"
LAUNCHER="$EVEDIR/Launcher"
SETUPDIR="/opt/evesetup"
WINEPATH="/usr/bin"

. $SETUPDIR/lib/evelauncher.shlib

check_env
check_transl
check_wine
check_steam

cd $EVEDIR
exec $LAUNCHER/evelauncher.sh