feat(updater): gate auto-updater behind Cargo feature updater
Makes tauri-plugin-updater and tauri-plugin-process optional dependencies enabled by a default-on `updater` Cargo feature. Sandboxed packaging targets (Flatpak, Snap) will build with `--no-default-features` to exclude the plugins entirely, satisfying store policies that prohibit competing auto-updaters. Changes: - Cargo.toml: add `updater` feature; plugins are now optional deps - lib.rs: gate plugin registration on the feature - updates/mod.rs: is_auto_update_eligible() returns false when the feature is off (catch-all for unusual build configs) - capabilities/default.json: remove updater/process permissions - build.rs: emit capabilities/auto-updater.json only when the feature is enabled; remove it otherwise. The file is gitignored since it is fully build-driven. cc
This commit is contained in:
6 files changed
+62
-11
No files matched your search
@@ -16,6 +16,13 @@ path = "src/main.rs"
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[features]
|
||||
default = ["updater"]
|
||||
# Enables the in-app auto-updater (tauri-plugin-updater + tauri-plugin-process).
|
||||
# Disabled for sandboxed packaging targets (Flatpak, Snap) which have their own
|
||||
# update channels and whose store policies prohibit competing updaters.
|
||||
updater = ["dep:tauri-plugin-updater", "dep:tauri-plugin-process"]
|
||||
|
||||
[dependencies]
|
||||
# QBZ Crates (extracted core functionality)
|
||||
qbz-models = { path = "../crates/qbz-models" }
|
||||
@@ -39,8 +46,8 @@ tauri-plugin-opener = "2"
|
||||
tauri-plugin-os = "2"
|
||||
tauri-plugin-single-instance = { version = "2", features = ["deep-link"] }
|
||||
tauri-plugin-deep-link = "2"
|
||||
tauri-plugin-updater = "2"
|
||||
tauri-plugin-process = "2"
|
||||
tauri-plugin-updater = { version = "2", optional = true }
|
||||
tauri-plugin-process = { version = "2", optional = true }
|
||||
|
||||
# Serialization
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
||||
Reference in new issue
Block a user