Add files via upload

-added a progress bar for the script
This commit is contained in:
moraroy 2023-04-27 13:51:00 -07:00 committed by GitHub
parent 8c9ac9e6bd
commit b5aaba5341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
set -x set -x
set -u
# Display a list of options using zenity # Display a list of options using zenity
options=$(zenity --list --text="Which installers do you want to download and install?" --checklist --column=":)" --column="The default is one App ID Installation" FALSE "Seperate App IDs" TRUE "Epic Games Launcher" TRUE "GOG Galaxy" TRUE "Uplay" TRUE "Origin" TRUE "Battle.net" FALSE "Amazon Games - broken" FALSE "EA App - broken" --width=400 --height=350) options=$(zenity --list --text="Which installers do you want to download and install?" --checklist --column=":)" --column="The default is one App ID Installation" FALSE "Seperate App IDs" TRUE "Epic Games Launcher" TRUE "GOG Galaxy" TRUE "Uplay" TRUE "Origin" TRUE "Battle.net" FALSE "Amazon Games - broken" FALSE "EA App - broken" --width=400 --height=350)
@ -20,7 +23,9 @@ else
use_separate_appids=false use_separate_appids=false
fi fi
(
echo "0"
echo "# Detecting and Installing GE-Proton"
# Create NonSteamLaunchersInstallation subfolder in Downloads folder # Create NonSteamLaunchersInstallation subfolder in Downloads folder
mkdir -p ~/Downloads/NonSteamLaunchersInstallation mkdir -p ~/Downloads/NonSteamLaunchersInstallation
@ -62,17 +67,20 @@ installed_version=$(basename $proton_dir | sed 's/GE-Proton-//')
latest_version=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep tag_name | cut -d '"' -f 4) latest_version=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep tag_name | cut -d '"' -f 4)
if [ "$installed_version" != "$latest_version" ]; then if [ "$installed_version" != "$latest_version" ]; then
# Download GE-Proton using the first URL # Download GE-Proton using the first URL
echo "Downloading GE-Proton using the first URL"
wget $ge_proton_url1 -O ~/Downloads/NonSteamLaunchersInstallation/GE-Proton.tar.gz wget $ge_proton_url1 -O ~/Downloads/NonSteamLaunchersInstallation/GE-Proton.tar.gz
# Check if the download succeeded # Check if the download succeeded
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
# Download GE-Proton using the second URL # Download GE-Proton using the second URL
echo "Downloading GE-Proton using the second URL"
wget $ge_proton_url2 -O ~/Downloads/NonSteamLaunchersInstallation/GE-Proton.tar.gz wget $ge_proton_url2 -O ~/Downloads/NonSteamLaunchersInstallation/GE-Proton.tar.gz
fi fi
# Check if either download succeeded # Check if either download succeeded
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
# Install GE-Proton # Install GE-Proton
echo "Installing GE-Proton"
tar -xvf ~/Downloads/NonSteamLaunchersInstallation/GE-Proton.tar.gz -C ~/.steam/root/compatibilitytools.d/ tar -xvf ~/Downloads/NonSteamLaunchersInstallation/GE-Proton.tar.gz -C ~/.steam/root/compatibilitytools.d/
proton_dir=$(find ~/.steam/root/compatibilitytools.d -maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1) proton_dir=$(find ~/.steam/root/compatibilitytools.d -maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1)
else else
@ -82,6 +90,12 @@ installed_version=$(basename $proton_dir | sed 's/GE-Proton-//')
fi fi
fi fi
echo "10"
echo "# Setting files in their place"
# Set the appid for the non-Steam game # Set the appid for the non-Steam game
appid=NonSteamLaunchers appid=NonSteamLaunchers
@ -127,6 +141,11 @@ eaapp_url=https://origin-a.akamaihd.net/EA-Desktop-Client-Download/installer-rel
# Set the path to save the seventh file to # Set the path to save the seventh file to
eaapp_file=~/Downloads/NonSteamLaunchersInstallation/EAappInstaller.exe eaapp_file=~/Downloads/NonSteamLaunchersInstallation/EAappInstaller.exe
echo "20"
echo "# Creating folders"
# Create app id folder in compatdata folder if it doesn't exist # Create app id folder in compatdata folder if it doesn't exist
if [ ! -d "$HOME/.local/share/Steam/steamapps/compatdata/$appid" ]; then if [ ! -d "$HOME/.local/share/Steam/steamapps/compatdata/$appid" ]; then
mkdir -p "$HOME/.local/share/Steam/steamapps/compatdata/$appid" mkdir -p "$HOME/.local/share/Steam/steamapps/compatdata/$appid"
@ -142,6 +161,8 @@ export STEAM_COMPAT_CLIENT_INSTALL_PATH="~/.local/share/Steam"
export STEAM_COMPAT_DATA_PATH=~/.local/share/Steam/steamapps/compatdata/$appid export STEAM_COMPAT_DATA_PATH=~/.local/share/Steam/steamapps/compatdata/$appid
wait wait
echo "30"
echo "# Downloading/Installing Epic Games"
# Check if the user selected Epic Games Launcher # Check if the user selected Epic Games Launcher
if [[ $options == *"Epic Games Launcher"* ]]; then if [[ $options == *"Epic Games Launcher"* ]]; then
@ -182,6 +203,9 @@ fi
# Wait for the MSI file to finish running # Wait for the MSI file to finish running
wait wait
echo "40"
echo "# Downloading/Installing Gog Galaxy"
# Check if the user selected GOG Galaxy # Check if the user selected GOG Galaxy
if [[ $options == *"GOG Galaxy"* ]]; then if [[ $options == *"GOG Galaxy"* ]]; then
@ -222,7 +246,8 @@ if [[ $options == *"GOG Galaxy"* ]]; then
# Wait for 5 seconds to give the GalaxySetup.tmp process time to start # Wait for 5 seconds to give the GalaxySetup.tmp process time to start
sleep 90 sleep 90
echo "45"
echo "# Downloading/Installing Gog Galaxy"
# Cancel & Exit the GOG Galaxy Setup Wizard # Cancel & Exit the GOG Galaxy Setup Wizard
pkill GalaxySetup.tmp pkill GalaxySetup.tmp
@ -245,6 +270,9 @@ if [[ $options == *"GOG Galaxy"* ]]; then
fi fi
wait wait
echo "50"
echo "# Downloading/Installing Uplay"
# Check if user selected Uplay # Check if user selected Uplay
if [[ $options == *"Uplay"* ]]; then if [[ $options == *"Uplay"* ]]; then
@ -286,6 +314,10 @@ fi
# Wait for the UBI file to finish running # Wait for the UBI file to finish running
wait wait
echo "60"
echo "# Downloading/Installing Origin"
# Check if user selected Origin # Check if user selected Origin
if [[ $options == *"Origin"* ]]; then if [[ $options == *"Origin"* ]]; then
@ -335,6 +367,8 @@ if [[ $options == *"Origin"* ]]; then
fi fi
wait wait
echo "70"
echo "# Downloading/Installing Battle.net"
# Check if user selected Battle.net # Check if user selected Battle.net
if [[ $options == *"Battle.net"* ]]; then if [[ $options == *"Battle.net"* ]]; then
@ -382,6 +416,9 @@ fi
wait wait
echo "80"
echo "# Downloading/Installing Amazon Games"
# Check if user selected Amazon Games # Check if user selected Amazon Games
if [[ $options == *"Amazon Games"* ]]; then if [[ $options == *"Amazon Games"* ]]; then
# User selected Amazon Games # User selected Amazon Games
@ -425,6 +462,9 @@ fi
wait wait
echo "90"
echo "# Downloading/Installing EA App"
# Check if user selected EA App # Check if user selected EA App
if [[ $options == *"EA App"* ]]; then if [[ $options == *"EA App"* ]]; then
# User selected EA App # User selected EA App
@ -472,6 +512,17 @@ wait
# Delete NonSteamLaunchersInstallation subfolder in Downloads folder # Delete NonSteamLaunchersInstallation subfolder in Downloads folder
rm -rf ~/Downloads/NonSteamLaunchersInstallation rm -rf ~/Downloads/NonSteamLaunchersInstallation
echo "Script is finished - you may close all windows" echo "100"
exit echo "# Script is finished - you may close all windows"
) |
zenity --progress \
--title="Update Status" \
--text="Starting update..." --width=400 --height=350\
--percentage=0
if [ "$?" = -1 ] ; then
zenity --error \
--text="Update canceled."
fi
exit