Skip to content

Callbacks

alexmitev81 edited this page Feb 27, 2017 · 5 revisions

Standard Callbacks

Like all other normal NSIS pages, both the MULTIUSER_PAGE_INSTALLMODE and MULTIUSER_UNPAGE_INSTALLMODE pages support the standart PRE, SHOW, LEAVE callbacks:

!define MUI_PAGE_CUSTOMFUNCTION_PRE un.PageInstallModePre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.PageInstallModeShow
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.PageInstallModeLeave
!insertmacro MULTIUSER_PAGE_INSTALLMODE
...
!define MUI_PAGE_CUSTOMFUNCTION_PRE un.PageInstallModePre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW un.PageInstallModeShow
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE un.PageInstallModeLeave
!insertmacro MULTIUSER_UNPAGE_INSTALLMODE

MULTIUSER_INSTALLMODE_CHANGE_MODE_FUNCTION

Provide a callback function when the current install mode changes (user toggles between per-machine/per-user installation). Usually you'll want to use this to set the $StartMenuFolder variable.

Usage:

!define MULTIUSER_INSTALLMODE_CHANGE_MODE_FUNCTION PageInstallModeChangeMode
!insertmacro MULTIUSER_PAGE_INSTALLMODE 
...
Function PageInstallModeChangeMode
	!insertmacro MUI_STARTMENU_GETFOLDER "" $StartMenuFolder
FunctionEnd

MULTIUSER_INSTALLMODE_CHANGE_MODE_UNFUNCTION

Same as MULTIUSER_INSTALLMODE_CHANGE_MODE_FUNCTION, but for the uninstaller.

Usage:

!define MULTIUSER_INSTALLMODE_CHANGE_MODE_UNFUNCTION un.PageInstallModeChangeMode
!insertmacro MULTIUSER_PAGE_INSTALLMODE 
...
Function un.PageInstallModeChangeMode
	!insertmacro MUI_STARTMENU_GETFOLDER "" $StartMenuFolder
FunctionEnd

MULTIUSER_INSTALLMODE_FUNCTION

This callback is still supported in old code, but in new code you should use MULTIUSER_INSTALLMODE_CHANGE_MODE_FUNCTION instead.

MULTIUSER_INSTALLMODE_UNFUNCTION

This callback is still supported in old code, but in new code you should use MULTIUSER_INSTALLMODE_CHANGE_MODE_UNFUNCTION instead.

Clone this wiki locally