当一个盒子被检查时,我想让另一个成为chek

when a box is checked I want to another one to be chek

我有下两节

Section /o "Communications Toolbox"
    ;SectionIn RO
FileWrite  "product=Communications Toolbox$\r$\n"
    AddSize 0
SectionEnd


Section  /o "Control System Toolbox"
    ;SectionIn RO
FileWrite  "product=Control System Toolbox$\r$\n"
    AddSize 0
SectionEnd

并且在安装过程中,当用户选中第二个时"Control System Toolbox",自动第一个"Communications Toolbox"我想被选中,然后在那个时刻显示一条消息“到安装 Control System Toolbox 您还需要安装 "Communications Toolbox"。 我该怎么做?

我试图在 "Control System Toolbox" 中放置一个文本框:

Section  /o "Control System Toolbox"
     MessageBox MB_OK "Do you want to stay in the license page?" IDOK 
     Abort  
FileWrite  "product=Control System Toolbox$\r$\n"
    AddSize 0
SectionEnd

我不明白为什么我按下OK按钮后,没有翻到上一页??

有两种处理方法:

A)在组件页面上执行要求:

Page Components
Page InstFiles

Section /o "Main Component" SID_MAIN
DetailPrint "Installing Main Component..."
SectionEnd

Section /o "Bonus feature" SID_BONUS
DetailPrint "Installing bonus Component..."
SectionEnd

!include Sections.nsh
!include LogicLib.nsh
Function .OnSelChange
${If} ${SectionIsSelected} ${SID_BONUS}
    !insertmacro SelectSection ${SID_MAIN} ; The main component is required when installing the bonus component
    !insertmacro SetSectionFlag ${SID_MAIN} ${SF_RO}
${Else}
    !insertmacro ClearSectionFlag ${SID_MAIN} ${SF_RO}
${EndIf}
FunctionEnd

您还可以在其他问题中使用 等部分组。

B) 在安装阶段使用 MessageBox(部分代码在 InstFiles 页面上执行)并在需要时强制安装组件:

Page Components
Page InstFiles

Section "" ; Hidden section
Call EnsureRequiredSections ; We have to call a function because SID_MAIN has not been defined yet
SectionEnd

Section "Main Component" SID_MAIN
DetailPrint "Installing Main Component..."
SectionEnd

Section /o "Bonus feature" SID_BONUS
DetailPrint "Installing bonus Component..."
SectionEnd

!include Sections.nsh
!include LogicLib.nsh
Function EnsureRequiredSections
${If} ${SectionIsSelected} ${SID_BONUS}
${AndIfNot} ${SectionIsSelected} ${SID_MAIN}
    MessageBox MB_YESNO|MB_ICONQUESTION "Main Component is required when installing the Bonus feature, do you want to install both?" IDNO no
    !insertmacro SelectSection ${SID_MAIN}
    Goto done
    no:
    !insertmacro UnSelectSection ${SID_BONUS}
    done:
${EndIf}
FunctionEnd