Skip to content

Commit

Permalink
only include dll in gnu builds
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars committed Jan 17, 2025
1 parent aa86e61 commit d724618
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions crates/tauri-bundler/src/bundle/windows/nsis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,19 +595,22 @@ fn association_description(
type ResourcesMap = BTreeMap<PathBuf, (PathBuf, PathBuf)>;
fn generate_resource_data(settings: &Settings) -> crate::Result<ResourcesMap> {
let mut resources = ResourcesMap::new();

let cwd = std::env::current_dir()?;

let mut added_resources = Vec::new();

// Adding WebViewer2Loader.dll in case windows-gnu toolchain is used
let loader_path =
dunce::simplified(&settings.project_out_directory().join("WebView2Loader.dll")).to_path_buf();
if loader_path.exists() {
added_resources.push(loader_path.clone());
resources.insert(
loader_path,
(PathBuf::new(), PathBuf::from("WebView2Loader.dll")),
);
if settings.target().ends_with("-gnu") {
let loader_path =
dunce::simplified(&settings.project_out_directory().join("WebView2Loader.dll")).to_path_buf();
if loader_path.exists() {
added_resources.push(loader_path.clone());
resources.insert(
loader_path,
(PathBuf::new(), PathBuf::from("WebView2Loader.dll")),
);
}
}

for resource in settings.resource_files().iter() {
Expand Down

0 comments on commit d724618

Please sign in to comment.