lyz
18th January 2006 19:07 UTC
How to hide a section programmatically
I am aware of how to hide a section at section declaration by using empty section name or a "." in front of the section name. But can I hide a section in a programmatic way?
I have tried to use SF_RO flag, but that only turns the section into read-only mode:
!insertmacro SetSectionFlag ${SEC_IDX} ${SF_RO}
Your help is greatly appreciated.
Afrow UK
18th January 2006 19:12 UTC
Best thing to do is put a - in front of the name to hide the section, and remove it to unhide the section again.
Good idea for a set of functions actually. Perhaps I'll write two soon (after I put some food in the oven!)
Edit: Ok that doesn't seem to work at all!
You'll just have to put your names in defines so that you can re-apply them when you want to unhide the section.
-Stu
Takhir
19th January 2006 07:03 UTC
SectionSetText ${SEC_2} ""
works for me.
DrDan
12th April 2007 15:59 UTC
So that is how to *hide* the section...
... but how do you ensure that section does not get executed during installation?
According to the documentation, paragraph 4.6.1.2
If section_name is empty, omitted, or begins with a -, then it is a hidden section and the user will not have the option of disabling it.
My experiments imply that this applies to sections whose names are altered programatically to the empty string "".
Is there a way to hide a section (depending on install type)
and make sure that it doesn't get executed?
Comm@nder21
12th April 2007 16:20 UTC
yes there is.
...
SectionSetText ${sec01} ""
...
Section "blabla" sec01
SectionGetText $0 ${sec01}
StrCmp $0 "" sec_end
...
sec_end:
SectionEnd
...
kichik
12th April 2007 18:01 UTC
Or simply unselect them programmatically with SectionSetFlags or the UnselectSection macro from Sections.nsh.