From a8af5a0f1d17a770c7090b59dca6181c042755eb Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Thu, 12 Feb 2026 15:04:59 +0000 Subject: [PATCH] feat: use Windows Registry for standard install path + cross-platform builds - Now reads PublicUsersDataParentFolder from Registry: HKLM\SOFTWARE\WOW6432Node\MindArk\Entropia Universe - Constructs full path: {ParentFolder}\public_users_data\cache\icon - Fallback to hardcoded path if Registry read fails - Removed unused webbrowser import - Updated GitHub Actions to build for both Windows and Linux - Updated README with cross-platform documentation --- .github/workflows/build.yml | 46 +++++++++++++++++++- README.md | 84 ++++++++++++++++++++++++++++++------- icon_extractor.py | 30 +++++++++---- 3 files changed, 135 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4df1c9e..c591dfa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build Windows Executable +name: Build Executables on: push: @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - build: + build-windows: runs-on: windows-latest steps: @@ -44,3 +44,45 @@ jobs: prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build-linux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y libgl1-mesa-glx libglib2.0-0 libxkbcommon-x11-0 + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + pip install -r requirements.txt + + - name: Build executable + run: | + pyinstaller icon_extractor.spec --clean + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: EU-Icon-Extractor-Linux + path: dist/EU-Icon-Extractor + + - name: Create Release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v1 + with: + files: dist/EU-Icon-Extractor + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 2e3d9a2..ec999b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Entropia Universe Icon Extractor -A standalone tool for extracting item icons from Entropia Universe game cache. +A standalone cross-platform tool for extracting item icons from Entropia Universe game cache. EU Icon Extractor @@ -8,7 +8,10 @@ A standalone tool for extracting item icons from Entropia Universe game cache. **[Download Latest Release](https://github.com/ImpulsiveFPS/EU-Icon-Extractor/releases/latest)** -Download `EU-Icon-Extractor.exe` and run it - no installation needed! +- **Windows:** `EU-Icon-Extractor-Windows.exe` +- **Linux:** `EU-Icon-Extractor-Linux` + +No installation needed - just download and run! ## Description @@ -16,10 +19,34 @@ Extract item icons from Entropia Universe cache and convert them to PNG format. **Important:** Items must be seen/rendered in-game before they appear in the cache! If an icon is missing, view the item in your inventory or the auction first. +## Features + +### Cross-Platform Support +- **Windows** - Auto-detects from Registry and standard paths +- **Linux** - Auto-detects Steam installations + +### Multiple Cache Sources +- **Standard Install** - Detected from Windows Registry (`PublicUsersDataParentFolder`) +- **Steam** - Auto-detects from Steam library folders +- **Manual Browse** - Select custom cache folder +- **Extract from All** - Combine icons from multiple sources + +### Extraction Options +- **Version selector** - Choose which game version to extract from +- **"All Folders" option** - Extract from all versions at once +- **320x320 PNG output** - Icons centered on transparent canvas +- **Multiple upscale methods** - HQ4x, Lanczos, or Nearest Neighbor + +### User Interface +- **Source selection** - Choose between Standard, Steam, or All sources +- **Double-click preview** - Preview TGA files before extraction +- **Light/Dark theme** - Toggle between themes +- **Custom output folder** - Choose where to save extracted icons + ## Usage ### Option 1: Download Executable (Recommended) -1. Download `EU-Icon-Extractor.exe` from [Releases](https://github.com/ImpulsiveFPS/EU-Icon-Extractor/releases/latest) +1. Download the appropriate executable for your OS from [Releases](https://github.com/ImpulsiveFPS/EU-Icon-Extractor/releases/latest) 2. Double-click to run - no installation needed! ### Option 2: Run from Source @@ -32,23 +59,39 @@ python icon_extractor.py - PyQt6: `pip install PyQt6` - Pillow: `pip install Pillow` -## Features +## Cache Locations -- **Auto-detects** game cache from `C:\ProgramData\Entropia Universe\public_users_data\cache\icon` -- **Version selector** - Choose which game version to extract from -- **"All Folders" option** - Extract from all versions at once -- **Double-click preview** - Preview TGA files before extraction -- **320x320 PNG output** - Icons centered on transparent canvas -- **Light/Dark theme** - Toggle between themes -- **Custom output folder** - Choose where to save extracted icons +### Windows +The tool automatically detects the cache location from the Windows Registry: +``` +HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MindArk\Entropia Universe +PublicUsersDataParentFolder = C:\ProgramData\Entropia Universe +``` + +Full cache path: `{PublicUsersDataParentFolder}\public_users_data\cache\icon\{VERSION}` + +### Linux (Steam) +The tool checks these Steam installation paths: +- `~/.steam/steam/` +- `~/.local/share/Steam/` +- `~/.steam/root/` + +Full cache path: `{Steam}/steamapps/common/Entropia Universe/public_users_data/cache/icon/{VERSION}` ## Output Icons are saved to your Documents folder: + +**Windows:** ``` Documents\Entropia Universe\Icons\ ``` +**Linux:** +``` +~/Documents/Entropia Universe/Icons/ +``` + (Same location where `chat.log` is normally stored) ## Links @@ -56,6 +99,7 @@ Documents\Entropia Universe\Icons\ - **Developer:** ImpulsiveFPS - **Discord:** impulsivefps - **GitHub:** https://github.com/ImpulsiveFPS/EU-Icon-Extractor +- **Report Bug:** https://github.com/ImpulsiveFPS/EU-Icon-Extractor/issues - **Support Me:** https://ko-fi.com/impulsivefps ## Disclaimer @@ -64,8 +108,7 @@ Entropia Universe Icon Extractor is a fan-made resource and is not affiliated wi ## Building from Source -If you want to build the executable yourself: - +### Windows ```bash # Install dependencies pip install pyinstaller @@ -75,7 +118,20 @@ pip install -r requirements.txt pyinstaller icon_extractor.spec --clean ``` -The executable will be in `dist/EU-Icon-Extractor.exe` +### Linux +```bash +# Install system dependencies (Ubuntu/Debian) +sudo apt-get install libgl1-mesa-glx libglib2.0-0 libxkbcommon-x11-0 + +# Install Python dependencies +pip install pyinstaller +pip install -r requirements.txt + +# Build executable +pyinstaller icon_extractor.spec --clean +``` + +The executable will be in `dist/` ## License diff --git a/icon_extractor.py b/icon_extractor.py index 41d757f..3d8c769 100644 --- a/icon_extractor.py +++ b/icon_extractor.py @@ -13,10 +13,9 @@ GitHub: https://github.com/ImpulsiveFPS/EU-Icon-Extractor import sys import os import subprocess -import webbrowser import re from pathlib import Path -from typing import Optional, List +from typing import Optional, List, Tuple # Platform-specific imports if sys.platform == 'win32': @@ -102,21 +101,34 @@ def parse_library_folders_vdf(vdf_path: Path) -> List[Path]: return libraries -def find_all_cache_paths() -> List[Path]: +def find_all_cache_paths() -> List[Tuple[str, Path]]: """ Find all Entropia Universe cache folders. - Returns a list of paths (standard install, Steam, etc.) + Returns a list of (name, path) tuples. """ found_paths = [] - # Check standard installation first (platform-specific) + # Check Windows Registry for MindArk installation (Standard Install) if sys.platform == 'win32': - standard_path = Path("C:/ProgramData/Entropia Universe/public_users_data/cache/icon") + try: + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\WOW6432Node\MindArk\Entropia Universe") as key: + 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 + + # Fallback to hardcoded path if registry fails + 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)) + if standard_path.exists() and list(standard_path.rglob("*.tga")): + found_paths.append(("Standard Install", standard_path)) # Check Steam installations steam_paths = get_steam_paths()