Skip to main content

Nsis

Struct Nsis 

Source
pub struct Nsis {
    pub stack: Stack,
    pub vars: Variables,
    pub hwnd: Hwnd,
    /* private fields */
}
Expand description

Everything a plug-in export receives, in one place.

Constructed for you by nsis_fn!; the equivalent of EXDLL_INIT().

Fields§

§stack: Stack

The installer’s argument stack.

§vars: Variables

The installer’s 25 user variables.

§hwnd: Hwnd

The installer’s parent window.

Implementations§

Source§

impl Nsis

Source

pub unsafe fn from_raw( hwnd: Hwnd, string_size: c_int, variables: *mut Tchar, stacktop: *mut *mut StackNode, extra: *mut ExtraParameters, ) -> Self

Builds an Nsis from the five arguments of a plug-in export.

§Safety

All five arguments must be exactly what the installer passed, and the result must not outlive the call.

Source

pub fn string_size(&self) -> usize

The calling installer’s NSIS_MAX_STRLEN, in characters.

This is a runtime value. Never assume 1024.

Source

pub fn extra(&self) -> Option<&ExtraParameters>

The raw extra_parameters block, if the installer supplied one.

Source

pub fn exec_flags(&self) -> Option<&ExecFlags>

The installer’s live ExecFlags, if available.

Source

pub fn exec_flags_mut(&mut self) -> Option<&mut ExecFlags>

The installer’s live ExecFlags, mutably.

Source

pub fn plugin_api_version(&self) -> c_int

exec_flags->plugin_api_version.

Only meaningful from NSIS 2.42 onward; older installers leave unrelated data in this field. Compare with >=, never ==.

Source

pub fn require_api_version(&self, required: c_int) -> Result<()>

Fails unless the installer reports at least required.

Source

pub unsafe fn execute_code_segment(&mut self, position: c_int) -> Result<c_int>

Runs a code segment in the installer.

An honest passthrough of ExecuteCodeSegment, with the same contract: position is zero-based, so a function address obtained from GetFunctionAddress needs - 1.

§Safety

The installer will run arbitrary script code, which can re-enter this plug-in. Nothing here makes that safe.

Source

pub fn validate_filename(&mut self, name: &str) -> Result<String>

Replaces characters that are invalid in a filename, via the installer’s own validate_filename.

Source

pub fn register_callback(&mut self, callback: NsisPluginCallback) -> Result<()>

Registers an unload callback, as built by nsis_unload!.

/NOUNLOAD and SetPluginsUnload were deprecated in NSIS 3 and plug-ins now stay loaded for the life of the installer, so this is where cleanup belongs. Registering the same callback twice is not an error.

Source§

impl Nsis

Source

pub fn error(&self) -> bool

The error flag IfErrors reads. Set automatically when a nsis_fn! body returns Err.

Source

pub fn set_error(&mut self, value: bool)

The error flag IfErrors reads. Set automatically when a nsis_fn! body returns Err.

Source

pub fn silent(&self) -> bool

IfSilent / SetSilent.

Source

pub fn set_silent(&mut self, value: bool)

IfSilent / SetSilent.

Source

pub fn abort(&self) -> bool

IfAbort.

Source

pub fn set_abort(&mut self, value: bool)

IfAbort.

Source

pub fn reboot_flag(&self) -> bool

IfRebootFlag / SetRebootFlag.

Source

pub fn set_reboot_flag(&mut self, value: bool)

IfRebootFlag / SetRebootFlag.

Source

pub fn autoclose(&self) -> bool

SetAutoClose.

Source

pub fn set_autoclose(&mut self, value: bool)

SetAutoClose.

Source

pub fn rtl(&self) -> bool

IfRtlLanguage: whether $LANGUAGE is right-to-left.

Source

pub fn set_rtl(&mut self, value: bool)

IfRtlLanguage: whether $LANGUAGE is right-to-left.

Source

pub fn all_users(&self) -> bool

SetShellVarContext: false is user context, true is machine context.

Source

pub fn set_all_users(&mut self, value: bool)

SetShellVarContext: false is user context, true is machine context.

Source§

impl Nsis

Source

pub fn errlvl(&self) -> c_int

SetErrorLevel.

Source

pub fn set_errlvl(&mut self, value: c_int)

SetErrorLevel.

Source

pub fn alter_reg_view(&self) -> c_int

SetRegView: 0 is the default view.

Source

pub fn set_alter_reg_view(&mut self, value: c_int)

SetRegView: 0 is the default view.

Source

pub fn status_update(&self) -> c_int

SetDetailsPrint.

Source

pub fn set_status_update(&mut self, value: c_int)

SetDetailsPrint.

Source

pub fn instdir_error(&self) -> c_int

GetInstDirError.

Source

pub fn set_instdir_error(&mut self, value: c_int)

GetInstDirError.

Auto Trait Implementations§

§

impl !Send for Nsis

§

impl !Sync for Nsis

§

impl Freeze for Nsis

§

impl RefUnwindSafe for Nsis

§

impl Unpin for Nsis

§

impl UnsafeUnpin for Nsis

§

impl UnwindSafe for Nsis

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.