在我的安装程序中,我有 2 个选项显示为单选按钮。更新和安装。我希望默认选择更新选项。我应该将哪个选项与 NSD_CreateRadioButton 一起使用,以便默认选择更新?现在,在我的案例中没有选择。
${NSD_CreateRadioButton} 30% 50% 100% 20 "Install"
pop $1
${IfThen} $InstallType == INSTALL ${|} ${NSD_Check} $1 ${|}
${NSD_CreateRadioButton} 30% 60% 100% 20 "Update"
pop $2
最佳答案
你在正确的轨道上,你只需要模拟点击你想成为默认的单选按钮:
!include nsDialogs.nsh
Page Custom MyPageCreate
Page InstFiles
Function MyPageCreate
nsDialogs::Create 1018
Pop $0
${NSD_CreateRadioButton} 30% 50% 100% 20 "Install"
pop $1
${NSD_CreateRadioButton} 30% 60% 100% 20 "Update"
pop $2
${If} $InstallType == INSTALL
${NSD_Check} $1 ; Select Install radio
${Else}
${NSD_Check} $2 ; Select Update radio
${EndIf}
nsDialogs::Show
FunctionEnd
关于nsis - NSIS 脚本中的默认单选按钮选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36583058/