Archive: Please - Need help debugging this code that plays with sections


Please - Need help debugging this code that plays with sections
Please could someone look at this code and tell me why the tree structure comes undone.

This is an excerpt of a very large script and I need it to work this way as it is part of an installation - step by step wizard.

I have attached a sample script.

Requirements:
The options must be deselected by default
The options must be hidden by default

Depending on certain conditions these options will be enabled.

In short need to apply the filter as seen in the script.:igor:


It's a known issue. You can't hide a subsection without ruining the tree unless you hide the subsection closure too. Get the id of the last section in the subsection, add 1 (using IntOp), set its name to "" and remove the SF_SUBSEC flag from it.

We intend to make NSIS automatically hide subsections if they're emtpy. It's on the TODO.


Could you give me an example as I am not sure what you are getting at.

:)


SubSection bla
Section blue SecID
SectionEnd
SubSectionEnd

...

IntOp $0 ${SecID} + 1
SectionSetText $0 ""
SectionSetFlags $0 0


Hi Kichik,

I am trying to make sense of the example. Please excuse me if I appear to be extremely thick.

Could you please use the example I posted with your proposed changes, so that I can see how it would be implemented. I do not quite get the current example given. It would be appreciated.


blue is the last section in the subsection bla. Therefore we take its section ID, add one and get the ID of the closing section. That section we hide too.

I won't apply that to your example, it's huge.


Thanks,
Kichik.

I have included an updated script for newbies like myself that have battled with this a working example.



:cool: