aboutsummaryrefslogtreecommitdiff
path: root/libs/nak/src/deps/tools.rs
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-03 10:50:22 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-04-03 10:50:22 -0500
commitd226c68de9a858a372c5e9a6e83d72dac676559f (patch)
tree947daff1835b5ef8946ecfc34cd598dd76c04ef2 /libs/nak/src/deps/tools.rs
parent1ce8f010b6e99bd425f6fa74b87936ee3f8f3339 (diff)
Fix cabextract not found in pressure-vessel and TTW game detection
cabextract: The system binary under /usr is invisible inside the pressure-vessel container where winetricks runs. Always download a local copy to ~/.local/share/fluorine/bin/ instead of short-circuiting when the host has it installed. TTW: The game plugin was calling the base class identifyGamePath() which tried matching "TTW" against NaK's detected game names — never matching "Fallout New Vegas". Now explicitly searches for FNV in the NaK results, mirroring how the Windows path uses the FalloutNV registry key. Also adds HAS_NAK_FFI and nak_ffi linkage to the TTW CMake target since it was previously only defined for the game_gamebryo target. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'libs/nak/src/deps/tools.rs')
-rw-r--r--libs/nak/src/deps/tools.rs21
1 files changed, 7 insertions, 14 deletions
diff --git a/libs/nak/src/deps/tools.rs b/libs/nak/src/deps/tools.rs
index 0e3e356..03dbe9a 100644
--- a/libs/nak/src/deps/tools.rs
+++ b/libs/nak/src/deps/tools.rs
@@ -105,19 +105,12 @@ pub fn ensure_winetricks() -> Result<PathBuf, Box<dyn Error>> {
const CABEXTRACT_URL: &str =
"https://github.com/SulfurNitride/NaK/releases/download/Cabextract/cabextract-linux-x86_64.zip";
-/// Ensures cabextract is available (either system or downloaded).
+/// Ensures cabextract is available in our bin directory.
+///
+/// Always downloads to ~/.local/share/fluorine/bin/ because winetricks runs
+/// inside pressure-vessel where system binaries under /usr are not visible.
pub fn ensure_cabextract() -> Result<PathBuf, Box<dyn Error>> {
- // First check if system has cabextract
- if Command::new("which")
- .arg("cabextract")
- .output()
- .map(|o| o.status.success())
- .unwrap_or(false)
- {
- return Ok(PathBuf::from("cabextract"));
- }
-
- // Check if we already downloaded it
+ // Check if we already downloaded it to our bin dir
let bin_dir = get_nak_bin_path();
let cabextract_path = bin_dir.join("cabextract");
@@ -125,8 +118,8 @@ pub fn ensure_cabextract() -> Result<PathBuf, Box<dyn Error>> {
return Ok(cabextract_path);
}
- // Download cabextract zip
- log_warning("System cabextract not found, downloading...");
+ // Download cabextract zip — system copy is unusable inside pressure-vessel
+ log_info("Downloading cabextract for use inside container...");
fs::create_dir_all(&bin_dir)?;
let response = ureq::get(CABEXTRACT_URL).call().map_err(|e| {