- NSIS Discussion
- "Next" button
Archive: "Next" button
ovidiu
30th April 2004 09:47 UTC
"Next" button
In one of the custom pages in my installer at the initialization I disable the "Next >" button and then, based on user input I enable it. It's meant to stop the user from keying in rubish and get away with it...
The problem is: the stupit button doesn't want to get back to "enabled" state...
the code is very simple:
....
page custom java_home java_home_valid
....
Function java_home
....
GetDlgItem $NEXTWINDOW $HWNDPARENT 1
EnableWindow $NEXTWINDOW 0
....
FunctionEnd
Function java_home_valid
....
; search for java.exe
JREdll::validate "$JRE_LOCATION" ;my own plugin
Pop $valid
StrCmp $valid "TRUE" "" "ELSE"
GetDlgItem $NEXTWINDOW $HWNDPARENT 1
EnableWindow $NEXTWINDOW 1
ELSE:
....
FunctionEnd
....
Thas it... easy, right ? but it doesn't work... it does work for the other 2 buttons, "back" and "cancel"... i can disable and enable them as i wish... but i don't need that! I want my "Next" back !!
Anyone has ANY idea ?
evilO
30th April 2004 13:40 UTC
Hi :)
Instead of disabling the "Next" button you could use the instruction "Abort" in the page's "Leave Function" if the user has typed rubbish... If he did, he'll stay on the page. You can also display a message at this point..
Explanations about "Callback functions" can be found there:
http://nsis.sourceforge.net/Docs/Chapter4.html#4.5.3
evilO/Olive
ovidiu
30th April 2004 14:00 UTC
I know that... but i prefer not to let them click "next" if the input is not correct...
Actually it's a bit different... The "input" is a disabled customized "browse for directory" which has the "OK" button enabled if and only if the selected directory points to a JDK home. Until the user chooses a valid JDK directory the "Next" button is disabled.
Of course if i will not be able to do it my way, the proposed solution sounds good.
It's just a challenge for me and who ever has some free time to think about it ... :D
ovidiu
30th April 2004 19:27 UTC
Aha!!! so it's the little sneaky "abort" that causes all the problems... the little bastard...
NOw.. how can I go around it.... ??
Joost Verburg
30th April 2004 19:31 UTC
It has been reported and will be fixed.
ovidiu
1st May 2004 04:08 UTC
Sorry, I'm new here... I discovered NSIS one week ago :D How will I know if it has been fixed ? Is there a page that I have to read daily like a ChangeLog or something ?
Thanks for your help...
Joost Verburg
9th May 2004 13:53 UTC
Fixed in the latest CVS version.
ovidiu
11th May 2004 16:20 UTC
Hmm....
I've tried the new changes and it seams to me that all the buttons are messed up... Is it just me or someone else had same problem..
"Next" doesn't get enabled and "Back" and "Next" (if i do not disable it) have the same effect, "move to next screen" ... I will keep trying to see if it's my error but so far my script seams to be correct...
P.S.
Thanks for the effort!
Joost Verburg
15th May 2004 16:32 UTC
kichik fixed that in the latest CVS version.
ovidiu
24th May 2004 03:08 UTC
Strange... It still behaves the same.... the "next" doesnt get re-enabled...
ovidiu
26th May 2004 13:56 UTC
Just curious, is anybody still looking into this error or I should give up the hope and try a different solution?
Thanks.
kichik
26th May 2004 14:08 UTC
Make sure you have the latest CVS version. It's working for other people and I have just successfully tested it again to make sure.
ovidiu
26th May 2004 14:16 UTC
OK.. I will download it again and test one more time...
Fingers crossed!!!
ovidiu
26th May 2004 16:28 UTC
It works!!
What was wrong? kichik forgot to add "InstallOptions.dll" in the modifed files list and I havent update it... :rolleyes:
2004-05-15 11:22 Amir Szekely (kichik)
makensis.exe, Source/exehead/Ui.c: fixed the next/back buttons bug caused by the last fix
Now it's PERFECT!!! Thanks alot guys!!! Great job!!!