mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-01-24 12:22:49 -05:00
fix conflict detection
This commit is contained in:
@@ -256,7 +256,8 @@ fn check_creamlinux_installed(game_path: &Path) -> bool {
|
||||
|
||||
// Check if a game has SmokeAPI installed
|
||||
fn check_smokeapi_installed(game_path: &Path, api_files: &[String]) -> bool {
|
||||
// First check the provided api_files for backup files
|
||||
// For Proton games: check for backup DLL files
|
||||
if !api_files.is_empty() {
|
||||
for api_file in api_files {
|
||||
let api_path = game_path.join(api_file);
|
||||
let api_dir = api_path.parent().unwrap_or(game_path);
|
||||
@@ -271,6 +272,27 @@ fn check_smokeapi_installed(game_path: &Path, api_files: &[String]) -> bool {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// For Native games: check for lib_steam_api_o.so backup
|
||||
for entry in WalkDir::new(game_path)
|
||||
.max_depth(3)
|
||||
.into_iter()
|
||||
.filter_map(Result::ok)
|
||||
{
|
||||
let path = entry.path();
|
||||
if !path.is_file() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let filename = path.file_name().unwrap_or_default().to_string_lossy();
|
||||
|
||||
// Check for native SmokeAPI backup
|
||||
if filename == "libsteam_api_o.so" {
|
||||
debug!("Found native SmokeAPI backup: {}", path.display());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Also scan for orphaned backup files (in case the main DLL was removed)
|
||||
// This handles the Proton->Native switch case where steam_api*.dll is gone
|
||||
|
||||
@@ -294,7 +294,7 @@ impl SmokeAPI {
|
||||
.map_err(|e| format!("Failed to replace libsteam_api.so: {}", e))?;
|
||||
|
||||
info!(
|
||||
"Replaced libsteam_api.so with {} (hook mode)",
|
||||
"Replaced libsteam_api.so with {}",
|
||||
target_so
|
||||
);
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ export function useConflictDetection(games: Game[]) {
|
||||
})
|
||||
}
|
||||
|
||||
// Conflict 2: SmokeAPI installed but game is now Native
|
||||
if (game.native && game.smoke_installed) {
|
||||
// Conflict 2: Orphaned Proton SmokeAPI DLL files on a native game
|
||||
if (game.native && game.smoke_installed && game.api_files && game.api_files.length > 0) {
|
||||
detectedConflicts.push({
|
||||
gameId: game.id,
|
||||
gameTitle: game.title,
|
||||
|
||||
Reference in New Issue
Block a user