How to make a SectionGroup mandatory in NSIS script

廉价感情. 提交于 2020-01-05 07:10:23

问题


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 enabled 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?


回答1:


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


来源:https://stackoverflow.com/questions/2092724/how-to-make-a-sectiongroup-mandatory-in-nsis-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!