added support for alternate linux pathways
parent
db2d8c5e37
commit
15330c6901
|
@ -114,10 +114,9 @@ def getTargetDir(systemName):
|
|||
+ ' like TF2 do not run. tfscript will run, but you can\'t run TF2'
|
||||
+ ' on this system',
|
||||
category=RuntimeWarning )
|
||||
return None
|
||||
return expanduser('~/Library/Application Support/Steam')
|
||||
|
||||
elif systemName == 'Windows':
|
||||
if systemName == 'Windows':
|
||||
# oh god why do we have to use the registry
|
||||
accessReg = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
|
||||
accessKey = OpenKey(accessReg, 'SOFTWARE\\WOW6432Node\\Valve\\Steam')
|
||||
|
@ -125,17 +124,23 @@ def getTargetDir(systemName):
|
|||
while True:
|
||||
try:
|
||||
accessSubkeyName, data, _ = EnumValue(accessKey, keyNum)
|
||||
if accessSubkeyName == 'InstallPath':
|
||||
return data
|
||||
except EnvironmentError:
|
||||
break
|
||||
keyNum += 1
|
||||
else:
|
||||
if accessSubkeyName == 'InstallPath':
|
||||
return data
|
||||
keyNum += 1
|
||||
return None
|
||||
|
||||
elif systemName == 'Linux':
|
||||
return expanduser('~/.local/share/Steam')
|
||||
if systemName == 'Linux':
|
||||
homedir = expanduser('~')
|
||||
for potentialdir in ['.steam/steam', '.local/share/Steam']:
|
||||
fullTargetPath = normpath(f'{homedir}/{potentialdir}')
|
||||
if isdir(fullTargetPath):
|
||||
return fullTargetPath
|
||||
return None
|
||||
|
||||
elif systemName == 'Java':
|
||||
if systemName == 'Java':
|
||||
warn('Java-based OSes are not supported yet by tfscript.', category=RuntimeWarning)
|
||||
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue