SC2: Add helpful feedback when failing to locate SC2 ()

* SC2: The client now throws a descriptive error when ExecuteInfo.txt exists but is empty, and offers more helpful suggestions when the file doesn't exist.

* SC2: Replaced the new RuntimeError with a warning in the logger to keep things consistent.

* Removed communism

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>

Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
SoldierofOrder 2022-09-18 10:48:36 -04:00 committed by GitHub
parent c2d69cb05e
commit 101dab0ea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -793,7 +793,12 @@ def check_game_install_path() -> bool:
with open(einfo) as f: with open(einfo) as f:
content = f.read() content = f.read()
if content: if content:
try:
base = re.search(r" = (.*)Versions", content).group(1) base = re.search(r" = (.*)Versions", content).group(1)
except AttributeError:
sc2_logger.warning(f"Found {einfo}, but it was empty. Run SC2 through the Blizzard launcher, then "
f"try again.")
return False
if os.path.exists(base): if os.path.exists(base):
executable = sc2.paths.latest_executeble(Path(base).expanduser() / "Versions") executable = sc2.paths.latest_executeble(Path(base).expanduser() / "Versions")
@ -810,7 +815,8 @@ def check_game_install_path() -> bool:
else: else:
sc2_logger.warning(f"{einfo} pointed to {base}, but we could not find an SC2 install there.") sc2_logger.warning(f"{einfo} pointed to {base}, but we could not find an SC2 install there.")
else: else:
sc2_logger.warning(f"Couldn't find {einfo}. Please run /set_path with your SC2 install directory.") sc2_logger.warning(f"Couldn't find {einfo}. Run SC2 through the Blizzard launcher, then try again. "
f"If that fails, please run /set_path with your SC2 install directory.")
return False return False