commit 129ce991a2d7066065223df17d2adae11cc53950 Author: zacharias@4zellen.se Date: Thu Feb 12 22:13:08 2026 +0100 Initial commit diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..fe6ea24 --- /dev/null +++ b/install.sh @@ -0,0 +1,176 @@ +#!/usr/bin/env bash + +echo "This script is insteded to help installing EA App on a generic linux envirment. Developed by Zacharias (c) Zacharias 2026" + +if [[ $EUID -eq 0 ]] then + echo "You shuld not run this as root!" + echo "Exiting..." + exit 126 +fi + +## This variable contains ether the path of your GloriousEggroll Proton, +## or the magic number "PATH" to indicate that it can be executed without exact tergeting +## We will default to GE Proton, but support other protons if those are found instead. +PROTON_PATH="" + +STEAM_CUTOM_PROTON_PATH="$HOME/.steam/steam/compatibilitytools.d" + +GET_PROTON=0 + +TMP_DIR="/tmp/ea-app-installer" +rm -fr "$TMP_DIR" +mkdir "$TMP_DIR" + +## Testing if proton ge is in path +if command -v proton-ge > /dev/null 2>&1; then + PROTON_PATH="PATH" +elif [[ -d "$STEAM_CUTOM_PROTON_PATH" ]] then + found=0 + ## We have found a known path for protons! + for subdir in "$STEAM_CUTOM_PROTON_PATH"/*/; do + subdir="${subdir%/}" + if [[ -x "$subdir/proton" ]] then + ## We found a proton! we will asume this is a good and working one :) + PROTON_PATH="$subdir/proton" + found=1 + break + fi + done + + if [[ $found -eq 0 ]] then + GET_PROTON=1 + fi +else + GET_PROTON=1 +fi + +sleep 5 + +if [[ $GET_PROTON -eq 1 ]] then + echo "Failed to find Proton. If you know where Proton is, enter the path. Otherwise, we can install the latest Proton GE. Proceed? [Y/n]" + read answer + + if [[ "$answer" == "y" || "$answer" == "yes" || "$answer" == "Y" || "$answer" == "" ]] then + echo "Installing Proton GE..." + GOOD_DIRECTORY=0 + mkdir -p "$STEAM_CUTOM_PROTON_PATH" + if [[ -d "$STEAM_CUTOM_PROTON_PATH" ]] then + GOOD_DIRECTORY=1; + else + echo "Failed to create steam compatibilitytools directory (Proton directory). Please create it yourself and retry. Do not re run this as root!" + exit 1 + fi + + ## Testing if the envirment is good and has the necisary commands, this will asume a GNU/Linux compadible envirment. + + echo "Testing envirment..." + + GOOD_ENV=1 + MISSING_ENV="" + + for cmd in curl grep cut sha512sum tar basename; do + if ! command -v "$cmd" >/dev/null 2>&1; then + GOOD_ENV=0 + MISSING_ENV+="$cmd;" + fi + done + + if [[ $GOOD_ENV -eq 0 ]] then + echo "You are missing vital commands in this environment. Please install: ${MISSING_ENV//;/ }" + exit 1 + fi + + echo "Envirment passes" + + echo "Fetching tarball URL..." + tarball_url=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .tar.gz) + tarball_name=$(basename $tarball_url) + echo "Downloading tarball $tarball_name..." + curl -sS -L "$tarball_url" -o "$TMP_DIR/$tarball_name" || { + echo "Download failed!" + exit 1 + } + + echo "Fetching checksum URL..." + checksum_url=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .sha512sum) + checksum_name=$(basename $checksum_url) + echo "Downloading checksum: $checksum_name..." + curl -sS -L "$checksum_url" -o "$TMP_DIR/$checksum_name" || { + echo "Download failed!" + exit 1 + } + + echo "Verifying tarball $tarball_name with checksum $checksum_name..." + work_dir=pwd + cd "$TMP_DIR" || exit 1 + if ! sha512sum -c "$checksum_name" > /dev/null 2>&1; then + echo "sha512 check failed. We discurage continuing with this, but we trust you [y/N]: " + read answer + if [[ "$answer" == "y" || "$answer" == "yes" || "$answer" == "Y" || "$answer" == "" ]] then + echo "This will not proceed at your own risk..." + else + echo "Exiting due to failed sha512 check" + exit 1 + fi + fi + + echo "Extracting $tarball_name to the Steam compatibility tools folder..." + tar -xf $tarball_name -C $STEAM_CUTOM_PROTON_PATH + echo "Done" + + PROTON_PATH="${$STEAM_CUTOM_PROTON_PATH/.tar.gz/}" + + echo "Verifying existence of Proton" + if [[ -x "$PROTON_PATH/proton" ]] then + echo "Newly downloaded Proton exists" + else + echo "The newly downloaded Proton failed" + exit 1 + fi + elif [[ "$answer" == "n" || "$answer" == "no" || "$answer" == "N" ]] then + echo "Please install proton thru other means." + exit 1 + else + echo "Verifying existence of Proton" + if [[ -x "$answer/proton" ]] then + echo "Provided Proton exists" + PROTON_PATH="$answer" + else + echo "Failed to verify the provided Proton" + exit 1 + fi + fi +fi + +echo "Found Proton" + +sleep 5 + +if [[ -z "$PROTON_PATH" ]] then + echo "The Proton Path is empty for unkown reasons. Please try again." + exit 1 +fi + +echo "Downloading the EA App Installer" +sleep 5 + +if ! command -v curl > /dev/null 2>&1; then + echo "Missing curl. Please download it." + exit 1 +fi + +curl -sS -L "https://origin-a.akamaihd.net/EA-Desktop-Client-Download/installer-releases/EAappInstaller.exe" -o "$TMP_DIR/EAappInstaller.exe" || { + echo "Failed to download EAappInstaller.exe from EA website." + exit 1; +} + +echo "Asumtions are being made about instalation locations. (This script asumes that proton ge is used). copying .desktop file!" +STEAM_COMPAT_DATA_PATH="$HOME/.local/share/EAapp/" +mkdir -p "$STEAM_COMPAT_DATA_PATH" +echo "Using $STEAM_COMPAT_DATA_PATH as proton prefix. This is where EA App will be installed to" +# TODO: Add the copying or generation of the .desktop file +echo " +sleep 5 +echo "Starting proton in 5s, we might lose controll, if no application starts then we might have an issue, I trust you proton!..." +sleep 5 +"$PROTON_PATH/proton" "$TMP_DIR/EAappInstaller.exe" \ No newline at end of file