PW_GAMEFORGE 1.41 KB
Newer Older
1
#!/usr/bin/env bash
castro-fidel's avatar
castro-fidel committed
2
# Author: chal55rus (Sergey P.), cefeiko, Castro-Fidel (linux-gaming.ru)
3
##########################################################################
castro-fidel's avatar
castro-fidel committed
4 5 6
pw_shutdown_please () {
    if [ "$PW_USE_RUNTIME" != 1 ]
    then echo "PW_USE_RUNTIME: `echo $PW_USE_RUNTIME`"
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    else
        sleep 10
        while true ; do
            if  [ -z "`ps aux | grep -v grep | grep -wm 1 "$1" | awk '{print $2}'`" ] && [ ! -z "`pgrep wrap | head -n 1`" ]; then
                echo -e "PID "$1" not found"
                sleep 1
            else
                killall -s TERM gfclient.exe
                killall -s TERM GameforgeInstaller.exe
                break
            fi
        done
    fi
}

export LAUNCH_PARAMETERS=("")
castro-fidel's avatar
castro-fidel committed
23
export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/GameforgeInstaller.exe"
24
start_portwine
25
if try_download_no_mirror "https://raw.githubusercontent.com/WarfaceZ/lutris-clients/master/GameforgeInstaller.exe" "${PW_AUTOINSTALL_EXE}"
26
then
Mikhail Tergoev's avatar
Mikhail Tergoev committed
27
    pw_start_progress_bar_block "Gameforge-Client. ${loc_gui_please_wait} "
castro-fidel's avatar
castro-fidel committed
28 29
    pw_shutdown_please SparkWebHelper.exe &
    pw_run "${PW_AUTOINSTALL_EXE}"
30
    portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/GameforgeClient/gfclient.exe"
castro-fidel's avatar
castro-fidel committed
31
    try_remove_file "${PW_AUTOINSTALL_EXE}"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
32
    try_remove_file "${portwine_exe}.ppdb"
33
    kill_portwine
castro-fidel's avatar
castro-fidel committed
34
    pw_stop_progress_bar
35 36 37
    export PORTWINE_CREATE_SHORTCUT_NAME="GameforgeClient"
    portwine_create_shortcut
fi
38
stop_portwine