sidkolia
11th September 2003 15:49 UTC
installoptions - how to choose pages
Hi,
I'm new to NSIS and I'm trying to find som info on how to use installoptions properly.
My situation is that I hvae a custom page with three radiobuttons and
depending of choice I want to display another page. i haven't found a way to just show the page I want, it seems that all three pages are displayed and I'm not allowed to call the page command in a section...
Grateful for any tips on how it should work.
/Stefan
Joost Verburg
11th September 2003 17:22 UTC
You can read the state of the buttons from the INI file. For details, see the InstallOptions / Modern UI documentation. There have are also several topics in the forum about this subject.
sidkolia
15th September 2003 08:45 UTC
Hi again,
Yes I've seen the documentation about how to read the button state.
What I haven't found is what actually displays the pages?
As I understand it every page to be displayed must be in the "page" section. That is also the order for how the pages are displayed.
Could any one show me a small example of how to display a page only if a certain radiobutton is checked.
Thanks!
Joost Verburg
15th September 2003 10:20 UTC
Just add another custom page and read the value of the previous page before calling InstallOptions. You can use Abort to skip the page.
n0On3
16th September 2003 02:58 UTC
I think that this is more or less what you want:
Page Custom General "" ": User Options"
>Page Custom General2 "" ": User2 Options"
>Function General
File/oname=$PLUGINSDIR1.ini "1.ini"
InstallOptions::dialog "$PLUGINSDIR\\1.ini"
>FunctionEnd
>Function General2
ReadINIStr $R5 "$PLUGINSDIR\\1.ini" "Field 4" "State"
StrCmp $R5 1 "" "Cont"
Abort
Cont:
File /oname=$PLUGINSDIR2.ini "2.ini"
InstallOptions::dialog "$PLUGINSDIR\\2.ini"
>FunctionEnd
>
When the checkmark in field 4 from 1.ini is checked the second page won't be shown.