Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bundler): ensure that there are no duplicate extension arguments when bundling on Windows, fixes #6103 #6917

Merged
merged 2 commits into from
May 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions tooling/bundler/src/bundle/windows/msi/wix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use log::info;
use regex::Regex;
use serde::{Deserialize, Serialize};
use std::{
collections::{BTreeMap, HashMap},
collections::{BTreeMap, HashMap, HashSet},
fs::{create_dir_all, read_to_string, remove_dir_all, rename, write, File},
io::Write,
path::{Path, PathBuf},
Expand Down Expand Up @@ -356,14 +356,7 @@ fn run_light(
) -> crate::Result<()> {
let light_exe = wix_toolset_path.join("light.exe");

let mut args: Vec<String> = vec![
"-ext".to_string(),
"WixUIExtension".to_string(),
"-ext".to_string(),
"WixUtilExtension".to_string(),
"-o".to_string(),
display_path(output_path),
];
let mut args: Vec<String> = vec!["-o".to_string(), display_path(output_path)];

args.extend(arguments);

Expand Down Expand Up @@ -735,9 +728,15 @@ pub fn build_wix_app_installer(
candle_inputs.push((fragment_path, extensions));
}

let mut fragment_extensions = Vec::new();
let mut fragment_extensions = HashSet::new();
//Default extensions
fragment_extensions.insert(wix_toolset_path.join("WixUIExtension.dll"));
fragment_extensions.insert(wix_toolset_path.join("WixUtilExtension.dll"));

for (path, extensions) in candle_inputs {
fragment_extensions.extend(extensions.clone());
for ext in &extensions {
fragment_extensions.insert(ext.clone());
}
run_candle(settings, wix_toolset_path, &output_path, path, extensions)?;
}

Expand Down Expand Up @@ -816,7 +815,7 @@ pub fn build_wix_app_installer(
wix_toolset_path,
&output_path,
arguments,
&fragment_extensions,
&(fragment_extensions.clone().into_iter().collect()),
&msi_output_path,
)?;
rename(&msi_output_path, &msi_path)?;
Expand Down