Sync from development - prepare for v0.5.0.3

This commit is contained in:
Omni
2026-03-23 13:46:27 +00:00
parent e52e1427f6
commit 8e4dd06f11
241 changed files with 713 additions and 441 deletions

View File

@@ -374,6 +374,25 @@ def cc_content_missing(filename: str = "") -> InstallError:
)
def creation_kit_missing() -> InstallError:
return InstallError(
title="Creation Kit Files Missing",
message=(
"This modlist requires the Skyrim Special Edition Creation Kit, "
"but its files were not found in your game installation."
),
suggestion="Install the Creation Kit from Steam and open it once to register its files.",
solutions=[
"In Steam, search for 'Skyrim Special Edition: Creation Kit' and install it.",
"Right-click it in Steam > Properties > Compatibility and set a Proton version.",
"Click Play to launch the Creation Kit.",
"When asked whether to unzip Scripts.zip, select NO — unzipping will cause the CK to crash.",
"Once the Creation Kit opens successfully, close it.",
"Re-run the modlist install in Jackify — the required files will now be in place.",
],
)
def mo2_setup_failed(detail: str) -> InstallError:
return InstallError(
title="Mod Organizer 2 Setup Failed",

View File

@@ -5,9 +5,12 @@ This module provides standardized path resolution for Jackify directories,
supporting configurable data directory while keeping config in a fixed location.
"""
import logging
import os
import shutil
from pathlib import Path
from typing import Optional
logger = logging.getLogger(__name__)
def get_jackify_data_dir() -> Path:
@@ -62,4 +65,46 @@ def get_jackify_config_dir() -> Path:
Returns:
Path: Always ~/.config/jackify
"""
return Path.home() / ".config" / "jackify"
return Path.home() / ".config" / "jackify"
def cleanup_stale_tmp() -> None:
"""Remove stale engine temp directories from the Jackify tmp dir.
The engine writes TTW working files (xd3 patches, patch manifests) into
UUID-named subdirectories under <data_dir>/.tmp/ during TTW installation.
These are never cleaned up on failure or interruption and can accumulate
several GB per run. Any such directory present at startup is always stale —
no TTW install can be in flight before the application has started.
Only removes directories matching known engine temp prefixes. The
jackify-proton-extraction prefix is intentionally reused by the engine
across runs and is left in place.
"""
tmp_dir = get_jackify_data_dir() / ".tmp"
if not tmp_dir.is_dir():
return
stale_prefixes = ("ttw_mpi_", "ttw_ogg_")
removed = 0
freed = 0
for entry in tmp_dir.iterdir():
if not any(entry.name.startswith(p) for p in stale_prefixes):
continue
try:
if entry.is_dir():
size = sum(f.stat().st_size for f in entry.rglob("*") if f.is_file())
shutil.rmtree(entry)
else:
size = entry.stat().st_size
entry.unlink()
freed += size
removed += 1
logger.debug(f"Removed stale engine tmp: {entry.name}")
except Exception as e:
logger.warning(f"Could not remove stale engine tmp {entry.name}: {e}")
if removed:
freed_mb = freed / (1024 * 1024)
logger.info(f"Cleaned {removed} stale engine tmp entries ({freed_mb:.0f} MB freed)")