Archive: if Section = enabled?


if Section = enabled?
is there any way to check whether a section has been checked or not?

right now I am creating a file and doing an IfFileExists.. but that is not very effective.

I have skimmed through the documentation but didn't see anything, and I really don't have time to read the entire thing.


!define SF_SELECTED 1

Function myfunc
SectionGetFlags ${secid} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} 0 +2
MessageBox MB_OK "Is selected!"
FunctionEnd

That should work.
secid is set like so: Section "section name" secid

-Stu


erm, I didn't get all that so well...

I'll explain more closely:

Section "test"

SetOutPath "$INSTDIR"

File "test.exe"

SectionEnd

Section "test2"

; this is where I have problems
if Section test = enabled "" +2
createshortcut blablabla...

SectionEnd

this of course does not work, but I think you at least get the point


!define SF_SELECTED 1
Section "test" sectest
SetOutPath "$INSTDIR"
File "test.exe"
SectionEnd

Section "test2"
SectionGetFlags ${sectest} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} 0 +2
createshortcut blablabla...
SectionEnd

-Stu


thank you.