feat: use Windows Registry for standard install path + cross-platform builds

This commit is contained in:
LemonNexus 2026-02-12 15:05:04 +00:00
parent aec841f9f3
commit 0eb77cdb32
1 changed files with 21 additions and 9 deletions

View File

@ -13,10 +13,9 @@ GitHub: https://github.com/ImpulsiveFPS/EU-Icon-Extractor
import sys import sys
import os import os
import subprocess import subprocess
import webbrowser
import re import re
from pathlib import Path from pathlib import Path
from typing import Optional, List from typing import Optional, List, Tuple
# Platform-specific imports # Platform-specific imports
if sys.platform == 'win32': if sys.platform == 'win32':
@ -102,21 +101,34 @@ def parse_library_folders_vdf(vdf_path: Path) -> List[Path]:
return libraries return libraries
def find_all_cache_paths() -> List[Path]: def find_all_cache_paths() -> List[Tuple[str, Path]]:
""" """
Find all Entropia Universe cache folders. Find all Entropia Universe cache folders.
Returns a list of paths (standard install, Steam, etc.) Returns a list of (name, path) tuples.
""" """
found_paths = [] found_paths = []
# Check standard installation first (platform-specific) # Check Windows Registry for MindArk installation (Standard Install)
if sys.platform == 'win32': if sys.platform == 'win32':
standard_path = Path("C:/ProgramData/Entropia Universe/public_users_data/cache/icon") try:
else: with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\WOW6432Node\MindArk\Entropia Universe") as key:
standard_path = Path.home() / ".local" / "share" / "Entropia Universe" / "public_users_data" / "cache" / "icon" parent_folder, _ = winreg.QueryValueEx(key, "PublicUsersDataParentFolder")
standard_path = Path(parent_folder) / "public_users_data" / "cache" / "icon"
if standard_path.exists() and list(standard_path.rglob("*.tga")):
found_paths.append(("Standard Install", standard_path))
except Exception:
pass
if standard_path.exists() and list(standard_path.rglob("*.tga")): # Fallback to hardcoded path if registry fails
found_paths.append(("Standard Install", standard_path)) if not found_paths:
fallback_path = Path("C:/ProgramData/Entropia Universe/public_users_data/cache/icon")
if fallback_path.exists() and list(fallback_path.rglob("*.tga")):
found_paths.append(("Standard Install", fallback_path))
else:
# Linux standard paths (if non-Steam install exists)
standard_path = Path.home() / ".local" / "share" / "Entropia Universe" / "public_users_data" / "cache" / "icon"
if standard_path.exists() and list(standard_path.rglob("*.tga")):
found_paths.append(("Standard Install", standard_path))
# Check Steam installations # Check Steam installations
steam_paths = get_steam_paths() steam_paths = get_steam_paths()