Skip to content

Commit e29fff2

Browse files
authored
fix(updater): do not run in dialog mode on .deb, closes #4573 (#4577)
1 parent 6441610 commit e29fff2

File tree

3 files changed

+33
-22
lines changed

3 files changed

+33
-22
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Only run the updater default dialog mode in supported platforms or development mode.

core/tauri/src/app.rs

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -794,21 +794,27 @@ impl<R: Runtime> App<R> {
794794
// check if updater is active or not
795795
if updater_config.active {
796796
if updater_config.dialog {
797-
// if updater dialog is enabled spawn a new task
798-
self.run_updater_dialog();
799-
// When dialog is enabled, if user want to recheck
800-
// if an update is available after first start
801-
// invoke the Event `tauri://update` from JS or rust side.
802-
handle.listen_global(updater::EVENT_CHECK_UPDATE, move |_msg| {
803-
let handle = handle_.clone();
804-
// re-spawn task inside tokyo to launch the download
805-
// we don't need to emit anything as everything is handled
806-
// by the process (user is asked to restart at the end)
807-
// and it's handled by the updater
808-
crate::async_runtime::spawn(
809-
async move { updater::check_update_with_dialog(handle).await },
810-
);
811-
});
797+
#[cfg(not(target_os = "linux"))]
798+
let updater_enabled = true;
799+
#[cfg(target_os = "linux")]
800+
let updater_enabled = cfg!(dev) || self.state::<Env>().appimage.is_some();
801+
if updater_enabled {
802+
// if updater dialog is enabled spawn a new task
803+
self.run_updater_dialog();
804+
// When dialog is enabled, if user want to recheck
805+
// if an update is available after first start
806+
// invoke the Event `tauri://update` from JS or rust side.
807+
handle.listen_global(updater::EVENT_CHECK_UPDATE, move |_msg| {
808+
let handle = handle_.clone();
809+
// re-spawn task inside tokyo to launch the download
810+
// we don't need to emit anything as everything is handled
811+
// by the process (user is asked to restart at the end)
812+
// and it's handled by the updater
813+
crate::async_runtime::spawn(
814+
async move { updater::check_update_with_dialog(handle).await },
815+
);
816+
});
817+
}
812818
} else {
813819
// we only listen for `tauri://update`
814820
// once we receive the call, we check if an update is available or not

examples/updater/src-tauri/Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)