Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper sourcemod search on Linux #6

Merged
merged 4 commits into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# TF2CDownloader
Self-developed improvements for TF2 Classic downloader
Simple script for downloading and extracting TF2Classic quickly, simply, and efficiently.


Won't function right on Windows unless it's compiled by PyInstaller, as it's hardcoded to use a variable only supplied to it *by* PyInstaller in order to find the Binaries folder.
https://github.com/tf2classic/TF2CDownloader

In the Binaries folder of the repository, Aria2 and its relevant dependencies are from MSYS2: https://packages.msys2.org/package/mingw-w64-x86_64-aria2

Expand Down
20 changes: 9 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ def sourcemods_path():
return None
else:
try:
linux_dirs = {
'~/.steam/steam/steamapps/sourcemods/',
# these locations are mentioned in old posts on forums, so it's better to check them too
'~/.local/share/Steam/SteamApps/sourcemods',
'~/Steam/SteamApps/sourcemods'
}
for dir in linux_dirs:
if os_path.isdir(dir):
return dir
return None
sourcepath = None
with open(os_path.expanduser('~/.steam/registry.vdf'), 'r') as file:
for _, line in enumerate(file):
if 'SourceModInstallPath' in line:
sourcepath = line[line.index('/home'):-1].replace(r'\\', '/')
break
file.close()
return sourcepath
except Exception:
return None

Expand Down Expand Up @@ -117,4 +115,4 @@ def setup_binaries():
elif which('7zz') is not None:
vars.SEVENZ_BINARY = '7zz'
else:
vars.SEVENZ_BINARY = '7z'
vars.SEVENZ_BINARY = '7z'