#!/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="${PW_USER_TEMP}/Celeste.Installer.exe"
export PORTWINE_CREATE_SHORTCUT_NAME="Age of Empires Online"

start_portwine
if try_download "https://github.com/ProjectCeleste/Celeste.Launcher/releases/latest/download/Celeste.Installer.exe" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    pw_start_progress_bar_install_game "Age of Empires Online."
    pw_run "${PW_AUTOINSTALL_EXE}"
    portwine_exe="$WINEPREFIX/drive_c/users/steamuser/AppData/Roaming/ProjectCeleste/Celeste Launcher.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
