mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-14 13:21:01 +03:00
parent
64416100c6
commit
e29fff2566
5
.changes/updater-dialog-unsupported-platform.md
Normal file
5
.changes/updater-dialog-unsupported-platform.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"tauri": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Only run the updater default dialog mode in supported platforms or development mode.
|
@ -794,21 +794,27 @@ impl<R: Runtime> App<R> {
|
|||||||
// check if updater is active or not
|
// check if updater is active or not
|
||||||
if updater_config.active {
|
if updater_config.active {
|
||||||
if updater_config.dialog {
|
if updater_config.dialog {
|
||||||
// if updater dialog is enabled spawn a new task
|
#[cfg(not(target_os = "linux"))]
|
||||||
self.run_updater_dialog();
|
let updater_enabled = true;
|
||||||
// When dialog is enabled, if user want to recheck
|
#[cfg(target_os = "linux")]
|
||||||
// if an update is available after first start
|
let updater_enabled = cfg!(dev) || self.state::<Env>().appimage.is_some();
|
||||||
// invoke the Event `tauri://update` from JS or rust side.
|
if updater_enabled {
|
||||||
handle.listen_global(updater::EVENT_CHECK_UPDATE, move |_msg| {
|
// if updater dialog is enabled spawn a new task
|
||||||
let handle = handle_.clone();
|
self.run_updater_dialog();
|
||||||
// re-spawn task inside tokyo to launch the download
|
// When dialog is enabled, if user want to recheck
|
||||||
// we don't need to emit anything as everything is handled
|
// if an update is available after first start
|
||||||
// by the process (user is asked to restart at the end)
|
// invoke the Event `tauri://update` from JS or rust side.
|
||||||
// and it's handled by the updater
|
handle.listen_global(updater::EVENT_CHECK_UPDATE, move |_msg| {
|
||||||
crate::async_runtime::spawn(
|
let handle = handle_.clone();
|
||||||
async move { updater::check_update_with_dialog(handle).await },
|
// re-spawn task inside tokyo to launch the download
|
||||||
);
|
// we don't need to emit anything as everything is handled
|
||||||
});
|
// by the process (user is asked to restart at the end)
|
||||||
|
// and it's handled by the updater
|
||||||
|
crate::async_runtime::spawn(
|
||||||
|
async move { updater::check_update_with_dialog(handle).await },
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// we only listen for `tauri://update`
|
// we only listen for `tauri://update`
|
||||||
// once we receive the call, we check if an update is available or not
|
// once we receive the call, we check if an update is available or not
|
||||||
|
14
examples/updater/src-tauri/Cargo.lock
generated
14
examples/updater/src-tauri/Cargo.lock
generated
@ -2622,7 +2622,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri"
|
name = "tauri"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"attohttpc",
|
"attohttpc",
|
||||||
@ -2671,7 +2671,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-build"
|
name = "tauri-build"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cargo_toml",
|
"cargo_toml",
|
||||||
@ -2686,7 +2686,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-codegen"
|
name = "tauri-codegen"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"brotli",
|
"brotli",
|
||||||
@ -2708,7 +2708,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-macros"
|
name = "tauri-macros"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.4.0",
|
"heck 0.4.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@ -2720,7 +2720,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-runtime"
|
name = "tauri-runtime"
|
||||||
version = "0.9.0"
|
version = "0.10.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gtk",
|
"gtk",
|
||||||
"http",
|
"http",
|
||||||
@ -2738,7 +2738,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-runtime-wry"
|
name = "tauri-runtime-wry"
|
||||||
version = "0.9.0"
|
version = "0.10.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"gtk",
|
"gtk",
|
||||||
@ -2756,7 +2756,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-utils"
|
name = "tauri-utils"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brotli",
|
"brotli",
|
||||||
"ctor",
|
"ctor",
|
||||||
|
Loading…
Reference in New Issue
Block a user