Struct tauri_utils::config::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: Option<NsisCompression>,
pub installer_hooks: Option<PathBuf>,
}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.
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: NSISInstallerModeWhether 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/tooling/bundler/src/bundle/windows/templates/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: boolWhether 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: Option<NsisCompression>Set the compression algorithm used to compress files in the installer.
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
!define NSIS_HOOK_PREINSTALL "NSIS_HOOK_PREINSTALL_"
!macro NSIS_HOOK_PREINSTALL_
MessageBox MB_OK "PreInstall"
!macroend
!define NSIS_HOOK_POSTINSTALL "NSIS_HOOK_POSTINSTALL_"
!macro NSIS_HOOK_POSTINSTALL_
MessageBox MB_OK "PostInstall"
!macroend
!define NSIS_HOOK_PREUNINSTALL "NSIS_HOOK_PREUNINSTALL_"
!macro NSIS_HOOK_PREUNINSTALL_
MessageBox MB_OK "PreUnInstall"
!macroend
!define NSIS_HOOK_POSTUNINSTALL "NSIS_HOOK_POSTUNINSTALL_"
!macro NSIS_HOOK_POSTUNINSTALL_
MessageBox MB_OK "PostUninstall"
!macroend
Trait Implementations§
source§impl Clone for NsisConfig
impl Clone for NsisConfig
source§fn clone(&self) -> NsisConfig
fn clone(&self) -> NsisConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for NsisConfig
impl Debug for NsisConfig
source§impl Default for NsisConfig
impl Default for NsisConfig
source§fn default() -> NsisConfig
fn default() -> NsisConfig
source§impl<'de> Deserialize<'de> for NsisConfig
impl<'de> Deserialize<'de> for NsisConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for NsisConfig
impl PartialEq for NsisConfig
source§fn eq(&self, other: &NsisConfig) -> bool
fn eq(&self, other: &NsisConfig) -> bool
self and other values to be equal, and is used
by ==.source§impl Serialize for NsisConfig
impl Serialize for NsisConfig
impl Eq for NsisConfig
impl StructuralPartialEq for NsisConfig
Auto Trait Implementations§
impl Freeze for NsisConfig
impl RefUnwindSafe for NsisConfig
impl Send for NsisConfig
impl Sync for NsisConfig
impl Unpin for NsisConfig
impl UnwindSafe for NsisConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.