Skip to content

Commit 15468de

Browse files
authored
fix(bundler): recognize deb and rpm as self-contained updater targets (#16064)
* fix(bundler): recognize deb and rpm as self-contained updater targets The self-contained updater check excluded RPM and the "no updater-enabled targets" warning omitted deb/rpm, although both are signed as updater artifacts and supported by the updater plugin. * cr * cr
1 parent 8e70283 commit 15468de

2 files changed

Lines changed: 30 additions & 17 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": "patch:bug"
3+
---
4+
5+
Recognize `.deb` and `.rpm` as self contained updater artifacts (the updater plugin installs them directly): the "no updater-enabled targets were built" warning is no longer printed when only a `.rpm` bundle is produced, and it now lists both targets. Setting `createUpdaterArtifacts` to `"v1Compatible"` no longer fails with "Unable to find a bundled project for the updater" when only a `.deb` bundle is built; the legacy updater never supported `.deb`, so the bundler now warns that no v1 compatible artifact was created instead.

‎crates/tauri-bundler/src/bundle.rs‎

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -219,38 +219,46 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<Bundle>> {
219219
}
220220

221221
if let Some(updater) = settings.updater() {
222-
if package_types.iter().any(|package_type| {
223-
if updater.v1_compatible {
222+
// Targets the legacy v1 updater can consume once they are wrapped in a tar.gz / zip.
223+
let has_v1_target = updater.v1_compatible
224+
&& package_types.iter().any(|package_type| {
224225
matches!(
225226
package_type,
226227
PackageType::AppImage
227228
| PackageType::MacOsBundle
228229
| PackageType::Nsis
229230
| PackageType::WindowsMsi
230-
| PackageType::Deb
231231
)
232-
} else {
233-
matches!(package_type, PackageType::MacOsBundle)
234-
}
235-
}) {
232+
});
233+
// Targets the v2 updater plugin installs directly, no wrapping needed.
234+
let has_self_contained_target = package_types.iter().any(|package_type| {
235+
matches!(
236+
package_type,
237+
PackageType::AppImage
238+
| PackageType::Nsis
239+
| PackageType::WindowsMsi
240+
| PackageType::Deb
241+
| PackageType::Rpm
242+
)
243+
});
244+
245+
// the macOS app bundle is always archived, the other v1 targets only for the legacy updater
246+
if package_types.contains(&PackageType::MacOsBundle) || has_v1_target {
236247
let updater_paths = updater_bundle::bundle_project(settings, &bundles)?;
237248
bundles.push(Bundle {
238249
package_type: PackageType::Updater,
239250
bundle_paths: updater_paths,
240251
});
241-
} else if updater.v1_compatible
242-
|| !package_types.iter().any(|package_type| {
243-
// Self contained updater, no need to zip
244-
matches!(
245-
package_type,
246-
PackageType::AppImage | PackageType::Nsis | PackageType::WindowsMsi | PackageType::Deb
247-
)
248-
})
249-
{
252+
} else if updater.v1_compatible {
250253
log::warn!(
251-
"The bundler was configured to create updater artifacts but no updater-enabled targets were built. Please enable one of these targets: app, appimage, msi, nsis"
254+
"No v1 compatible updater artifact was created: the legacy updater only supports the app, appimage, msi and nsis targets. deb and rpm bundles can only be installed by the v2 updater plugin."
255+
);
256+
} else if !has_self_contained_target {
257+
log::warn!(
258+
"The bundler was configured to create updater artifacts but no updater-enabled targets were built. Please enable one of these targets: app, appimage, deb, rpm, msi, nsis"
252259
);
253260
}
261+
254262
if updater.v1_compatible {
255263
log::warn!(
256264
"Legacy v1 compatible updater is deprecated and will be removed in v3, change bundle > createUpdaterArtifacts to true when your users are updated to the version with v2 updater plugin"

0 commit comments

Comments
 (0)