Adds a callback function .onInstTypeChange, analogous to .onSelChange/.onMouseOverSection.
I needed this to fulfill a customer requirement to have a description for each installation type, and figured it would be useful to others as well.
Note: The implementation sticks the current insttype in $0; this is because I couldn't get GetCurInstType to report the custom type properly in the callback (GetCurInstType would return the id of the previously selected insttype instead of NSIS_MAX_INST_TYPES when custom was selected).
Adds .onInstTypeChange callback
Logged In: YES
user_id=584402
Originator: NO
Thanks for your patch.
.onSelChange is called when the installation type is changed. You can then get the current selection of the combo box. You could also use GetCurInstType, but as you said, that won't report Custom, because its report is based on the sections' selection and not the combo box.
It seems to me that the following code acts almost like .onInstTypeChange. The only difference I see, is that when custom is selected, you'll get last_insttype_index + 1 instead of NSIS_MAX_INST_TYPES. Am I missing something, or is this really the case?
!include WinMessages.nsh
Function .onSelChange
FindWindow $2 "#32770" "" $HWNDPARENT
GetDlgItem $0 $2 1017
SendMessage $0 ${CB_GETCURSEL} "" "" $1
GetDlgItem $0 $2 1006
SendMessage $0 ${WM_SETTEXT} "" "STR:$1"
FunctionEnd
Logged In: YES
user_id=1707163
Originator: YES
I didn't even consider that, but of course it works!
Maybe add a comment to the .onSelChange documentation that it is also called when the installation type changes?
Logged In: YES
user_id=584402
Originator: NO
Sure thing. Added. Thanks.