diff --git a/dzgui/api/steam.py b/dzgui/api/steam.py index c5b0074..4ac97bc 100644 --- a/dzgui/api/steam.py +++ b/dzgui/api/steam.py @@ -16,6 +16,7 @@ from dzgui.const.constants import ( APPID_DAYZ_EXP, APP_NAME, DAYZ_BINARY, + DAYZ_LAUNCHER, DEBIAN_STEAM_PATH, DEFAULT_STEAM_PATH, FLATPAK_STEAM_PATH, @@ -382,14 +383,14 @@ def get_client_allows_downloads(path: Path) -> bool: def is_dayz_running() -> bool: """Subprocesses spawned from Steam will not show up in regular process tree""" procs = [] - substring = DAYZ_BINARY + substring = [DAYZ_BINARY, DAYZ_LAUNCHER] for proc in psutil.process_iter(): try: procs.append(proc.cmdline()) except Exception as e: logger.warning(e) continue - return any(substring in item for sublist in procs for item in sublist) + return any(s in item for sublist in procs for item in sublist for s in substring) def get_app_path(folders_path: Path, appid: int) -> Path: diff --git a/dzgui/const/constants.py b/dzgui/const/constants.py index 5be3d0b..d75fc31 100644 --- a/dzgui/const/constants.py +++ b/dzgui/const/constants.py @@ -12,6 +12,7 @@ APPNAME_DAYZ = "DayZ" APPNAME_DAYZ_EXP = "DayZ Exp" APPNAME_DAYZ_EXP_HUMAN = "DayZ Experimental" DAYZ_BINARY = "DayZ_x64.exe" +DAYZ_LAUNCHER = "DayZLauncher.exe" LIBRARYFOLDERS_PATH = "steamapps/libraryfolders.vdf" WORKSHOP_PATH = "steamapps/workshop/content/" + str(APPID_DAYZ)