Skip to content

Commit

Permalink
fix(bundler/wix): Prevent dlls from overwriting root resources (#12402)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars authored Jan 17, 2025
1 parent 07ccdc4 commit cf771bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-bundler-wix-dlls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
tauri-bundler: 'patch:bug'
---

Fixed an issue that caused the .msi installer to not contain root resources when there were .dll files present in the target directory.
11 changes: 6 additions & 5 deletions crates/tauri-bundler/src/bundle/windows/msi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {

let mut dlls = Vec::new();

// TODO: The bundler should not include all DLLs it finds. Instead it should only include WebView2Loader.dll if present and leave the rest to the resources config.
let out_dir = settings.project_out_directory();
for dll in glob::glob(
&PathBuf::from(glob::Pattern::escape(&out_dir.to_string_lossy()))
Expand All @@ -1063,15 +1064,15 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
}

if !dlls.is_empty() {
resources.insert(
"".to_string(),
ResourceDirectory {
resources
.entry("".to_string())
.and_modify(|r| r.files.append(&mut dlls))
.or_insert(ResourceDirectory {
path: "".to_string(),
name: "".to_string(),
directories: vec![],
files: dlls,
},
);
});
}

Ok(resources)
Expand Down

0 comments on commit cf771bf

Please sign in to comment.