Archive: SectionIn RO and SectionGroup


SectionIn RO and SectionGroup
Hi

I've got the following section/sectiongroup structure:

SectionGroup /e "Products"

Section "Product 1"
SectionIn RO
SectionEnd

Section "Product 2"
SectionIn RO
SectionEnd

SectionGroupEnd

This is purely for display purposes for the user, to indicate which applications are being installed. All the sections are readonly and selected, because I don't want the user to change them; so the corresponding checkboxes appears as selected but disabled - as I want.

However, the checkbox for the Products group is appearing as selected, but enabled (i.e. not greyed out). In spite of it being not greyed out, the user can't actually toggle the selection - nothing happens when you click on it.

What I want is for the Products check box is to appear disabled, just like the other checkboxes.
So it's currently got the required behaviour, but not the required appearance.

See the attached screenshot for what I'm trying to explain above.

Thanks,
Calum


Try this code in .onInit:


SectionGetFlags ${sgm} $8
IntOp $8 $8 | ${SF_RO}
SectionSetFlags ${sgm} $8

Where sgm is sectiongroup index:
SectionGroup /e "Products" sgm
Edit:
Or you can use this code

!insertmacro SetSectionFlag ${sgm} ${SF_RO}

And don't forget

!include Sections.nsh

Also remember to !include Sections.nsh too.

With Sections.nsh you could simply use:
SectionGroup /e "Products" secProducts
...
!insertmacro SetSectionFlag ${secProducts} ${SF_RO}

Note: I'm not sure if you can disable a SectionGroup check-box.

Edit: You should put the !insertmacro in the .onInit function.

-Stu


Excellent - that worked perfectly!

Thank you both.

Calum