PDA

View Full Version : MsgBox Behavior



jweber
03-20-2006, 11:56 AM
I am playing around with executing a custom vbscript action from a dialog. The vbscript simply displays a MsgBox....

MsgBox("Test")

When I run the install the message box displays correctly, however I then cant click on a single thing. I have to hit CTL-ALT-DEL and then I can click in the install window. I am running XP if that matters...

Any ideas?

bhagelin
03-20-2006, 12:47 PM
Is an "OK" button being displayed in your VBscript messagebox?

jweber
03-20-2006, 12:52 PM
Yes, the OK button definitely appears. Any ideas on how to resolve?

bhagelin
03-20-2006, 01:32 PM
Perhaps you could try changing the sequence order in which your custom action runs. See if that makes a difference?

jweber
03-20-2006, 01:45 PM
I am not sure I am following you.

bhagelin
03-20-2006, 02:10 PM
In InstallShield, you can go to the "Sequences" view and set what order different events in your program will execute. Find where your custom action is in the sequence, and move it up or down in the sequence, causing the custom action to fire earlier or later in the program.

You are using a custom action to execute your VBScript, correct?

jweber
03-20-2006, 02:17 PM
Okay I did that. I moved it so it was a DoAction event on the InstallWelcome Dialog box. The same thing happened. Its as if, the VBScript is never finishing. The script is contained within the Custom Action and simply contains the MsgBox line. Do I need to put anything else in the script to return control to the dialog?

bhagelin
03-20-2006, 02:27 PM
Try looking at the MsgBox() function specs:

http://ns7.webmasters.com/caspdoc/html/vbscript_msgbox_function.htm

Maybe something like this?:


MsgBox("Test", 1)

jweber
03-20-2006, 02:35 PM
No go. I applied it to the InstallWelcome dialog the and the installer just ends after I click next. However, I changed it to install script and that appears to be working normally. So I think I will stick with that. Thanks for your help.

NullTerminator
07-28-2006, 09:05 AM
My guess for your VBScript custom action is that you are not setting a proper return value. You need to return ERROR_SUCCESS, which I think may be a nonzero value (don't quote me on that, though).

As for validating user input in an MSI project, I am currently working on the same problem. I haven't quite gotten it to work either, but I think I'm pretty close. Here is what I have so far:

Custom action pseudocode (InstallScript):

function ValidateInput (hMSI)
begin
// check user input
if (error) then
MsiSetProperty (hMSI, "INPUT_VALID", "TRUE");
else MsiSetProperty (hMSI, "INPUT_VALID", "FALSE");
endif;
return ERROR_SUCCESS;
end;


After I create a custom action called ValidateInput from this, the next step is to use it in a form. Using the "User Interface -> Dialogs" InstallShield view, I navigate to my dialog's behavior. The idea is to go to the next dialog only if the user input is valid. Here's pretty much the essence of how I try this:

Behavior for dialog's 'Next' button:

Action Parameters Condition
DoAction ValidateInput 1
NewDialog MyNextDialog INPUT_VALID="TRUE"


Unfortunately, this doesn't quite work (although I verified that the INPUT_VALID property gets set to "TRUE" within InstallScript, it seems like Windows Installer doesn't re-evaluate this property after I run my validation function), so I'm looking for answers in this community. However, I think I'm pretty close, and hope that someone else may be able to point out the missing link in getting this to work. Any ideas?