cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TheResearch
Level 6

MsgBox inside Custom Action

Can we have the MsgBox inside the VBScript CA?

Is it advisible?
Labels (1)
0 Kudos
(6) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Yes you can. We suggest them all the time as a quick debugging tool, for instance to verify that the CA is being called when you expect it to be. But as for whether it's advisable, that depends on when, how, and why you're using it. Using it for quick debugging purposes are great, although for deeper debugging you'll probably prefer MSI logging. Using it to ask a question of the user during the UI sequence is okay, although it's probably better to use an MSI dialog. Using it during the execute sequence for anything other than debugging is almost always a bad idea, as the execute sequence is supposed to be silent.
0 Kudos
vijayakumar
Level 6

Thanks Michael,

I am not using the MsgBox for debugging purpose.
Actually, we need to show a pop up msg to the user during installation when winword is opened.
I was using an Error Custom Action for this purpose. But, this CA contains only Ok button.
I am asked to show 2 buttons with 'Retry' and 'Cancel'. so when the user clicks 'retry' the script may again run until all instances of winword is closed. When cancel is clicked the installation is aborted.

I am not sure whether Installshield supports this kind of in-built msg boxes.

That s y i am asking whether i can show a pop up msg box with vbscript and perform my action.

Is this advisible?
0 Kudos
vijayakumar
Level 6

BTW, this msg was posted by my colleague 'TheResearch' on my behalf.

Thanks.
0 Kudos
Christopher_Pai
Level 16

script ca's aren't really that great of a choice to tell you the truth. Beyond that, I don't really have a good enough mental picture of exactly what you are trying to do to give you additional advice.

If you do want vbscript, checkout

http://www.w3schools.com/VBScript/func_msgbox.asp

You can tell it which buttons to display and you can check the return code and act on it. Also keep in mind that you can also author custom dialogs in MSI and do the same thing without custom actions.
0 Kudos
vijayakumar
Level 6

Thanks Chris,

I have the VBScript funtion in hand and its working fine. Just wanted to know whether displaying a msgbox in a release product is advisible.

Or, instead of using a msgbox inside a VBscript CA can i use a 'Custom Dialog' which does the same work(displays the msg). That is, can i call a Cusom Dialog from a Vbscript CA and proceed based on the user selection??

Is this possible? Also, advise me if i am thinking in the right direction.

Thanks.
0 Kudos
vijayakumar
Level 6

How do i call a Custom Dialog from a VB Script Custom action??

Thanks
0 Kudos