#!/usr/bin/env bash
# Author: chal55rus
# type: games
# name: Age of Empires Online
# image: celeste
# info_en: A multiplayer real-time strategy game where players build their civilizations, gather resources, and battle against opponents. The game features a unique economic system and the ability to develop cities through various missions and quests.
# info_ru: Многопользовательская стратегия в реальном времени, где игроки строят свои цивилизации, собирают ресурсы и сражаются с противниками. Игра предлагает уникальную экономическую систему и возможность развивать свои города с помощью различных миссий и задач.
########################################################################
export PW_PREFIX_NAME="AGE_OF_EMPIRES_ONLINE"
export LAUNCH_PARAMETERS="/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-"
export PW_AUTOINSTALL_EXE="${PORT_WINE_TMP_PATH}/Celeste.Installer.exe"
export PORTWINE_CREATE_SHORTCUT_NAME="Age of Empires Online"

start_portproton
if try_download "https://github.com/ProjectCeleste/Celeste.Launcher/releases/latest/download/Celeste.Installer.exe" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    pw_run "${PW_AUTOINSTALL_EXE}"
    PW_EXE_FILE="$WINEPREFIX/drive_c/users/steamuser/AppData/Roaming/ProjectCeleste/Celeste Launcher.exe"
    try_remove_file "${PW_AUTOINSTALL_EXE}"
    try_remove_file "${PW_EXE_FILE}.ppdb"
    kill_portwine
    portwine_create_shortcut
fi
stop_portproton
