Skip to content

Commit a16e9d4

Browse files
committed
feat(bundler): consider extensions defined in main.wxs.
1 parent 1573c72 commit a16e9d4

File tree

1 file changed

+10
-8
lines changed
  • crates/tauri-bundler/src/bundle/windows/msi

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -755,24 +755,26 @@ pub fn build_wix_app_installer(
755755
let main_wxs_path = output_path.join("main.wxs");
756756
fs::write(main_wxs_path, handlebars.render("main.wxs", &data)?)?;
757757

758-
let mut candle_inputs = vec![("main.wxs".into(), Vec::new())];
758+
let mut candle_inputs = vec![];
759759

760760
let current_dir = std::env::current_dir()?;
761761
let extension_regex = Regex::new("\"http://schemas.microsoft.com/wix/(\\w+)\"")?;
762-
for fragment_path in fragment_paths {
763-
let fragment_path = current_dir.join(fragment_path);
764-
let fragment_content = fs::read_to_string(&fragment_path)?;
765-
let fragment_handlebars = Handlebars::new();
766-
let fragment = fragment_handlebars.render_template(&fragment_content, &data)?;
762+
let input_paths = std::iter::once(output_path.join(PathBuf::from("main.wxs")))
763+
.chain(fragment_paths.iter().map(|p| current_dir.join(p)));
764+
765+
for input_path in input_paths {
766+
let input_content = fs::read_to_string(&input_path)?;
767+
let input_handlebars = Handlebars::new();
768+
let input = input_handlebars.render_template(&input_content, &data)?;
767769
let mut extensions = Vec::new();
768-
for cap in extension_regex.captures_iter(&fragment) {
770+
for cap in extension_regex.captures_iter(&input) {
769771
let path = wix_toolset_path.join(format!("Wix{}.dll", &cap[1]));
770772
if settings.windows().can_sign() {
771773
try_sign(&path, settings)?;
772774
}
773775
extensions.push(path);
774776
}
775-
candle_inputs.push((fragment_path, extensions));
777+
candle_inputs.push((input_path, extensions));
776778
}
777779

778780
let mut fragment_extensions = HashSet::new();

0 commit comments

Comments
 (0)