tauri_utils::config

Struct NsisConfig

Source
pub struct NsisConfig {
    pub template: Option<PathBuf>,
    pub header_image: Option<PathBuf>,
    pub sidebar_image: Option<PathBuf>,
    pub installer_icon: Option<PathBuf>,
    pub install_mode: NSISInstallerMode,
    pub languages: Option<Vec<String>>,
    pub custom_language_files: Option<HashMap<String, PathBuf>>,
    pub display_language_selector: bool,
    pub compression: NsisCompression,
    pub start_menu_folder: Option<String>,
    pub installer_hooks: Option<PathBuf>,
    pub minimum_webview2_version: Option<String>,
}
Expand description

Configuration for the Installer bundle using NSIS.

Fields§

§template: Option<PathBuf>

A custom .nsi template to use.

§header_image: Option<PathBuf>

The path to a bitmap file to display on the header of installers pages.

The recommended dimensions are 150px x 57px.

§sidebar_image: Option<PathBuf>

The path to a bitmap file for the Welcome page and the Finish page.

The recommended dimensions are 164px x 314px.

§installer_icon: Option<PathBuf>

The path to an icon file used as the installer icon.

§install_mode: NSISInstallerMode

Whether the installation will be for all users or just the current user.

§languages: Option<Vec<String>>

A list of installer languages. By default the OS language is used. If the OS language is not in the list of languages, the first language will be used. To allow the user to select the language, set display_language_selector to true.

See https://github.com/kichik/nsis/tree/9465c08046f00ccb6eda985abbdbf52c275c6c4d/Contrib/Language%20files for the complete list of languages.

§custom_language_files: Option<HashMap<String, PathBuf>>

A key-value pair where the key is the language and the value is the path to a custom .nsh file that holds the translated text for tauri’s custom messages.

See https://github.com/tauri-apps/tauri/blob/dev/crates/tauri-bundler/src/bundle/windows/nsis/languages/English.nsh for an example .nsh file.

Note: the key must be a valid NSIS language and it must be added to NsisConfig languages array,

§display_language_selector: bool

Whether to display a language selector dialog before the installer and uninstaller windows are rendered or not. By default the OS language is selected, with a fallback to the first language in the languages array.

§compression: NsisCompression

Set the compression algorithm used to compress files in the installer.

See https://nsis.sourceforge.io/Reference/SetCompressor

§start_menu_folder: Option<String>

Set the folder name for the start menu shortcut.

Use this option if you have multiple apps and wish to group their shortcuts under one folder or if you generally prefer to set your shortcut inside a folder.

Examples:

  • AwesomePublisher, shortcut will be placed in %AppData%\Microsoft\Windows\Start Menu\Programs\AwesomePublisher\<your-app>.lnk
  • If unset, shortcut will be placed in %AppData%\Microsoft\Windows\Start Menu\Programs\<your-app>.lnk
§installer_hooks: Option<PathBuf>

A path to a .nsh file that contains special NSIS macros to be hooked into the main installer.nsi script.

Supported hooks are:

  • NSIS_HOOK_PREINSTALL: This hook runs before copying files, setting registry key values and creating shortcuts.
  • NSIS_HOOK_POSTINSTALL: This hook runs after the installer has finished copying all files, setting the registry keys and created shortcuts.
  • NSIS_HOOK_PREUNINSTALL: This hook runs before removing any files, registry keys and shortcuts.
  • NSIS_HOOK_POSTUNINSTALL: This hook runs after files, registry keys and shortcuts have been removed.
§Example
!macro NSIS_HOOK_PREINSTALL
  MessageBox MB_OK "PreInstall"
!macroend

!macro NSIS_HOOK_POSTINSTALL
  MessageBox MB_OK "PostInstall"
!macroend

!macro NSIS_HOOK_PREUNINSTALL
  MessageBox MB_OK "PreUnInstall"
!macroend

!macro NSIS_HOOK_POSTUNINSTALL
  MessageBox MB_OK "PostUninstall"
!macroend
§minimum_webview2_version: Option<String>

Try to ensure that the WebView2 version is equal to or newer than this version, if the user’s WebView2 is older than this version, the installer will try to trigger a WebView2 update.

Trait Implementations§

Source§

impl Clone for NsisConfig

Source§

fn clone(&self) -> NsisConfig

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NsisConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NsisConfig

Source§

fn default() -> NsisConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for NsisConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for NsisConfig

Source§

fn eq(&self, other: &NsisConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for NsisConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for NsisConfig

Source§

impl StructuralPartialEq for NsisConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T