Archive: programatically changing pages?


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


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


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!


does this help?
http://forums.winamp.com/showthread....hreadid=141102


Ah ok.
I have another idea.
Do this:


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

Lacking a better idea, let the hacking begin. See attached script.