Archive: Managing Sections depending on License Feature


Managing Sections depending on License Feature
Hi all,

i have a Setup that is supposed to react to features that are extracted out of a license file.

I will get back a string like "Feature1,Feature2,Feature4,Feature5" for all valid features.

I disable all(!) Sections and SectionGroups using SectionSetFlags.

Now i check for the single Features using ${Wordfind} and if a feature exists i (re)enable certain sections.

There are quite a few sections (roughly 30) and i am looking for an easier way to manage that stuff since i have to enable some sections twice (e.g. once for Feature1 and once for Feature3)

Has anyone done something like that before and would like to share knowledge?

I have attached the part of the script that i am talking about.

Thanks for your help.


could you loop over the sections, grab their text, and compare the text to a featureset variable that is based on the features enabled?


Function Test
StrCpy $0 0
_loop:
ClearErrors
SectionGetText $0 $1
${If} ${Errors}
goto _done
${Else}
MessageBox MB_OK "[$1]"
${EndIf}
IntOp $0 $0 + 1
goto _loop
_done:
FunctionEnd


( you might be able to abuse the section flags as well as there's quite a few bits unused )


Alternatively, perhaps you could use InstTypes with SectionIn? ( though I think that adds an installation type drop-down above the components which you would subsequently have to hide from the user )



Mind you, limiting installation features based on a 'license' like this is pretty poor protection unless used in conjunction with other functionality to prevent the user from e.g. simply extracting the files (if only file extraction would be needed).

Mind you, limiting installation features based on a 'license' like this is pretty poor protection unless used in conjunction with other functionality to prevent the user from e.g. simply extracting the files (if only file extraction would be needed).
I know, but it was (luckily) not my decision to do it that way, sadly i have to implement it :(

well, I hope the method above might be of use, then - it would provided fully automated handling of section enabled/disabled states, without having to adjust a separate section of code each time you add/remove a section to the list/etc.