Windows support
This commit is contained in:
parent
9e59d2a35e
commit
955b5c1c4d
12
main.py
12
main.py
|
@ -1,9 +1,19 @@
|
|||
import os
|
||||
import requests
|
||||
import zipfile
|
||||
import platform
|
||||
from pathlib import Path
|
||||
|
||||
hl_path = Path.home() / ".steam/steam/steamapps/common/Half-Life"
|
||||
def get_hl_path():
|
||||
"""Get the Half-Life installation path based on the operating system."""
|
||||
if platform.system() == "Windows":
|
||||
return Path(os.getenv('ProgramFiles(x86)')) / "Steam/steamapps/common/Half-Life"
|
||||
elif platform.system() == "Linux":
|
||||
return Path.home() / ".steam/steam/steamapps/common/Half-Life"
|
||||
else:
|
||||
raise OSError("Unsupported operating system")
|
||||
|
||||
hl_path = get_hl_path()
|
||||
spacelife_path = hl_path / "SpaceLife"
|
||||
version_file = hl_path / "SpaceLifeVersion.txt"
|
||||
mod_url = "https://deadzone.tf/SpaceLife.zip"
|
||||
|
|
Loading…
Reference in New Issue