Archive: Dynamically change text in shown dialog in leave function


Dynamically change text in shown dialog in leave function
I need to set text for a field in my dialog that is already shown with MUI_INSTALLOPTIONS_DISPLAY. This should be done in the dialog leave function.
I've tried MUI_INSTALLOPTIONS_WRITE and SendMessage $DlgItem ${WM_SETTEXT} 0 "STR:$0" but none of these two ways works.
How to do this?


I don't think you can do that. AFAIK, the leave function is called after the dialog has been closed.


This script changes the colours on the dialog from the leave function:
http://nsis.sourceforge.net/wiki/File:IoColors.zip

What you want to do is pretty similar so you should get the idea.

-Stu


Nice.
However, you are not actually leaving the page.
You are aborting so that the dialog is shown again.


Sorry forgot to mention the actual code you want is in between the MUI_INSTALLOPTIONS_INITDIALOG and MUI_INSTALLOPTIONS_SHOW calls.

Edit: That's if you want the changes to be made as the page is shown, otherwise what you want as iceman_k rightly said is impossible.

-Stu


Originally posted by Afrow UK
Sorry forgot to mention the actual code you want is in between the MUI_INSTALLOPTIONS_INITDIALOG and MUI_INSTALLOPTIONS_SHOW calls.

Edit: That's if you want the changes to be made as the page is shown, otherwise what you want as iceman_k rightly said is impossible.

-Stu
The matter is that I call possibly long external application with ExecWait from the page leave function. So to not to confuse a user, I want to write something at this page as it is still shown. Also, I disable all buttons to not to confuse him.
So, dialog window is still here.

If you run ExecWait from within the leave function you cannot update the buttons and text until the ExecWait is complete- at which point it is moot, really. On the other hand if you update the buttons and text before calling ExecWait, your ExecWait will not be called until the user clicks a button in the IO page, which again renders the whole text update pointless.
Looks like there is no solution to your problem.


Just display a Banner.

Edit: Here's an idea that could be possible with InstallOptionsEx perhaps. I haven't checked this but here's the idea. You execute the process with Exec not ExecWait in the custom page's PRE function. If it is possible to get InstallOptionsEx to leave the page every say 5 seconds you could use FindProcDLL to check if the process is still running in the LEAVE function. If it is still running you Abort back to the page, otherwise you re-enable the Next button and set some text to say the process has finished and call Abort.

If you want to run the process only if the user clicks on a button, then that'll be a bit different. You'd probably have to have some boolean variable set or something...

-Stu


Hm, thanks for idea about displaying a banner - don't know how to do still, but will search. Dealing button - I am able to disable Next button in leave function - this works by simply call to EnableWindow. But I cannot change the text even with WinApi call and cannot understand, why.


Banner plugin. Docs\Banner

-Stu


Thanks, Afrow UK!