Skip to main content

nsis_unload

Macro nsis_unload 

Source
macro_rules! nsis_unload {
    ($(
		$(#[$attr:meta])*
		fn $name:ident() $body:block
	)*) => { ... };
}
Expand description

Defines an NSPIM_UNLOAD callback, to be handed to Nsis::register_callback.

This is where cleanup belongs: /NOUNLOAD and SetPluginsUnload were deprecated in NSIS 3, and plug-ins now stay loaded for the life of the installer. api.h documents NSPIM_UNLOAD as the last message a plug-in receives.

ⓘ
nsis_unload! {
    fn cleanup() {
        // release anything held across calls
    }
}

nsis_fn! {
    fn Init(nsis: &mut Nsis) -> Result<()> {
        nsis.register_callback(cleanup)?;
        Ok(())
    }
}