fix: trigger on dayz launcher process

This commit is contained in:
aclist 2026-08-20 13:29:47 +09:00
parent c03aa8f166
commit 7dfdb4209a
2 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@ from dzgui.const.constants import (
APPID_DAYZ_EXP, APPID_DAYZ_EXP,
APP_NAME, APP_NAME,
DAYZ_BINARY, DAYZ_BINARY,
DAYZ_LAUNCHER,
DEBIAN_STEAM_PATH, DEBIAN_STEAM_PATH,
DEFAULT_STEAM_PATH, DEFAULT_STEAM_PATH,
FLATPAK_STEAM_PATH, FLATPAK_STEAM_PATH,
@ -382,14 +383,14 @@ def get_client_allows_downloads(path: Path) -> bool:
def is_dayz_running() -> bool: def is_dayz_running() -> bool:
"""Subprocesses spawned from Steam will not show up in regular process tree""" """Subprocesses spawned from Steam will not show up in regular process tree"""
procs = [] procs = []
substring = DAYZ_BINARY substring = [DAYZ_BINARY, DAYZ_LAUNCHER]
for proc in psutil.process_iter(): for proc in psutil.process_iter():
try: try:
procs.append(proc.cmdline()) procs.append(proc.cmdline())
except Exception as e: except Exception as e:
logger.warning(e) logger.warning(e)
continue 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: def get_app_path(folders_path: Path, appid: int) -> Path:

View File

@ -12,6 +12,7 @@ APPNAME_DAYZ = "DayZ"
APPNAME_DAYZ_EXP = "DayZ Exp" APPNAME_DAYZ_EXP = "DayZ Exp"
APPNAME_DAYZ_EXP_HUMAN = "DayZ Experimental" APPNAME_DAYZ_EXP_HUMAN = "DayZ Experimental"
DAYZ_BINARY = "DayZ_x64.exe" DAYZ_BINARY = "DayZ_x64.exe"
DAYZ_LAUNCHER = "DayZLauncher.exe"
LIBRARYFOLDERS_PATH = "steamapps/libraryfolders.vdf" LIBRARYFOLDERS_PATH = "steamapps/libraryfolders.vdf"
WORKSHOP_PATH = "steamapps/workshop/content/" + str(APPID_DAYZ) WORKSHOP_PATH = "steamapps/workshop/content/" + str(APPID_DAYZ)