Implementing and using DLL files #11382
-
Hey! When I try to run my tauri application I get the error that an specific DLL was not found. (In my case the libcrypto-3-x64.dll) My first approach was to implement the DLL Files in my bundle and then load them with the libloading library "bundle": {
"resources": [
"./assets/dll/*"
]
} use libloading::Library;
use tauri::{App, Manager};
use std::path::Path;
pub fn init_dll_files(app: &mut App){
let resources_dir = app.path().resource_dir().unwrap().as_os_str().to_str().unwrap().to_string();
let dll_libcrypto_path_string = format!("{}\\{}", resources_dir, "assets\\dll\\libcrypto-3-x64.dll");
let dll_libcrypto_path = Path::new(&dll_libcrypto_path_string);
println!("Resource Path: {}", dll_libcrypto_path_string);
println!("Resource EXISTS: {}", dll_libcrypto_path.exists());
if dll_libcrypto_path.exists() {
let lib_libcrypto = Library::new(dll_libcrypto_path).expect("Couldn't load libcrypto-3-x64.dll");
}
} Is this a possible solution or is there a better way to go? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
QuirkyQueryQuester
Oct 16, 2024
Replies: 1 comment
-
I found a workaround: I copied my libcrypto-3-x64.dll in my src-tauri folder. In my tauri.config.json I added the resource: "bundle": {
"resources": [
"./libcrypto-3-x64.dll"
]
} After the installation the DLL is automatically in the root directory and the application start works. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
QuirkyQueryQuester
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found a workaround:
I copied my libcrypto-3-x64.dll in my src-tauri folder.
In my tauri.config.json I added the resource:
After the installation the DLL is automatically in the root directory and the application start works.