From 0e8a15611afe440798647432af1066d34345deb6 Mon Sep 17 00:00:00 2001 From: stormdragon2976 Date: Mon, 12 Jun 2023 11:21:40 -0400 Subject: [PATCH] Added internal unix2dos so that the external program is no longer needed. --- audiogame-manager.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index f218cc9..337f4ec 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -215,12 +215,6 @@ checklist() { fi packageList+=("perl") packageList+=("sqlite") - if command -v unix2dos &> /dev/null ; then - [[ $# -eq 0 ]] && echo "Dos2unix is installed." - else - errorList+=("Warning: unix2dos is not installed. Some games need a configuration file in dos format before they will run.") - fi - packageList+=("unix2dos") if command -v w3m &> /dev/null ; then [[ $# -eq 0 ]] && echo "W3m is installed." else @@ -517,6 +511,18 @@ install_wine() { set +e } + +unix2dos() { + if [[ $# -eq 0 ]]; then + echo "Usage: unix2dos file(s)." + exit 1 + fi + for file in "${@}" ; do + sed -i 's/$/\r/' "${file}" + done +} + + winetricks() { # Report used packages to the winetricks maintainer so he knows they are being used. if ! [[ -e "${XDG_CACHE_HOME:-$HOME/.cache}/winetricks/track_usage" ]]; then @@ -2238,7 +2244,7 @@ download "https://erion.cf/files/ag_103.zip" mkdir -p "$WINEPREFIX/drive_c/Program Files/bsc-key-generator" 7z x -o"$WINEPREFIX/drive_c/Program Files/bsc-key-generator" "${cache}/BSC unlock code generator.7z" echo "$USER"$'\n'"$(hostname)"$'\n'"none"$'\n'"US" > "$WINEPREFIX/drive_c/Program Files/Hunter/config.dat" - command -v unix2dos &> /dev/null && unix2dos "$WINEPREFIX/drive_c/Program Files/Hunter/config.dat" || echo "Warning! You do not have unix2dos or dos2unix installed, Hunter may not work!" + unix2dos "$WINEPREFIX/drive_c/Program Files/Hunter/config.dat" if command -v xclip &> /dev/null && command -v xdotool &> /dev/null ; then wine "c:\Program Files\Hunter\HunterRegistration.exe" & xdotool sleep 10 key Return sleep 2 key Return sleep 2 key Alt+n @@ -3035,7 +3041,7 @@ export norh=false # Must install a voice, and rhvoice works easily with 64 bit. mkdir -p "$WINEPREFIX/drive_c/Program Files/bsc-key-generator" 7z x -o"$WINEPREFIX/drive_c/Program Files/bsc-key-generator" "${cache}/BSC unlock code generator.7z" echo "$USER"$'\n'"$(hostname)"$'\n'"none"$'\n'"US" > "$WINEPREFIX/drive_c/Program Files/Troopanum 2.0/config.dat" - command -v unix2dos &> /dev/null && unix2dos "$WINEPREFIX/drive_c/Program Files/Troopanum 2.0/config.dat" || echo "Warning! You do not have unix2dos or dos2unix installed, Troopanum 2.0 may not work!" + unix2dos "$WINEPREFIX/drive_c/Program Files/Troopanum 2.0/config.dat" if command -v xclip &> /dev/null && command -v xdotool &> /dev/null ; then wine "c:\Program Files\Troopanum 2.0\register.exe" & xdotool sleep 10 key Return sleep 2 key Return sleep 2 key Alt+n