In my installer I have 2 options displayed as radio button. Update and Install. I want update option is selected by default. What option should I use with NSD_CreateRadioButton so that update is selected by default? Now, none is selected in my case.
${NSD_CreateRadioButton} 30% 50% 100% 20 "Install"
pop $1
${IfThen} $InstallType == INSTALL ${|} ${NSD_Check} $1 ${|}
${NSD_CreateRadioButton} 30% 60% 100% 20 "Update"
pop $2
You are on the right track, you just need to simulate a click on the radio-button that you want to be the default:
!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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With