-2

我是 NSIS 的新手。我需要一些有关 MUI 组件页面的帮助。我在部分组内添加 3 个部分组和不同部分。我需要根据用户选择执行不同的操作。用户可以选择多个选项。所以任何人都可以帮我提供一个示例代码,它有超过 3 个部分并验证用户对这些选项的选择,并基于显示不同的消息框

4

1 回答 1

2

我不清楚你的真正目标是什么,但检查部分状态可以这样完成:

!include LogicLib.nsh

page components
page instfiles

SectionGroup /e "Group 1"
Section "G1S1" SEC_G1S1
SectionEnd
Section /o "G1S2" SEC_G1S2
SectionEnd
SectionGroupEnd

SectionGroup /e "Group 2"
Section /o "G2S1" SEC_G2S1
SectionEnd
Section "G2S2" SEC_G2S2
SectionEnd
SectionGroupEnd

Section -Hidden
${If} ${SectionIsSelected} ${SEC_G1S1}
    MessageBox mb_ok "G1S1 is selected"
${EndIf}
${If} ${SectionIsSelected} ${SEC_G1S2}
    MessageBox mb_ok "G1S2 is selected"
${EndIf}
# Check the other sections here ...
SectionEnd
于 2012-01-17T20:16:00.160 回答