开发者

How to make a SectionGroup mandatory in NSIS script

In an NSIS MUI script it is possible to make a section compulsory by adding "SectionIn RO" to the section. I would like to specify that the entire SectionGroup is compulsory. I know I can make each of the individual components compulsory which makes the group compulsory by default, but the SectionGroup checkbox is still enabl开发者_开发百科ed indicating that the user can turn it off. This could be confusing.

Is there an equivilent to "SectionIn RO" for SectionGroups and thus force the group's checkbox to be disabled?


I would say this is a NSIS bug. (If you decide to report this on the project tracker, you can reference this bug, it should have been fixed as part of that bug)

Forcing the readonly flag seems to work:

SectionGroup /e foo SecFoo
Section bar
SectionIn RO
SectionEnd
Section baz
SectionIn RO
SectionEnd
SectionGroupEnd

page components "" ForceHackyRO
page InstFiles



!include Sections.nsh

Function ForceHackyRO
!insertmacro SetSectionFlag ${SecFoo} ${SF_RO}
FunctionEnd
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜