#!/usr/bin/env bash
# Author: chal55rus (Sergey P.)
# type: games
# name: vkPlay Games Center
# image: mygames
# info_en:
# info_ru:
########################################################################
export LAUNCH_PARAMETERS=("")
export PW_PREFIX_NAME="VK_PLAY"
export PW_AUTOINSTALL_EXE="${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/steamuser/AppData/Local/VKPlayLoader.exe"
export WINEDLLOVERRIDES="mscoree,mshtml="
export PW_MUST_HAVE_DLL=""
export PW_WINE_USE="WINE_LG"

start_portwine
if try_download "https://static.gc.my.games/VKPlayLoader.exe" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    portwine_exe="$WINEPREFIX/drive_c/users/steamuser/AppData/Local/VKPlayLoader.exe"
    try_remove_file "${portwine_exe}.ppdb"
    pw_stop_progress_bar
    export PORTWINE_CREATE_SHORTCUT_NAME="vkPlay"
    portwine_create_shortcut
fi
stop_portwine
