claudenoel
Posts: 17
Joined: Mon Oct 22, 2018 1:25 pm

Monitor SQL scripts within a dialog form

I have to run un bunch of SQL scripts. I created a custom action for each of them that are called when the user presses a button in a dialog form. Each script returns a completion string. I want to display those string in the dialog form so the user is aware of the progress. So at the end of each script, I want to add the returned string into a Label or and Edit box, or a List box, I don't mind. I just want to show the progress.

What is the best way to accomplish that? Values are actually always in the RESULT_COLUMN_PROP property.
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Monitor SQL scripts within a dialog form

Hello Claude,

Well, as you have already mentioned, probably the best way would be to save the results of your queries in a "ComboBox" or "ListBox" control. To do so, you can simply add a "ComboBox" control and set its property to "RESULT_COLUMN_PROP". This can be done by selecting your dialog control (e.g. ComboBox) and, on the right pane, under "Property" you can set the control's property name to "RESULT_COLUMN_PROP" (without quotes).

You can have a look on our "Working with Windows Installer ComboBox and ListBox controls" article for more information about the ComboBox and ListBox controls.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
claudenoel
Posts: 17
Joined: Mon Oct 22, 2018 1:25 pm

Re: Monitor SQL scripts within a dialog form

Well, it doesn't work the way you suggest. I also tried using the listbox example but I found that a Refresh dialog should be activated, which I don't have (using AI 10.6).
Any other suggestion? I just want to user to be notified in any way which script is executing.
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: Monitor SQL scripts within a dialog form

Hello Claude,

Indeed, you are right, the "Refresh the current dialog" event is needed in order to accomplish what you want through the "ComboBox" or "ListBox" controls. It is a known Windows Installer bug that it cannot refresh a combobox control after a dialog has been loaded. Only after switching to a different dialog will the control be reloaded (e.g. Press "Back" and then "Next" again).
I just want to user to be notified in any way which script is executing.
I think that you can use a "MessageBox" custom action to notify the user that a specific script is going to run. For more information about "MessageBox" custom action, please have a look on our "Display message box" article.

Time-wise, the custom action should be scheduled before you execute any of your scripts.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”