Archive: Cancel button of custom page malfunction


Cancel button of custom page malfunction
Hi,
I have a cutom page using the CANCEL button to go to the next page, and using the NEXT button do
some extra evaluations in the function before leave. The problem is that if the function before leave
includes "Abort", the CANCEL button will not go next page, if not, it's fine. Following is the code, if you mask the Abort in the testPageLeave, the problem disappearred.Can anybody help me to solve this problem? Thanks!


#------------------------------------------------
#test.nsi
!include "MUI.nsh"

!define MUI_CUSTOMFUNCTION_ABORT .myuserabort

Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "test.ini"
FunctionEnd

!insertmacro MUI_PAGE_WELCOME
Page custom testPageShow testPageLeave
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_LANGUAGE "English"

OutFile "test.exe"

Section "MainSection" SEC01
SectionEnd

Function testPageShow
Push $R0
InstallOptions::dialog "$PLUGINSDIR\test.ini"
Pop $R0
Pop $R0
FunctionEnd

Function testPageLeave
Abort
FunctionEnd

Function .myuserabort
SendMessage $HWNDPARENT "0x408" "1" ""
Abort
FunctionEnd

#----------------
#test.ini
[Settings]
NumFields=1

[Field 1]
Type=Label
Text=test
Left=10
Right=28
Top=20
Bottom=40


NSIS processes the Cancel button and not InstallOptions. You can't use the Cancel button for anything else but aborting.


But if I jump 2 pages like:
SendMessage $HWNDPARENT "0x408" "2" ""
in Function .myuserabort, it works. Or if I mask the "Abort" in Function testPageLeave, then the CANCEL button can go to the next page.


The destruction process of the installer has already initialized once the Cancel button is pressed. Any problem that occurs after you force it to do something else can be caused by this.