Skip to content

Commit

Permalink
Merge branch 'steam-path-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
EphDoering committed Jan 21, 2025
1 parent 59e1c6e commit 8dc3575
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fa_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import re
import subprocess
import shutil
import traceback
from pathlib import Path

from __main__ import __file__ as main_file
Expand Down Expand Up @@ -34,6 +34,17 @@
_game = os.environ["SteamAppId"]
steam_game_path = Path(os.getcwd())
_steam_path = steam_game_path.joinpath("..", "..", "..")
if sys.platform == WIN:
import winreg

_key = "SOFTWARE\WOW6432Node\Valve\Steam"
try:
_hkey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, _key)
_install_path, _ = winreg.QueryValueEx(_hkey, "InstallPath")
_steam_path = Path(_install_path)
d_print("steam path updated")
except:
traceback.print_exc()
_steam_config = _steam_path.joinpath("config", "config.vdf")
with open(_steam_config, encoding="utf8") as fp:
for _line in fp:
Expand Down

0 comments on commit 8dc3575

Please sign in to comment.