#!/usr/bin/env bash
# Author: chal55rus
# type: games
# name: Goose Goose Duck
# image: goosegooseduck
# info_en:
# info_ru:
########################################################################
VERSION="3.11.00"
export PW_PREFIX_NAME="GOOSE_GOOSE_DUCK"
export LAUNCH_PARAMETERS=("/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-")
export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/Goose Goose Duck Installer $VERSION release.exe"
export PORTWINE_CREATE_SHORTCUT_NAME="Goose Goose Duck"

start_portwine
if try_download "https://firebasestorage.googleapis.com/v0/b/gaggle-staging.appspot.com/o/Builds%2FGGD%2FGoose%20Goose%20Duck%20Installer%20${VERSION}%20release.exe?alt=media&token=e6c29f8f-bfd8-4592-a740-821aa4cebe00" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    pw_start_progress_bar_install_game "Goose Goose Duck."
    pw_run "${PW_AUTOINSTALL_EXE}"
    portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/Goose Goose Duck/GGDLauncher.exe"
    try_remove_file "${PW_AUTOINSTALL_EXE}"
    try_remove_file "${portwine_exe}.ppdb"
    kill_portwine
    pw_stop_progress_bar
    portwine_create_shortcut
fi
stop_portwine
