- NSIS Discussion
- Section devision
Archive: Section devision
mmleyr
23rd June 2007 14:55 UTC
Section devision
And once again - hello. =)
Got another question. I need during the installation to ask user about different parameters. It's done but now i need to separate each selection.
Please look at the gif that is attached.
It's realized now. And i need it the installator to ask about each selection on separate page. How can i do it?
Thx.
Best regards.
Afrow UK
23rd June 2007 18:53 UTC
Please elaborate more.
Stu
mmleyr
25th June 2007 07:15 UTC
ok.
At the moment i've made all selections at one window (as shown in GIF)
There you see Math coprocessor and MLX4 code selection in one window. And i need those selections to be done consecutive i.e. First user selects Math coprocessor, then pushes Next> and then chooses MLX4 and so on.
I hope you understand me.
P.S. Oh, and one more question. It would be pretty nice if i could replace the checkboxes by radiobuttons. How can it be done.
Many thanks.
Best regards.
Afrow UK
25th June 2007 10:46 UTC
Oh I see. This may be exactly what you need.
http://nsis.sourceforge.net/Two_inst..._one_installer
Edit: The check bitmaps are in Contrib\Graphics\Checks.
To set the check bitmap use !define MUI_COMPONENTSPAGE_CHECKBITMAP bitmap_file.
Stu
mmleyr
25th June 2007 11:49 UTC
2 Afrow UK
Erm. Nope, thats not what i need.
Math coprocessor and MLX4 code selection are made to modify the file. It's not the different installers. In dependence of 1-t option or 2-d option is selected, the installer writes different info in variable from where it is written into a file. Clumsy explanation.. :(
At this time i have the code like (the result you can see at GIF):
Function .onSelChange
!insertmacro StartRadioButtons $RevS
!insertmacro RadioButton ${Rev1}
!insertmacro RadioButton ${Rev2}
!insertmacro EndRadioButtons
!insertmacro StartRadioButtons $MathCoS
!insertmacro RadioButton ${MathCo1}
!insertmacro RadioButton ${MathCo2}
!insertmacro EndRadioButtons
!insertmacro StartRadioButtons $CoprS
!insertmacro RadioButton ${Copr1}
!insertmacro RadioButton ${Copr2}
!insertmacro EndRadioButtons
..................
FunctionEnd
And it's needed to be done not on one page but on different.
Like i said.
At first page you choose Rev1 or Rev2
Next>
At second page you choose MathCo1 or MathCo3
Next>
At third page you choose Copr1 or Copr2.
I hope you'll understand me now. :rolleyes:
PS About NSIS\Contrib\Graphics\Checks - yep they are here but i have one stupid question: where can i get the image of radiobuttons cause i have there only checkboxes stored. :hang:
Afrow UK
25th June 2007 12:13 UTC
You have to make your own check bitmap of course!
Have multiple components pages and before showing the first page, hide the last 4 sections (by settings the section text to ""). Before showing the second page, hide the first 2 and the last 2 sections. Finally for the last page hide the first 4 sections.
To show sections again you need to set their section text back.
Stu
mmleyr
25th June 2007 12:38 UTC
Am i stupid? 0_o
Afrow UK, i don't understand what you've said. =))
Any example? ;)
Thx
PS Can i manage the size of window in which selection is (i.e. enlarge it's width?)
Best regards.
Afrow UK
25th June 2007 12:48 UTC
Like this:
!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPage1Pre
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPage2Pre
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPage3Pre
!insertmacro MUI_PAGE_COMPONENTS
... LANGUAGES ...
Section "" Rev1
SectionEnd
Section "" Rev2
SectionEnd
Section "" MathCo1
SectionEnd
Section "" MathCo2
SectionEnd
Section "" Copr1
SectionEnd
Section "" Copr2
SectionEnd
Function ComponentsPage1Pre
SectionSetText ${Rev1} "Rev1"
SectionSetText ${Rev2} "Rev2"
SectionSetText ${MathCo1} ""
SectionSetText ${MathCo2} ""
SectionSetText ${Copr1} ""
SectionSetText ${Copr2} ""
FunctionEnd
Function ComponentsPage2Pre
SectionSetText ${Rev1} ""
SectionSetText ${Rev2} ""
SectionSetText ${MathCo1} "MathCo1"
SectionSetText ${MathCo2} "MathCo2"
SectionSetText ${Copr1} ""
SectionSetText ${Copr2} ""
FunctionEnd
Function ComponentsPage3Pre
SectionSetText ${Rev1} ""
SectionSetText ${Rev2} ""
SectionSetText ${MathCo1} ""
SectionSetText ${MathCo2} ""
SectionSetText ${Copr1} "Copr1"
SectionSetText ${Copr2} "Copr2"
FunctionEnd
Stu
mmleyr
25th June 2007 14:31 UTC
:( Damn. I'm realy stupid. :((
Afrow UK, if it wont trouble you much - can you take a look at that piece of code i've attached, please. And tell me where is mistake there....
Many thx.
Afrow UK
25th June 2007 15:32 UTC
You forgot to put {} (curly braces) when setting the section group texts.
E.g.
SectionSetText $REV_GRP ""
->
SectionSetText ${REV_GRP} ""
Stu
Afrow UK
25th June 2007 15:36 UTC
Another problem is you haven't set any sections to visible on your first page (DUH!)
Also, you could cut down on script and installer overhead by just hiding the previously visible sections:
Function ComponentsPage1Pre
SectionSetText ${REV_GRP} "blah1"
SectionSetText ${Rev1} "b"
SectionSetText ${Rev2} "b"
FunctionEnd
Function ComponentsPage2Pre
SectionSetText ${REV_GRP} ""
SectionSetText ${Rev1} ""
SectionSetText ${Rev2} ""
SectionSetText ${MATHCO_GRP} "blah2"
SectionSetText ${MathCo1} "b"
SectionSetText ${MathCo2} "b"
FunctionEnd
Function ComponentsPage3Pre
SectionSetText ${MATHCO_GRP} ""
SectionSetText ${MathCo1} ""
SectionSetText ${MathCo2} ""
SectionSetText $COPR_GRP "blah3"
SectionSetText ${Copr1} "b"
SectionSetText ${Copr2} "b"
FunctionEnd
Just make sure that all your sections and section groups have no texts initially.
Stu
mmleyr
25th June 2007 16:01 UTC
2 Afrow UK
about
E.g.
SectionSetText $REV_GRP ""
->
SectionSetText ${REV_GRP} ""
with those braces it didn't work... strange. Need to try again... 0_o
About cutting the script - yep, i'll do it. :)
Ok i'll try.
Thanks. I appreciate your help. ;)
Afrow UK
25th June 2007 17:00 UTC
You'll have to remove the SectionGroups then because they don't become hidden like normal sections when setting the text to empty. Besides, you don't really need them if you have multiple components pages.
Stu
mmleyr
26th June 2007 08:22 UTC
Finaly it woks. =))
One more question :
To make section's text bold you need to put ! before it's name but in SectionSetText ${Copr1} "b" it doesn't work. :( It's just displayed as !b. How can i make this text bold?
Afrow UK, many thanks for the help. c(_)
mmleyr
26th June 2007 12:11 UTC
Nevermind about the last post. Found the answer here http://forums.winamp.com/showthread....ight=bold+text