From 3e702cf8b15762cdca43c8d7ff6f6e8ee9670244 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sun, 15 May 2022 06:01:10 -0700 Subject: [PATCH] fix(bundler): ignore duplicated files in resource iter, closes #4126 (#4129) --- .changes/fix-glob-resource-wix.md | 5 +++++ tooling/bundler/src/bundle/windows/msi/wix.rs | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .changes/fix-glob-resource-wix.md diff --git a/.changes/fix-glob-resource-wix.md b/.changes/fix-glob-resource-wix.md new file mode 100644 index 000000000..9e534fcc7 --- /dev/null +++ b/.changes/fix-glob-resource-wix.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": patch +--- + +Fixes processing of resources with glob patterns when there are nested directories on Windows. diff --git a/tooling/bundler/src/bundle/windows/msi/wix.rs b/tooling/bundler/src/bundle/windows/msi/wix.rs index 5ed46a073..4e17feff7 100644 --- a/tooling/bundler/src/bundle/windows/msi/wix.rs +++ b/tooling/bundler/src/bundle/windows/msi/wix.rs @@ -799,6 +799,13 @@ fn generate_resource_data(settings: &Settings) -> crate::Result { .into_string() .expect("failed to read resource path"); + // In some glob resource paths like `assets/**/*` a file might appear twice + // because the `tauri_utils::resources::ResourcePaths` iterator also reads a directory + // when it finds one. So we must check it before processing the file. + if added_resources.contains(&resource_path) { + continue; + } + added_resources.push(resource_path.clone()); let resource_entry = ResourceFile {