Old 4th September 2007, 04:39   #1
fifth8118
Junior Member
 
Join Date: Sep 2007
Posts: 3
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
fifth8118 is offline   Reply With Quote
Old 4th September 2007, 23:35   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
NSIS processes the Cancel button and not InstallOptions. You can't use the Cancel button for anything else but aborting.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 5th September 2007, 13:36   #3
fifth8118
Junior Member
 
Join Date: Sep 2007
Posts: 3
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.

Last edited by fifth8118; 5th September 2007 at 13:53.
fifth8118 is offline   Reply With Quote
Old 6th September 2007, 02:46   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump