From 59493610f9bb2ecf6139e6f7e62e78cdd789ee8c Mon Sep 17 00:00:00 2001 From: biaocy Date: Tue, 9 May 2023 19:21:08 +0800 Subject: [PATCH 1/2] fix(bundler): ensure that there are no duplicate extension arguments during bundling on Windows (fix #6103) --- tooling/bundler/src/bundle/windows/msi/wix.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tooling/bundler/src/bundle/windows/msi/wix.rs b/tooling/bundler/src/bundle/windows/msi/wix.rs index e342ddd66fc1..2c19cb8c6aa5 100644 --- a/tooling/bundler/src/bundle/windows/msi/wix.rs +++ b/tooling/bundler/src/bundle/windows/msi/wix.rs @@ -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}, @@ -357,10 +357,6 @@ fn run_light( let light_exe = wix_toolset_path.join("light.exe"); let mut args: Vec = vec![ - "-ext".to_string(), - "WixUIExtension".to_string(), - "-ext".to_string(), - "WixUtilExtension".to_string(), "-o".to_string(), display_path(output_path), ]; @@ -735,9 +731,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)?; } @@ -816,7 +818,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)?; From e4921f0c4fd955a5f518fd01c89f4251efeb7ad2 Mon Sep 17 00:00:00 2001 From: biaocy Date: Fri, 12 May 2023 20:03:27 +0800 Subject: [PATCH 2/2] fix(bundler): ensure that there are no duplicate extension arguments during bundling on Windows (fix #6103) --- tooling/bundler/src/bundle/windows/msi/wix.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tooling/bundler/src/bundle/windows/msi/wix.rs b/tooling/bundler/src/bundle/windows/msi/wix.rs index 2c19cb8c6aa5..b581ce4b6472 100644 --- a/tooling/bundler/src/bundle/windows/msi/wix.rs +++ b/tooling/bundler/src/bundle/windows/msi/wix.rs @@ -356,10 +356,7 @@ fn run_light( ) -> crate::Result<()> { let light_exe = wix_toolset_path.join("light.exe"); - let mut args: Vec = vec![ - "-o".to_string(), - display_path(output_path), - ]; + let mut args: Vec = vec!["-o".to_string(), display_path(output_path)]; args.extend(arguments);