#!/usr/bin/env bash
# Author: cefeiko
########################################################################
export PW_PREFIX_NAME=DOTNET
export PORTWINE_CREATE_SHORTCUT_NAME="Pulse Online"

start_portwine

mkdir -p "${WINEPREFIX}/drive_c/games/PulseOnline/"
export PW_AUTOINSTALL_EXE="${WINEPREFIX}/drive_c/games/PulseOnline/PulseOnlineLauncher.exe"

if try_download "https://pulseonline.ru/game_download/PulseOnlineLauncher.exe" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    export portwine_exe="$PW_AUTOINSTALL_EXE"
    try_remove_file "${portwine_exe}.ppdb"
    pw_stop_progress_bar
    portwine_create_shortcut
    kill_portwine
fi

stop_portwine
