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?
Sections greyed out
7 posts
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
Have a look at the doco file "NSIS/Examples/one-section.nsi".
Also have a look at the functions SectionGetFlags/SectionSetFlags
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.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... 🙁
can uncheck it.... I try ALL the flags, but the autoselect
(Read only), can't be uncheck... 🙁
Give it only SF_RO and no SF_SELECTED and it will be RO but not selected.
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....😕 ) 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..
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....😕 ) 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..
wait becoming clearer with the oninit function.... Aha can get it to grey things out.
Thanks folks.
Thanks folks.