3 Commits

Author SHA1 Message Date
Novattz
a460e9d3b7 use dynamic DLL matching for SmokeAPI installation 2025-09-27 20:58:23 +02:00
Novattz
6559b15894 version bump 2025-09-12 06:41:15 +02:00
Novattz
653c301ba9 correct SmokeAPI DLL name mapping during installation 2025-09-12 06:39:38 +02:00
4 changed files with 44 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "creamlinux",
"private": true,
"version": "1.0.2",
"version": "1.0.5",
"type": "module",
"author": "Tickbase",
"repository": "https://github.com/Novattz/creamlinux-installer",

View File

@@ -1,6 +1,6 @@
[package]
name = "app"
version = "1.0.1"
version = "1.0.5"
description = "DLC Manager for Steam games on Linux"
authors = ["tickbase"]
license = "MIT"

View File

@@ -1001,15 +1001,48 @@ where
info!("Created backup: {}", backup_path.display());
}
// Extract the appropriate DLL directly to the game directory
if let Ok(mut file) = archive.by_name(&api_name.to_string_lossy()) {
let mut outfile = fs::File::create(&original_path)?;
io::copy(&mut file, &mut outfile)?;
info!("Installed SmokeAPI as: {}", original_path.display());
} else {
// Determine if we need 32-bit or 64-bit SmokeAPI DLL based on the original Steam API DLL
let is_64bit = api_name.to_string_lossy().contains("64");
let target_arch = if is_64bit { "64" } else { "32" };
// Search through all files in the archive to find the matching SmokeAPI DLL
let mut found_dll = false;
let mut tried_files = Vec::new();
let mut matching_dll_name: Option<String> = None;
// First pass: find the matching DLL name
for i in 0..archive.len() {
if let Ok(file) = archive.by_index(i) {
let file_name = file.name();
tried_files.push(file_name.to_string());
// Check if this is SmokeAPI DLL file with the correct architecture
if file_name.to_lowercase().ends_with(".dll")
&& file_name.to_lowercase().contains("smoke")
&& file_name.contains(target_arch) {
matching_dll_name = Some(file_name.to_string());
break;
}
}
}
// Second pass: extract the matching DLL if found
if let Some(dll_name) = matching_dll_name {
if let Ok(mut smoke_file) = archive.by_name(&dll_name) {
let mut outfile = fs::File::create(&original_path)?;
io::copy(&mut smoke_file, &mut outfile)?;
info!("Installed {} as: {}", dll_name, original_path.display());
found_dll = true;
}
}
if !found_dll {
return Err(InstallerError::InstallationError(format!(
"Could not find {} in the SmokeAPI zip file",
api_name.to_string_lossy()
"Could not find {}-bit SmokeAPI DLL for {} in the zip file. Archive contains: {}",
target_arch,
api_name.to_string_lossy(),
tried_files.join(", ")
)));
}
}

View File

@@ -14,7 +14,7 @@
},
"productName": "Creamlinux",
"mainBinaryName": "creamlinux",
"version": "1.0.2",
"version": "1.0.5",
"identifier": "com.creamlinux.dev",
"app": {
"withGlobalTauri": false,