- NSIS Discussion
- SectionFlags Q
Archive: SectionFlags Q
Joel
11th February 2003 21:20 UTC
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
kichik
12th February 2003 14:08 UTC
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.
Joel
12th February 2003 19:29 UTC
Works fine... :D
Joel
12th February 2003 19:50 UTC
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?
kichik
13th February 2003 09:07 UTC
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.
Joel
13th February 2003 19:44 UTC
yeap, that was my problem, thanks dude :thumbsup:
iceman_k
21st February 2003 05:06 UTC
Is it possible to set flags for hidden sections?
---
Thanks
kichik
21st February 2003 09:21 UTC
Yes.
iceman_k
21st February 2003 15:35 UTC
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
iceman_k
23rd February 2003 05:18 UTC
*bump*
Any suggestions?
---
Thanks
Joel
23rd February 2003 16:45 UTC
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}
kichik
23rd February 2003 16:49 UTC
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.