Display popup message? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ash_microsec
Posts: 38
Joined: Thu Dec 16, 2010 9:35 am
Location: Emsworth

Display popup message?

I have a custom dialog. When a button is pressed, a "DoAction" event is performed to run a script which sets a property to "0" or "1". I would like to display a message if the value of the property is "0".

I have seen the help page that says "create an install sequence custom action for the MsgBox function and set the ActionData value with the information to be displayed", however, if I create a UI Custom Action "Message Box", there is NO Action Data property accessible. Therefore, when I call DoAction to run my custom action, there is nothing in the dialog. To make things worse, the popup dialog is not displayed on top of the current window.

How do I display a popup message when I click a button on one of my dialogs?
ash_microsec
Posts: 38
Joined: Thu Dec 16, 2010 9:35 am
Location: Emsworth

Re: Display popup message?

Here is the hack that I've used to resolve this:

1. Create a VB script called "DisplayMsgBoxScript" that does the following:

Code: Select all

Function displayMsgBox()

    dim title
    dim prompt
    dim buttons

    title = Session.Property("MSGBOX_TITLE")
    prompt = Session.Property("MSGBOX_PROMPT")
    buttons = Session.Property("MSGBOX_BUTTONS")

    MsgBox prompt,buttons,title
    displayMsgBox = 1 ' msiDoActionStatusSuccess
End Function
2. In the "Custom Actions" screen's "UI Custom Actions", create a "Launch File or Open URL" predefined custom action called "DisplayMsgBox". Change the "Source Path" to be the full filename of your "DisplayMsgBoxScript" script file, change "Source Type" to "Visual basic script", and enter the Function Name of the function in your script, e.g. in the above example, "displayMsgBox".

3. On your dialog button's "Published Events", and the following events (in order):
  • "[MSGBOX_TITLE]" event with "Your title" argument.
  • "[MSGBOX_PROMPT]" event with "Your prompt" argument.
  • "[MSGBOX_BUTTONS]" event with "0" argument. This is the numerical value for the button combination you want to display, in my example, "0" being OK button only.
  • "DoAction" event with "DisplayMsgBox" argument.
You can use conditions on the above statements as required to dictate when/what the message says.

Return to “Common Problems”