Removed comment, changed winreg.OpenKey() argument, ensured terminating / for file path

pull/11/head
Nicholas Hope 2022-08-08 18:04:36 -04:00
parent 8904632b06
commit 0e224d46ab
1 changed files with 2 additions and 2 deletions

View File

@ -140,9 +140,8 @@ def main():
if systemName == "Windows":
# Oh god why do we have to use the registry!
# "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Valve\Steam\InstallPath" "InstallPath"
accessReg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
accessKey = winreg.OpenKey(accessReg, "SOFTWARE\WOW6432Node\Valve\Steam\InstallPath")
accessKey = winreg.OpenKey(accessReg, "SOFTWARE\\WOW6432Node\\Valve\\Steam\\")
targetDir = winreg.QueryValue(accessKey, "InstallPath")
if systemName == "Linux":
@ -152,6 +151,7 @@ def main():
print("Java-based OSes are not supported yet by tfscript.", file=sys.stderr)
return 2
if targetDir[-1] != '/': targetDir += '/'
targetDir += "steamapps/common/Team Fortress 2/tf/cfg"
else:
targetDir = args.directory