Rovastar
11th February 2003 01:46 UTC
Sections greyed out
MOre questions....
I am getting the hang of NSIS stuff now well maybe. :)
OK sections.
I understand a bit of teh section stuff but I cannot make it do what I want.
I want to grey out boxes and have hem set to unticked.
Most greyed out check boxes are for required components but I wanrt it to be grey out and unticked. It is preverse settings if the program is already installed. If the app has not been installed then I do not want the check box to be enabled.
Is this possible with NSIS?
djc
11th February 2003 03:29 UTC
Sure. It involves some "bit banging" and program logic on your part.
Have a look at the doco file "NSIS/Examples/one-section.nsi".
Also have a look at the functions SectionGetFlags/SectionSetFlags
kichik
11th February 2003 15:16 UTC
Set the section's style to SF_RO alone (no SF_SELECTED). To do this, you'll need SectionSetFlags as djc said. The exact code is:
SectionSetFlags
${section}${SF_RO}
SF_RO is defined in one-section.nsi among other places.
Joel
14th February 2003 21:21 UTC
so... what's the flag for autoselect the section but still, we
can uncheck it.... I try ALL the flags, but the autoselect
(Read only), can't be uncheck... :(
kichik
14th February 2003 22:22 UTC
Give it only SF_RO and no SF_SELECTED and it will be RO but not selected.
Rovastar
22nd February 2003 23:08 UTC
Thanks for the help folks but I am still none the wiser. :( I had already seen the set flags things.
I have only had chance to look at this recently.
now how does this work......
I have the simplest script I can think of and it still does not work. No checking nothing just the section options for the one example. It stil does not work. :(
I presume that a line like
SectionSetFlags "sec4" $SF_RO
should be put in the relevant section?? WEll if I put it outside teh section it does not compile (it equates SF_RO though). :(
But in the section it cannot equate what the constant/variable SF_RO is (WTF that doesn't make sense at all....:confused: ) so for this example I have used the actual decimal values. But nothing. :( It appears both selected AND not greyed out AND you can toggle it......
Am I doing something stupidly wrong or what?
The script.
-----
Name example
OutFile one-section.exe
ComponentText "please choose just one but the default"
!define SF_SELECTED 1
!define SF_SUBSEC 2
!define SF_SUBSECEND 4
!define SF_BOLD 8
!define SF_RO 16
!define SF_EXPAND 32
!define SECTION_OFF 0xFFFFFFFE
Section !Required
SectionIn RO
SectionEnd
;SectionSetFlags sec4 SF_RO
Section "optional #1" sec1
SectionEnd
Section "optional #2" sec2
SectionEnd
Section "optional #3" sec3
SectionEnd
Section "optional #4" sec4
;SectionSetFlags "sec4" $SF_RO
SectionSetFlags "sec4" 16
SectionEnd
;SectionSetFlags "sec4" $SF_RO
any ideas..
Rovastar
22nd February 2003 23:31 UTC
wait becoming clearer with the oninit function.... Aha can get it to grey things out.
Thanks folks.