Skip to content
⌘ NSIS Forum Archive

Function un.onGUIInit

3 posts

pgg1#

Function un.onGUIInit

Hi

I'm trying to call a function before the uninstall window appears. The following works perfectly:


outFile "installer.exe"
installDir $DESKTOP

section
setOutPath $INSTDIR
file test.txt
writeUninstaller $INSTDIR\uninstaller.exe
sectionEnd


section "Uninstall"
delete $INSTDIR\uninstaller.exe
delete $INSTDIR\test.txt
sectionEnd

Function .onInit
MessageBox MB_OK "before initialise."
FunctionEnd

Function un.onGUIInit
MessageBox MB_OK "before uninstall."
FunctionEnd
However, the moment I add the function un.onGUIInit to my real script I get a compile error saying:

Function: "un.onGUIInit"
Error: Function named "un.onGUIInit" already exists.

But there is no other duplicate function within my script. It wasn't in any of the headers either.

Any ideas?

Cheers,

Paul
pgg1#
In my script I use MUI and I have just found out the following:

The MUI itself uses .onGUIInit and un.onGUIInit you should define a certain define to tell it to call your own function from its .onGUIInit. See the MUI readme for more information.

So I'm looking into that.

Cheers,

Paul
CancerFace#
Check the MUI readme and look for MUI_CUSTOMFUNCTION_UNGUIINIT in the General Custom Functions section
CF