diff --git a/main.py b/main.py index 1776983..3b3b7e6 100644 --- a/main.py +++ b/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"