本文介绍了如何在 NSIS 脚本中强制使用 SectionGroup的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 NSIS MUI 脚本中,可以通过将SectionIn RO"添加到该部分来强制执行该部分.我想指定整个 SectionGroup 是强制性的.我知道我可以强制每个单独的组件,这使得默认情况下该组是强制的,但是 SectionGroup 复选框仍处于启用状态,表明用户可以将其关闭.这可能会令人困惑.

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.

是否有与SectionIn RO"等效的 SectionGroups,从而强制禁用组的复选框?

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

推荐答案

我会说这是一个 NSIS 错误.(如果您决定在项目跟踪器上报告此问题,您可以参考 这个错误,它应该作为那个错误的一部分被修复)

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

这篇关于如何在 NSIS 脚本中强制使用 SectionGroup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 06:20