#!/usr/bin/env bash
# Author: chal55rus (Sergey P.)
# type: emulators
# name: FCEUX
# image: fceux
# info_en: An emulator for the Nintendo Entertainment System (NES) that allows players to enjoy classic NES games on modern devices with high compatibility and various enhancements. The emulator includes tools for game development, testing, and recording.
# info_ru: Эмулятор Nintendo Entertainment System (NES), который позволяет игрокам наслаждаться классическими играми для NES на современных устройствах с высокой совместимостью и различными улучшениями. Эмулятор включает инструменты для разработки, тестирования и записи игр.
########################################################################
export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/fceux-2.6.6-win64.zip"
start_portwine
if try_download "https://github.com/TASEmulators/fceux/releases/download/v2.6.6/fceux-2.6.6-win64.zip" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    pw_start_progress_bar_install_game "FCEUX."
    "$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/Program Files (x86)/FCEUX"
    portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/FCEUX/fceux64.exe"
    try_remove_file "${PW_AUTOINSTALL_EXE}"
    try_remove_file "${portwine_exe}.ppdb"
    kill_portwine
    pw_stop_progress_bar
    export PORTWINE_CREATE_SHORTCUT_NAME="FCEUX"
    portwine_create_shortcut
fi
stop_portwine
