PW_GOG 1.22 KB
Newer Older
1
#!/usr/bin/env bash
castro-fidel's avatar
castro-fidel committed
2
# Author: Castro-Fidel (linux-gaming.ru)
3 4 5 6 7
# type: games
# name: GoG Galaxy Launcher
# image: gog
# info_en:
# info_ru:
8
########################################################################
Mikhail Tergoev's avatar
Mikhail Tergoev committed
9 10 11 12 13
GOG_VER="$(curl "https://remote-config.gog.com/components/webinstaller?component_version=2.0.0" \
| awk -F'setup_galaxy_' '{print $2}' \
| awk -F'.exe' '{print $1}')"
[[ "${GOG_VER}" != 2.* ]] && yad_error "ERROR: Get the GOG version." && exit 1
export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/setup_galaxy_${GOG_VER}.exe"
14
export LAUNCH_PARAMETERS=("/VERYSILENT")
15
export PW_PREFIX_NAME="GOG"
16 17 18
export DISABLE_CP_DEFPFX="1"
export PW_WINE_USE="WINE_LG"
export PORTWINE_CREATE_SHORTCUT_NAME="GOG GALAXY"
19

Mikhail Tergoev's avatar
Mikhail Tergoev committed
20
start_portwine
21

Mikhail Tergoev's avatar
Mikhail Tergoev committed
22
if try_download "https://content-system.gog.com/open_link/download?path=/open/galaxy/client/${GOG_VER}/setup_galaxy_${GOG_VER}.exe" "${PW_AUTOINSTALL_EXE}" no_mirror
23
then
Mikhail Tergoev's avatar
Mikhail Tergoev committed
24
    pw_start_progress_bar_install_game "GOG Galaxy."
castro-fidel's avatar
castro-fidel committed
25
    pw_run "${PW_AUTOINSTALL_EXE}"
26
    portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/GOG Galaxy/GalaxyClient.exe"
castro-fidel's avatar
castro-fidel committed
27
    try_remove_file "${PW_AUTOINSTALL_EXE}"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
28
    try_remove_file "${portwine_exe}.ppdb"
29
    kill_portwine
castro-fidel's avatar
castro-fidel committed
30
    pw_stop_progress_bar
31 32
    portwine_create_shortcut
fi
33

34
stop_portwine