Skip to content

Commit cf771bf

Browse files
authored
fix(bundler/wix): Prevent dlls from overwriting root resources (#12402)
1 parent 07ccdc4 commit cf771bf

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.changes/fix-bundler-wix-dlls.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
tauri-bundler: 'patch:bug'
3+
---
4+
5+
Fixed an issue that caused the .msi installer to not contain root resources when there were .dll files present in the target directory.

crates/tauri-bundler/src/bundle/windows/msi/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
10401040

10411041
let mut dlls = Vec::new();
10421042

1043+
// 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.
10431044
let out_dir = settings.project_out_directory();
10441045
for dll in glob::glob(
10451046
&PathBuf::from(glob::Pattern::escape(&out_dir.to_string_lossy()))
@@ -1063,15 +1064,15 @@ fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
10631064
}
10641065

10651066
if !dlls.is_empty() {
1066-
resources.insert(
1067-
"".to_string(),
1068-
ResourceDirectory {
1067+
resources
1068+
.entry("".to_string())
1069+
.and_modify(|r| r.files.append(&mut dlls))
1070+
.or_insert(ResourceDirectory {
10691071
path: "".to_string(),
10701072
name: "".to_string(),
10711073
directories: vec![],
10721074
files: dlls,
1073-
},
1074-
);
1075+
});
10751076
}
10761077

10771078
Ok(resources)

0 commit comments

Comments
 (0)