Archive: Function un.onGUIInit


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

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


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