mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-01-24 20:32:51 -05:00
fix conflict detection
This commit is contained in:
@@ -256,18 +256,40 @@ fn check_creamlinux_installed(game_path: &Path) -> bool {
|
|||||||
|
|
||||||
// Check if a game has SmokeAPI installed
|
// Check if a game has SmokeAPI installed
|
||||||
fn check_smokeapi_installed(game_path: &Path, api_files: &[String]) -> bool {
|
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
|
||||||
for api_file in api_files {
|
if !api_files.is_empty() {
|
||||||
let api_path = game_path.join(api_file);
|
for api_file in api_files {
|
||||||
let api_dir = api_path.parent().unwrap_or(game_path);
|
let api_path = game_path.join(api_file);
|
||||||
let api_filename = api_path.file_name().unwrap_or_default();
|
let api_dir = api_path.parent().unwrap_or(game_path);
|
||||||
|
let api_filename = api_path.file_name().unwrap_or_default();
|
||||||
|
|
||||||
// Check for backup file (original file renamed with _o.dll suffix)
|
// Check for backup file (original file renamed with _o.dll suffix)
|
||||||
let backup_name = api_filename.to_string_lossy().replace(".dll", "_o.dll");
|
let backup_name = api_filename.to_string_lossy().replace(".dll", "_o.dll");
|
||||||
let backup_path = api_dir.join(backup_name);
|
let backup_path = api_dir.join(backup_name);
|
||||||
|
|
||||||
if backup_path.exists() {
|
if backup_path.exists() {
|
||||||
debug!("SmokeAPI backup file found: {}", backup_path.display());
|
debug!("SmokeAPI backup file found: {}", backup_path.display());
|
||||||
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ impl SmokeAPI {
|
|||||||
.map_err(|e| format!("Failed to replace libsteam_api.so: {}", e))?;
|
.map_err(|e| format!("Failed to replace libsteam_api.so: {}", e))?;
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
"Replaced libsteam_api.so with {} (hook mode)",
|
"Replaced libsteam_api.so with {}",
|
||||||
target_so
|
target_so
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ export function useConflictDetection(games: Game[]) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Conflict 2: SmokeAPI installed but game is now Native
|
// Conflict 2: Orphaned Proton SmokeAPI DLL files on a native game
|
||||||
if (game.native && game.smoke_installed) {
|
if (game.native && game.smoke_installed && game.api_files && game.api_files.length > 0) {
|
||||||
detectedConflicts.push({
|
detectedConflicts.push({
|
||||||
gameId: game.id,
|
gameId: game.id,
|
||||||
gameTitle: game.title,
|
gameTitle: game.title,
|
||||||
|
|||||||
Reference in New Issue
Block a user