Archive: Dynamic choice in RadioButton


Dynamic choice in RadioButton
I'm using Modern UI

There are two RadioButtons and one FileRequest.
First RadioButton (Default) - Install new database
Second RadioButton - Select existing database
FileRequest assign with Second RadioButton.
How I can after select of file in FileRequest - enable Second RadioButton and disable First RadioButton?

Thank you


Check the InstallOptions documentation for the NOTIFY flag.


First you need to use "NOTIFY" flag in both radiobuttons (in the .INI file).

Second, see the example to how to create a basic code in the .nsi file in "Contrib\InstallOptions" subfolder of NSIS.

Third, if you mean "disable a control" use EnableWindow command to enable-disable any control when is selected a radiobutton.


Thank you for your answers.

Sorry, I mean select Second RadioButton and unselect First RadioButton.

Where can I find of documentation about "NOTIFY" flag and EnableWindow command?

In the .nsi file in "Contrib\InstallOptions" subfolder of NSIS not enough information.

Thank you


Information about NOTIFY can be found in the InstallOptions documentation, it calls the leave function when the control is changed.

EnableWindow is a NSIS command (use it in the leave function), for more information see the NSIS Users Manual.


Sorry, but there is no information about "NOTIFY" flag into InstallOptions documentation in NSIS20b3 and NSIS20b4.

How I can declare leave function in my installation module?

Please, write example of using "NOTYFY" flag and leave function.

Thank you


You should get the latest version, it's a new feature.


I copied of version NSIS20b4 January, 13 2004

What latest version?

Thank you


Thank you, I copied NSIS20rc2.

EnableWindow not approach.

I need to select (State=1) Second RadioButton but not disable.

Say me please, how to do it?

Thank you


NSIS20RC2


See the testnotify.nsi in Contrib\InstallOptions.


In testnotify.nsi in Contrib\InstallOptions there is no information about checking of RadioButton.

Next code not work:

FindWindow $hwnd "#32770" "" $HWNDPARENT
GetDlgItem ${TEMP} $hwnd 1202 ; 1202 - Second RadioButton
SendMessage ${TEMP} BM_SETCHECK BST_CHECKED 0
; and SendMessage $hwnd BM_SETCHECK BST_CHECKED 0

How I can check Second RadioButton?

Thank you


You should defines for the window messages, like ${WM_SETTEXT}. For more of them see WinMessages.nsh.


Thank you A LOT.

All works is excellent !!!