|
|
#1 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
Hi All,
From a NSIS script file, I'm trying to do something like this If the user forgets to enter input, display a messagebox that forces him to enter input. This works fine but when I hit the back button, it displays the message box instead of navigating to the previous page. Is there any way to read the value of Back, Next etc from the code? Do they live in register variables? I checked $R1, it's empty! Would really appreciate any help, Thanks in advance, M.J.S P.S. I'm using NSIS 2.0 and the modern UI. |
|
|
|
|
|
#2 | |
|
Major Dude
|
Quote:
PHP Code:
|
|
|
|
|
|
|
#3 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Using the leave function is easier.
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
I tried the leave function approach before I posted to the forum.
page custom Foo "" leaveFoo Function leaveFoo ;do something FunctionEnd When I compiled the script, it zeroed this code out... Any idea why? Thanks, M.J.S |
|
|
|
|
|
#5 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Page custom Foo leaveFoo
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
Cool, thanks for the help. This works for me. I'm still a little unclear on how I would find the variable in which "back" is stored.
Thanks, Malathi |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
Just wonderinf if anyone has answers to the question that I posted...
Thanks. |
|
|
|
|
|
#8 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
You mean the text of the button? See the language file for the language string name.
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
Thanks for your response. I'm actually trying to get this to work for me...
Function customPage ; Do something to get R1. Not sure what exactly... StrCmp $R1 "back" _goback done _goback: Call Foo ;to go back to the previous custom page done: FunctionEnd Thanks Again, |
|
|
|
|
|
#10 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
If you want to stay on the current page use Abort in the leave function.
|
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
Nope. Want to go back to the previous screen. Foo actually reads in values from Foo.ini.
|
|
|
|
|
|
#12 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
You can also use Abort in the pre function to stay on the current page.
What exactly are you trying to do? When do you want to go back? |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
Function Bar LeaveBar
_start: ;If the user forgets to enter input goto _start FunctionEnd Function Foo _start: ;If the user forgets to enter input goto _start Function End Function LeaveBar ; If the user hit the back button( how do I know this?) Call Foo ;else goto _done _done: FunctionEnd Here Screen 1 inovolves Foo. We are on screen 2 (involving Bar) trying to hit back to get to Screen 1 again... If the goto _start is not present it works perfectly but this is not an option for me as I want to force the user to enter input. Thanks, Malathi |
|
|
|
|
|
#14 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
I don't really understand what you mean. Do you want to go back to page 1 when validating page 2? Why?
|
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
Nope. What I want to do is to go back to Page 1 whenever the user hits back even if all the entries for the required fields are blank. I'm able to accomplish this for cancel i.e irrespective of the state of the required fields, I'm able to cancel out of the installer by inserting a simple strcmp function. All I want is to do the same for back but I dont know how to get hold of the variable that is populated when the user hits back.
Thanks |
|
|
|
|
|
#16 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
The leave function is only called when the user clicks Next.
|
|
|
|
|
|
#17 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
Ahh..Any other options? All I want to do is
StrCmp $UserHitBack "Back" Call Page1 Problem is I dont know how I can get the variable that the installer stores the value of the back button in...Is it one of the register variables? Thanks |
|
|
|
|
|
#18 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Please explain exactly what feature you want. If a user clicks Back it will of course go the to previous page. What else do you want?
|
|
|
|
|
|
#19 |
|
Junior Member
Join Date: Apr 2004
Posts: 10
|
I think I have this figured out. Thanks for your help. Will let you know how it goes...
Basically, the problem stems from the loop that I'm using to force the user to enter input. Moving the loop to the leave function fixes it. Thanks, Malathi |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|