TOOL: ags_for_debian - Bash script to help run AGS editor on Debian 12

Started by vertex, Yesterday at 11:20:20

Previous topic - Next topic

vertex

I have created a small bash script to help me run AGS on my Debian 12 machines using wine and wanted to share it. It appears to work for me and I hope it will work for you too.

It does 2 things:
* Run AGS if found.
* Install wine and winetricks, download AGS, install winetricks extras, unzip AGS to right path.

Disclaimer: I'm horrible at bash so it is what it is.

Code: ags
#!/bin/bash

AGS="AGS-3.6.1.33-P11"
ARCH="win32"
WINEPREFIX="$HOME/.wine-$AGS"
URL="https://www.adventuregamestudio.co.uk/releases/finals/AGS-3.6.1P11/AGS-3.6.1.33-P11.zip"

echo "AGS for Debian 12."
echo "ags: $AGS"
echo "url: $URL"
echo "arch: $ARCH"
echo "target directory: $WINEPREFIX"

# Look for and try to start AGS.
EDITOR="$WINEPREFIX"/drive_c/"$AGS"/AGSEditor.exe
echo "Searching for AGS at $EDITOR..."

if [ -f "$EDITOR" ]; then
    echo "AGS found. Starting AGS..."
    WINEPREFIX="$WINEPREFIX" wine start "C:\\$AGS\\AGSEditor.exe"
    exit 1
fi

# Not found so let's install.
echo "AGS was not found at $EDITOR. Continuing with installer..."

read -p "Would you like to install Wine and Winetricks? (y/n): " answer

# Convert to lowercase.
answer="${answer,,}"

if [[ "$answer" == "y" || "$answer" == "yes" ]]; then
    echo "Installing Wine and Winetricks..."
    sudo apt install -y wine winetricks
    echo "Installation complete."
else
    echo "Installation skipped."
fi

read -p "Would you like to download AGS-3.6.1.33-P11.zip? (y/n): " answer

# Convert to lowercase.
answer="${answer,,}"

if [[ "$answer" == "y" || "$answer" == "yes" ]]; then
    echo "Downloading AGS..."
    wget $URL
    echo "Download complete."
else
    echo "Download skipped."
fi

# Create prefix.
echo "Creating Wine prefix at: $WINEPREFIX"
echo "Architecture: $ARCH"
WINEARCH="$ARCH" WINEPREFIX="$WINEPREFIX" wineboot -i
echo "Wine prefix complete."

# Install extras.
echo "Installing corefonts..."
WINEPREFIX="$WINEPREFIX" winetricks -q corefonts
echo "Install corefonts complete."

echo "Installing allfonts..."
WINEPREFIX="$WINEPREFIX" winetricks -q allfonts
echo "Install allfonts complete."

echo "Installing dotnet..."
WINEPREFIX="$WINEPREFIX" winetricks -q dotnet46
echo "Install dotnet complete."

# Unzip AGS.
echo "Unzip $AGS.zip..."
mkdir -p "$WINEPREFIX"/drive_c/"$AGS"
unzip "$AGS".zip -d "$WINEPREFIX"/drive_c/"$AGS"

echo "Installation complete. Run again to start AGS."

SMF spam blocked by CleanTalk