Old 11th July 2003, 17:59   #1
fromcat2me
Junior Member
 
Join Date: Jul 2003
Posts: 6
programatically changing pages?

hey, new to this thread.

I'm making an installer whose first page (custom page using IO) replaces the "back" and "next" buttons. I want the "next" button to run some code and exit (this works). I want the "back" button to continue onto the next page. Is this possible?

One solution I though of (if you can't just jump around to different pages, which is what i hope i can do) is to put a dummy page before it (so it goes back to it) which sets a global var, so the next time through the func i can just return, but if i hit "back" it keeps going back and back and back (somehow the state isnt' getting cleared?)

so basically

Page custom dummy1 ""
Page custom dummy2 ""
Page custom realFunction

if user hits "back" in realFunction
and dummy1 and 2 do nothing
shouldn't it go

dummy1
dummy2
realFunction (back)
dummy2
realFunction

?

instead i get

dummy1
dummy2
realFunction (back)
dummy2
dummy1

any help appreciated
fromcat2me is offline   Reply With Quote
Old 11th July 2003, 18:10   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
There is a way to do this.
Have a dummy page before you're real page.

In you're dummy page put "Abort" in the main creation function.

In you're real page use this:

Function MyDialog
InstallOptions::dialog "mydialog.ini"
Pop $R0
StrCmp $R0 "success" exit ;next
StrCmp $R0 "back" back ;back
StrCmp $R0 "cancel" exit ;back

back:
### Add you're function/script here ###

exit:
FunctionEnd

-Stu
Afrow UK is offline   Reply With Quote
Old 11th July 2003, 18:16   #3
fromcat2me
Junior Member
 
Join Date: Jul 2003
Posts: 6
I would do this, but what i want the "back" button to do is continue with the other pages in the installer. I can't seem to get rid of the fact that "back" was hit.

the structure i was thinking (similar) was

Page custom blankFunc
Page custom MyCustomFunc
Page components
Page directory
Page instfiles

where MyCustomFunc should have

InstallOptions::dialog test.ini
Pop $R1

StrCmp $R1 "back" "endLabel" "quitLabel"

quitLabel:
; do some stuff
Quit

endLabel: ; continue onto Page components
Function End


but, this doesn't continue at all, it goes back to the blankFunc page, and after blankFunc gets called it'll try and go to the page before that!
fromcat2me is offline   Reply With Quote
Old 12th July 2003, 02:21   #4
Brummelchen
Major Dude
 
Join Date: May 2003
Posts: 681
does this help?
http://forums.winamp.com/showthread....hreadid=141102

Greets, Brummelchen
Brummelchen is offline   Reply With Quote
Old 12th July 2003, 10:50   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Ah ok.
I have another idea.
Do this:
code:

Page custom blankFunc "" " - A blank page!"
Page custom MyCustomFunc "" " - My title"

Function blankFunc
FunctionEnd

Function MyCustomFunc
InstallOptions::dialog "mydialog.ini"
Pop $R0
StrCmp $R0 "success" success ;next
StrCmp $R0 "back" back ;back
StrCmp $R0 "cancel" exit ;back

success:
### Add you're function/script here ###
Goto exit

back:
Abort

exit:
FunctionEnd



The should work...

-Stu
Afrow UK is offline   Reply With Quote
Old 12th July 2003, 13:07   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Lacking a better idea, let the hacking begin. See attached script.
Attached Files
File Type: nsi bla2.nsi (546 Bytes, 163 views)

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