docs(updater): installer args and on_before_exit (#3099)

* docs(updater): installer args and `on_before_exit`

* Update plugins/updater/src/updater.rs

Co-authored-by: Fabian-Lars <github@fabianlars.de>

* Explicitly state there are internal args

* s
This commit is contained in:
Tony
2025-11-12 20:49:41 +08:00
committed by GitHub
parent 27790aa67c
commit a368cef912
2 changed files with 15 additions and 1 deletions
+6
View File
@@ -148,6 +148,7 @@ impl Builder {
self
}
/// Adds an additional argument to pass to the Windows installer.
pub fn installer_args<I, S>(mut self, args: I) -> Self
where
I: IntoIterator<Item = S>,
@@ -157,6 +158,7 @@ impl Builder {
self
}
/// Adds multiple additional arguments to pass to the Windows installer.
pub fn installer_arg<S>(mut self, arg: S) -> Self
where
S: Into<OsString>,
@@ -165,6 +167,10 @@ impl Builder {
self
}
/// Removes all the additional arguments to pass to the Windows installer.
///
/// Note: this only removes the additional arguments added through [`Self::installer_args`],
/// not the ones managed by us (e.g. `/UPDATER` flag passed to the NSIS installer)
pub fn clear_installer_args(mut self) -> Self {
self.installer_args.clear();
self
+9 -1
View File
@@ -247,6 +247,7 @@ impl UpdaterBuilder {
self
}
/// Adds an argument to pass to the Windows installer.
pub fn installer_arg<S>(mut self, arg: S) -> Self
where
S: Into<OsString>,
@@ -255,6 +256,7 @@ impl UpdaterBuilder {
self
}
/// Adds multiple arguments to pass to the Windows installer.
pub fn installer_args<I, S>(mut self, args: I) -> Self
where
I: IntoIterator<Item = S>,
@@ -264,11 +266,18 @@ impl UpdaterBuilder {
self
}
/// Removes all the additional arguments to pass to the Windows installer.
///
/// Note: this only removes the additional arguments added through
/// [`Self::installer_arg`], [`crate::Builder::installer_arg`]
/// and the `plugins > updater > windows > installerArgs` config,
/// not the ones managed by us (e.g. `/UPDATER` flag passed to the NSIS installer)
pub fn clear_installer_args(mut self) -> Self {
self.installer_args.clear();
self
}
/// Function to run before we run the installer and exit the app through `std::process::exit(0)` on Windows
pub fn on_before_exit<F: Fn() + Send + Sync + 'static>(mut self, f: F) -> Self {
self.on_before_exit.replace(Arc::new(f));
self
@@ -278,7 +287,6 @@ impl UpdaterBuilder {
///
/// Note that `reqwest` crate may be updated in minor releases of tauri-plugin-updater.
/// Therefore it's recommended to pin the plugin to at least a minor version when you're using `configure_client`.
///
pub fn configure_client<F: Fn(ClientBuilder) -> ClientBuilder + Send + Sync + 'static>(
mut self,
f: F,