我怎么能在其他部分做一节?

时间:2015-08-19 11:09:57

标签: nsis

我想在其他部分做一个部分,我该怎么做呢?

Section  /o "Control System Toolbox"

     Section   "Communications Toolbox"
     SectionIn RO
FileWrite $9 "product=Control System Toolbox$\r$\n"
    AddSize 0
SectionEnd
FileWrite $9 "product=Control System Toolbox$\r$\n"
    AddSize 0
SectionEnd

1 个答案:

答案 0 :(得分:2)

您可以在部分组中组织部分。这些组不能执行代码,但您可以在其中放入隐藏的部分:

Page Components
Page InstFiles

SectionGroup /e "Main Component"

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

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

SectionGroupEnd

!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
${EndIf}
FunctionEnd