diff --git a/.changes/fix-updater-msi.md b/.changes/fix-updater-msi.md new file mode 100644 index 000000000..2ff95e6cc --- /dev/null +++ b/.changes/fix-updater-msi.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": patch +--- + +Properly create the updater bundle for all generated Microsoft Installer files. diff --git a/tooling/bundler/src/bundle.rs b/tooling/bundler/src/bundle.rs index ee04920b7..c05de84d1 100644 --- a/tooling/bundler/src/bundle.rs +++ b/tooling/bundler/src/bundle.rs @@ -29,6 +29,7 @@ use common::{print_finished, print_info}; use std::path::PathBuf; /// Generated bundle metadata. +#[derive(Debug)] pub struct Bundle { /// The package type. pub package_type: PackageType, diff --git a/tooling/bundler/src/bundle/updater_bundle.rs b/tooling/bundler/src/bundle/updater_bundle.rs index 54a106554..a4e01f30f 100644 --- a/tooling/bundler/src/bundle/updater_bundle.rs +++ b/tooling/bundler/src/bundle/updater_bundle.rs @@ -123,35 +123,33 @@ fn bundle_update(settings: &Settings, bundles: &[Bundle]) -> crate::Result crate::Result> { // find our .msi or rebuild - let bundle_path = match bundles + let mut bundle_paths = bundles .iter() - .filter(|bundle| bundle.package_type == crate::PackageType::WindowsMsi) - .find_map(|bundle| { - bundle - .bundle_paths - .iter() - .find(|path| path.extension() == Some(OsStr::new("msi"))) - }) { - Some(path) => vec![path.clone()], - None => msi::bundle_project(settings)?, - }; + .find(|bundle| bundle.package_type == crate::PackageType::WindowsMsi) + .map(|bundle| bundle.bundle_paths.clone()) + .unwrap_or_default(); - // we expect our .msi to be on bundle_path[0] - if bundle_path.is_empty() { - return Err(crate::Error::UnableToFindProject); + // we expect our .msi files to be on `bundle_paths` + if bundle_paths.is_empty() { + bundle_paths.extend(msi::bundle_project(settings)?); } - let source_path = &bundle_path[0]; + let mut msi_archived_paths = Vec::new(); - // add .tar.gz to our path - let msi_archived = format!("{}.zip", source_path.display()); - let msi_archived_path = PathBuf::from(&msi_archived); + for source_path in bundle_paths { + // add .zip to our path + let msi_archived = format!("{}.zip", source_path.display()); + let msi_archived_path = PathBuf::from(&msi_archived); - // Create our gzip file - create_zip(source_path, &msi_archived_path).with_context(|| "Failed to zip update MSI")?; + common::print_bundling(format!("{:?}", &msi_archived_path).as_str())?; - common::print_bundling(format!("{:?}", &msi_archived_path).as_str())?; - Ok(vec![msi_archived_path]) + // Create our gzip file + create_zip(&source_path, &msi_archived_path).with_context(|| "Failed to zip update MSI")?; + + msi_archived_paths.push(msi_archived_path); + } + + Ok(msi_archived_paths) } #[cfg(target_os = "windows")] diff --git a/tooling/bundler/src/bundle/windows/msi/wix.rs b/tooling/bundler/src/bundle/windows/msi/wix.rs index 6c5781e98..a61e12cf7 100644 --- a/tooling/bundler/src/bundle/windows/msi/wix.rs +++ b/tooling/bundler/src/bundle/windows/msi/wix.rs @@ -410,7 +410,6 @@ pub fn build_wix_app_installer( Ok(()) }; - common::print_info("trying to sign app")?; try_sign(&app_exe_source)?; // ensure that `target/{release, debug}/wix` folder exists