Skip to content
⌘ NSIS Forum Archive

Section devision

15 posts

mmleyr#

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.

Attachments

mmleyr#
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#
Oh I see. This may be exactly what you need.


Edit: The check bitmaps are in Contrib\Graphics\Checks.
To set the check bitmap use !define MUI_COMPONENTSPAGE_CHECKBITMAP bitmap_file.

Stu
mmleyr#
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. 🙄

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. 😔
Afrow UK#
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#
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#
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#
🙁 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.

Attachments

  • m.nsi(25.3 KB, 231 views)
  • m.nsi(25.3 KB, 231 views)
Afrow UK#
You forgot to put {} (curly braces) when setting the section group texts.

E.g.
SectionSetText $REV_GRP ""
->
SectionSetText ${REV_GRP} ""

Stu
Afrow UK#
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#
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#
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#
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#
Nevermind about the last post. Found the answer here http://forums.winamp.com/showthread....ight=bold+text