SC2: Add helpful feedback when failing to locate SC2 (#1032)
* 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:
parent
c2d69cb05e
commit
101dab0ea4
|
@ -793,7 +793,12 @@ def check_game_install_path() -> bool:
|
|||
with open(einfo) as f:
|
||||
content = f.read()
|
||||
if content:
|
||||
try:
|
||||
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):
|
||||
executable = sc2.paths.latest_executeble(Path(base).expanduser() / "Versions")
|
||||
|
||||
|
@ -810,7 +815,8 @@ def check_game_install_path() -> bool:
|
|||
else:
|
||||
sc2_logger.warning(f"{einfo} pointed to {base}, but we could not find an SC2 install there.")
|
||||
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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue