Old 25th October 2013, 07:22   #1
marcins
Junior Member
 
Join Date: Aug 2011
Posts: 30
Navigate custom pages

I'm writing installer but it needs to have a few custom pages that are showing when specified radio buttons is selected on components page.

I was trying to "call" my function with custom page from specific section that is selected but then whole installer is suspending but I need to kill him from task mgr.

I can try to put custom pages to show in specific order at the beginning of my script, but I'll have all pages even those I don't want to show. But maybe I can navigate them. Maybe it's possible to do something in specific section like when radiobutton 1 is selected then in section 1 of my installer I can put command like page = page + 2 or something like this?

Thanks for help!
marcins is offline   Reply With Quote
Old 25th October 2013, 09:25   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You cannot call page functions from a section - sections are all executed inside the INSTFILES page.

You can simply add the optional page normally, then in its prefunction call 'abort' to skip it.
MSG is offline   Reply With Quote
Old 25th October 2013, 09:31   #3
marcins
Junior Member
 
Join Date: Aug 2011
Posts: 30
it's something like if radiobutton selected page abort?

can you past here sample code?
marcins is offline   Reply With Quote
Old 25th October 2013, 10:47   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
function YourPagePre
${If} ${SectionIsSelected} ${YourSection}
abort
${EndIf}
functionend
MSG is offline   Reply With Quote
Old 28th October 2013, 12:46   #5
marcins
Junior Member
 
Join Date: Aug 2011
Posts: 30
Thanks but I can't get it to work...

I have something like that:

code:
Function MyCustomPage
${If} ${SectionIsSelected} ${sec1}
Abort
${EndIf}
FunctionEnd

Section "statistics / v. lokalna" sec1
SectionEnd

Section /o "statistics / v. sieciowa" sec2
SectionEnd

Function .onSelChange
SectionSetSize ${sec1} 1289000
SectionSetSize ${sec2} 1299000

!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${sec1}
!insertmacro RadioButton ${sec2}
!insertmacro EndRadioButtons
FunctionEnd



and it looks like it's not working for me :- (

Can you help, please?
marcins is offline   Reply With Quote
Old 29th October 2013, 09:02   #6
marcins
Junior Member
 
Join Date: Aug 2011
Posts: 30
I have changed it a bit and now it looks like...

code:
Function IP_ADDRESS
${If} ${SectionIsSelected} ${sec2}
MessageBox MB_OK "IP: NETWORK"
${Else}
MessageBox MB_OK "IP: LOCAL"
Abort
${EndIf}
FunctionEnd

Section "local" sec1
SectionEnd

Section /o "network" sec2
SectionEnd

Function .onSelChange
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${sec1}
!insertmacro RadioButton ${sec2}
!insertmacro EndRadioButtons
FunctionEnd



It looks like for NSIS section ${sec2} is always selected. Help please! :-(
marcins is offline   Reply With Quote
Old 29th October 2013, 09:31   #7
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
http://forums.winamp.com/showthread.php?t=345049
jpderuiter is offline   Reply With Quote
Old 29th October 2013, 10:12   #8
marcins
Junior Member
 
Join Date: Aug 2011
Posts: 30
great! it's working as it should!
thank you!
marcins is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
pages navigate

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