NSIS 自动显示组件

!include "UsefulLib.nsh"
Name TestSelectSection
OutFile "TestSelectSection.exe"

Page components
Page instfiles
ShowInstDetails show

Section "01" SEC01
SectionEnd

Section "02" SEC02
SectionEnd

Section "03" SEC03
SectionEnd

Section "04" SEC04
SectionEnd

Function .onInit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB920213" "NoModify"
${if} $0 == 1 ;数值等于1,不显示SEC01组件
 !insertmacro SetSectionFlag ${Sec01} ${SF_RO}
 !insertmacro UnselectSection ${Sec01}
 SectionSetText ${Sec01} ""
${endif}
FunctionEnd
© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容