|
@@ -482,6 +482,9 @@ pub fn build_wix_app_installer(
|
|
|
data.insert("resources", to_json(resources_wix_string));
|
|
|
data.insert("resource_file_ids", to_json(files_ids));
|
|
|
|
|
|
+ let merge_modules = get_merge_modules(&settings)?;
|
|
|
+ data.insert("merge_modules", to_json(merge_modules));
|
|
|
+
|
|
|
let main_binary = settings
|
|
|
.binaries()
|
|
|
.iter()
|
|
@@ -572,6 +575,38 @@ fn generate_binaries_data(settings: &Settings) -> crate::Result<Vec<Binary>> {
|
|
|
Ok(binaries)
|
|
|
}
|
|
|
|
|
|
+#[derive(Serialize)]
|
|
|
+struct MergeModule {
|
|
|
+ name: String,
|
|
|
+ path: String,
|
|
|
+}
|
|
|
+
|
|
|
+fn get_merge_modules(settings: &Settings) -> crate::Result<Vec<MergeModule>> {
|
|
|
+ let mut merge_modules = Vec::new();
|
|
|
+ let regex = Regex::new(r"[^\w\d\.]")?;
|
|
|
+ for msm in glob::glob(
|
|
|
+ settings
|
|
|
+ .project_out_directory()
|
|
|
+ .join("*.msm")
|
|
|
+ .to_string_lossy()
|
|
|
+ .to_string()
|
|
|
+ .as_str(),
|
|
|
+ )? {
|
|
|
+ let path = msm?;
|
|
|
+ let filename = path
|
|
|
+ .file_name()
|
|
|
+ .expect("failed to extract merge module filename")
|
|
|
+ .to_os_string()
|
|
|
+ .into_string()
|
|
|
+ .expect("failed to convert merge module filename to string");
|
|
|
+ merge_modules.push(MergeModule {
|
|
|
+ name: regex.replace_all(&filename, "").to_string(),
|
|
|
+ path: path.to_string_lossy().to_string(),
|
|
|
+ });
|
|
|
+ }
|
|
|
+ Ok(merge_modules)
|
|
|
+}
|
|
|
+
|
|
|
/// Generates the data required for the resource bundling on wix
|
|
|
fn generate_resource_data(settings: &Settings) -> crate::Result<ResourceMap> {
|
|
|
let mut resources = ResourceMap::new();
|