added remove old links if builtin file not found

This commit is contained in:
Mikhail Tergoev
2024-10-19 14:18:57 +03:00
parent 55f69c96e2
commit a35ba3bba4
4 changed files with 26 additions and 8 deletions

View File

@ -378,7 +378,13 @@ create_new_dir () {
}
try_force_link_file () {
if [[ ! -f "$1" ]] ; then print_warning "file not found for link: $1" && return 1
if [[ ! -f "$1" ]] ; then
print_warning "file not found for link: $1"
if [[ -f "$2" ]] ; then
try_remove_file "$2"
print_warning "removed old link: $2"
fi
return 1
elif [[ -z "$2" ]] ; then print_error "no way to link file $1" && return 1
elif [[ -f "$2.sha256sum" ]] ; then print_warning "$2 this file has sha256sum"
try_remove_file "$2"
@ -5371,8 +5377,11 @@ resize_png () {
local RESIZE_TO="$3"
fi
[[ -f "${PORT_WINE_PATH}/data/img/${RESIZE_NAME_PNG}.png" ]] && return 0
if [[ -f "${PORT_WINE_PATH}/data/img/${RESIZE_NAME_PNG}.png" ]] \
|| [[ ! -f "${RESIZE_FILE}" ]]
then
return 0
fi
try_remove_file "${PORT_WINE_PATH}/data/img/launcher.png"
try_remove_file "${PORT_WINE_PATH}/data/img/Launcher.png"

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Author: chal55rus
# type: games
# name: AGE OF EMPIRES ONLINE
# name: Age of Empires Online
# image: celeste
# info_en:
# info_ru:
@ -9,12 +9,12 @@
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"
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_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}"