Archive: Need help: change label for "Close" button dynamically


Need help: change label for "Close" button dynamically
I wrote an installer which has 3 sections - one default section and two optional sections.
I want to change the label of "Close" button, which appears after the installation completes successfully,
to "Continue" if a certain optional section is selected.
(Meaning continuing to another installation procedure in
a web-page.)

I tried to modify the label in "Leave" custom page function. The label changes to whatever string I gave, but it instantly changes back to "Close" after returning from my custom page function.

Here's some of my installer code.
---------
[...]
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE OnFinishInst
!insertmacro MUI_PAGE_INSTFILES

[...]
Function OnFinishInst
GetDlgItem $R0 $HWNDPARENT 1
SendMessage $R0 ${WM_SETTEXT} 0 "STR:Continue"
FunctionEnd
---------
Any comment will be appreciated, thanks.


Set the close button text to a variable using MiscButtonText and change that variable.


Thanks!
Thanks a lot for nice & clean solution, kichik :)

I didn't realize that giving a variable to a command like MiscButtonText and then changing the value of the variable later has the effect of calling MiscButtonText with different (constant) values.

Does this apply to other commands that cannot be called in Section or Function body?


It should work for all commands but InstallDirRegKey and another one I can't remember right now. I think it's listed somewhere in the documentation. You just have to set the variable at the right point, before NSIS processes the string.