aboutsummaryrefslogtreecommitdiff
path: root/libs/nak_ffi
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 19:04:11 -0600
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 19:04:11 -0600
commit8a10147bbb1fe6589c4205bcfd26d6d696512ced (patch)
tree66fe7403114e2d63fa48ceee14352bee4dbddae0 /libs/nak_ffi
parenta03455028d8b79a1196bffc2f80c2455c41db065 (diff)
Add Root Builder plugin, Linux game detection, and OMOD installer fix
- New native Root Builder plugin (src/plugins/rootbuilder.py) with copy and symlink deploy modes, auto-deploy hooks, backup/restore, and third-party conflict detection that moves incompatible plugins to DisabledPlugins/. In link mode, .exe/.dll are always copied to avoid Wine/Proton path resolution issues with symlinked executables. - Fix basic_games detection on Linux: steam_utils now checks native Steam paths (~/.local/share/Steam, Flatpak, Snap), epic_utils uses correct Linux Heroic config paths, gog_utils falls back to Heroic GOG installed.json when Windows registry is unavailable. - Fix OMOD installer crash: isArchiveSupported now handles both IFileTree (from mod list refresh) and string (from install check) arguments. - Add flatpak manifest step to copy source-tree Python plugins (src/plugins/*.py) into the build output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/nak_ffi')
-rw-r--r--libs/nak_ffi/Cargo.lock2
-rw-r--r--libs/nak_ffi/Cargo.toml4
-rw-r--r--libs/nak_ffi/include/nak_ffi.h12
-rw-r--r--libs/nak_ffi/src/lib.rs52
4 files changed, 67 insertions, 3 deletions
diff --git a/libs/nak_ffi/Cargo.lock b/libs/nak_ffi/Cargo.lock
index af0ac00..83d19cc 100644
--- a/libs/nak_ffi/Cargo.lock
+++ b/libs/nak_ffi/Cargo.lock
@@ -1129,7 +1129,7 @@ dependencies = [
[[package]]
name = "nak_rust"
version = "4.4.1"
-source = "git+https://github.com/SulfurNitride/NaK.git?branch=main#ceea41b64e6cafb8375978d7982e2c46fe826047"
+source = "git+https://github.com/SulfurNitride/NaK.git?branch=main#41915b5a095da6bc5b4960eac2c9e55771caa7c4"
dependencies = [
"chrono",
"rand",
diff --git a/libs/nak_ffi/Cargo.toml b/libs/nak_ffi/Cargo.toml
index 000297c..fc667e0 100644
--- a/libs/nak_ffi/Cargo.toml
+++ b/libs/nak_ffi/Cargo.toml
@@ -6,5 +6,5 @@ edition = "2021"
[lib]
crate-type = ["cdylib"]
-[dependencies]
-nak_rust = { git = "https://github.com/SulfurNitride/NaK.git", branch = "main", default-features = false, features = ["installer"] }
+[dependencies]
+nak_rust = { git = "https://github.com/SulfurNitride/NaK.git", branch = "main", default-features = false, features = ["installer"] }
diff --git a/libs/nak_ffi/include/nak_ffi.h b/libs/nak_ffi/include/nak_ffi.h
index c6010d4..df4d47b 100644
--- a/libs/nak_ffi/include/nak_ffi.h
+++ b/libs/nak_ffi/include/nak_ffi.h
@@ -194,6 +194,18 @@ char *nak_apply_wine_registry_settings(
uint32_t app_id
);
+/** Apply a game's registry entry with a custom install path.
+ * Looks up game_name in KNOWN_GAMES and writes registry pointing to install_path.
+ * Returns NULL on success, or an error message (free with nak_string_free). */
+char *nak_apply_registry_for_game_path(
+ const char *prefix_path,
+ const char *proton_name,
+ const char *proton_path,
+ const char *game_name,
+ const char *install_path,
+ NakLogCallback log_cb
+);
+
/* ========================================================================
* Tier 7: Prefix Symlinks
* ======================================================================== */
diff --git a/libs/nak_ffi/src/lib.rs b/libs/nak_ffi/src/lib.rs
index 0e7b4f3..2e19af7 100644
--- a/libs/nak_ffi/src/lib.rs
+++ b/libs/nak_ffi/src/lib.rs
@@ -659,6 +659,58 @@ pub unsafe extern "C" fn nak_apply_wine_registry_settings(
}
}
+/// Apply a game's registry entry with a custom install path.
+///
+/// Looks up the game by name in KNOWN_GAMES, writes the registry entry
+/// pointing to `install_path`. Returns null on success, or an error message.
+#[no_mangle]
+pub unsafe extern "C" fn nak_apply_registry_for_game_path(
+ prefix_path: *const c_char,
+ proton_name: *const c_char,
+ proton_path: *const c_char,
+ game_name: *const c_char,
+ install_path: *const c_char,
+ log_cb: NakLogCallback,
+) -> *mut c_char {
+ let prefix = unsafe { from_cstr(prefix_path) };
+ let _proton_name = unsafe { from_cstr(proton_name) };
+ let proton_path_str = unsafe { from_cstr(proton_path) };
+ let game = unsafe { from_cstr(game_name) };
+ let install = unsafe { from_cstr(install_path) };
+
+ let protons = nak_rust::steam::find_steam_protons();
+ let proton = match protons
+ .iter()
+ .find(|p| p.path.to_string_lossy() == proton_path_str)
+ {
+ Some(p) => p.clone(),
+ None => {
+ return to_cstring(&format!(
+ "Proton not found at path: {}",
+ proton_path_str
+ ));
+ }
+ };
+
+ let log_fn = move |msg: String| {
+ if let Some(cb) = log_cb {
+ let c = CString::new(msg).unwrap_or_default();
+ unsafe { cb(c.as_ptr()) };
+ }
+ };
+
+ match nak_rust::installers::apply_registry_for_game_path(
+ Path::new(prefix),
+ &proton,
+ game,
+ Path::new(install),
+ &log_fn,
+ ) {
+ Ok(()) => ptr::null_mut(),
+ Err(e) => to_cstring(&e),
+ }
+}
+
// ============================================================================
// Tier 7: Prefix Symlinks
// ============================================================================