diff --git a/plugins/updater/src/lib.rs b/plugins/updater/src/lib.rs index fb059e439..8eba4269d 100644 --- a/plugins/updater/src/lib.rs +++ b/plugins/updater/src/lib.rs @@ -148,6 +148,7 @@ impl Builder { self } + /// Adds an additional argument to pass to the Windows installer. pub fn installer_args(mut self, args: I) -> Self where I: IntoIterator, @@ -157,6 +158,7 @@ impl Builder { self } + /// Adds multiple additional arguments to pass to the Windows installer. pub fn installer_arg(mut self, arg: S) -> Self where S: Into, @@ -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 diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index 28c420ca8..a8e1f6bd4 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -247,6 +247,7 @@ impl UpdaterBuilder { self } + /// Adds an argument to pass to the Windows installer. pub fn installer_arg(mut self, arg: S) -> Self where S: Into, @@ -255,6 +256,7 @@ impl UpdaterBuilder { self } + /// Adds multiple arguments to pass to the Windows installer. pub fn installer_args(mut self, args: I) -> Self where I: IntoIterator, @@ -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(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 ClientBuilder + Send + Sync + 'static>( mut self, f: F,