Archive: SectionFlags Q


SectionFlags Q
Trying this code:


Function BuscarArch
Pop $9
ifFileExists $SYSDIR\$9 NoEsta
MessageBox MB_OK|MB_ICONEXCLAMATION "Can't find $9, it will be downloaded."
SectionSetFlags down0 5
NoEsta:
FunctionEnd

Function .onInit
Push ${MSVBVM60}.dll
Call BuscarArch
FunctionEnd

Section "GetWEBFile" down0
...
SectionEnd


It suppost to, if the file doesn't exists, autoselect the section,
but is not working, any ideas?

Thanks :D

As down0 can only be used after it is defined you should put that function after the section. It should also be ${down0} in SectionSetFlags instead of down0.


Works fine... :D


works fine, I know:
SectionSetFlags ${var} flag

where flag:
1.- Enabled
2.- subsection
3.- subsection end
4.- bold or not
5.- section is read-only
6.- subsection automatically expanded

is there a flag for autoselect the section?


Not exactly. The numbers you mentioned are the serial numbers of the bits in the flags integer. The right numbers are 1, 2, 4, 8, 16, 32.


yeap, that was my problem, thanks dude :thumbsup:


Is it possible to set flags for hidden sections?
---
Thanks


Yes.


OK, this is what my situation is:
I have a hidden section (name starting with "-") that I initially need to be disabled. I try to do this in the .onInit like this:

SectionGetFlags ${Hidden} $0
IntOp $0 $0 & ${SECTION_OFF} ;0xFFFFFFFE
SectionSetFlags ${Hidden} $0

Later, depending upon user input, I may turn it on like this:

SectionGetFlags ${Hidden} $0
IntOp $0 $0 | ${SF_SELECTED} ;1
SectionSetFlags ${Hidden} $0

However, the install page seems to ignore this flag altogether and always executes the section whether it is off or not.
Any suggestions?
---
Thanks


*bump*

Any suggestions?
---
Thanks


Download the latest CVS and read the new one-section.nsi

you now may include in the script a macro like this:


!insertmacro UnselectSection ${Hidden}
!insertmacro SelectSection ${Hidden}

If you have installation types (InstType) then when you get to the component selection page the sections, including hidden sections, will be selected according to the installation type. To get around this you'll have to set the selected state of the hidden section in every call to .onSelChange.

If this is not the case then ensure you are using the latest version of NSIS, and if it doesn't work with that either attach the script.