diff --git a/src/install.py b/src/install.py index 3c765d6..794b0e4 100644 --- a/src/install.py +++ b/src/install.py @@ -16,7 +16,7 @@ # along with this program. If not, see . import glob -import os.path +import os import shlex import shutil import subprocess @@ -82,13 +82,22 @@ def gen_cmd_line(options): def install(cmd): try: - subprocess.run(shlex.split(cmd), cwd=paths.EXTRACTED_DIR, check=True) + ret = subprocess.run(shlex.split(cmd), cwd=paths.EXTRACTED_DIR, check=True, capture_output=True) + if not ret.stdout.decode().find("Installing skin"): + return (False, _("Install: Found no Valid Install Targets")) except subprocess.CalledProcessError: return (False, _("Install: Installer Process Failed")) return (True, None) +def steam_dir_missing(): + return not os.path.exists(paths.STEAM_DIR) and not os.path.exists(paths.STEAM_FLATPAK_DIR) + def run(options): + + if steam_dir_missing(): + return(False, "Install: Failed to Find Valid '~/.steam/steam' Symlink") + clean_dir(paths.TMP_DIR) clean_dir(paths.EXTRACTED_DIR) diff --git a/src/paths.py b/src/paths.py index 5d7f35a..ee95102 100644 --- a/src/paths.py +++ b/src/paths.py @@ -17,6 +17,9 @@ import os.path +STEAM_DIR=os.path.expanduser("~/.steam/steam") +STEAM_FLATPAK_DIR=os.path.expanduser("~/.var/app/com.valvesoftware.Steam/.steam/steam") + XDG_CACHE_DIR=os.path.expanduser(os.environ.get("XDG_CACHE_HOME", "~/.cache")) CACHE_DIR=os.path.join(XDG_CACHE_DIR, "AdwSteamInstaller") TMP_DIR=os.path.join(CACHE_DIR, "tmp")