views:

131

answers:

3

I am looking for a way to monitor Windows dialog during a MSI deployment. Here is my situation: we have machines deploying daily MSIs and once in a while, one of them fail and shows a Windows dialog with an error message.

I am trying to find a way to write a script (maybe in Powershell) which will run every minutes and look for a Windows dialog with an OK button. Is there a simple way to do that?

Thanks!

A: 

Rather than try to click the dialog, is there a way that you can determine the condition that will cause the error, and handle it?

Although you will find some methods for enumerating windows and posting click messages to them, there are some other things that you migth want to consider:

What if an unrelated dialog box appears that has an Ok button? It could cause problems for your users if an "Are you sure you want to delete the contents of c:\" gets auto-ok'ed.

Also, if your setup is running on Vista/Windows7/server2008 with UAC turned on, then your script will have to run with admin privileges, or any click messages will be rejected.

JMarsch
I agree with you JMarsch... But I am not trying to click the dialog. I want to know if there a dialog on the screen.
Martin
A: 

You can depoly a MSI with options to not display a GUI at all.

Using MSIEXEC with the /quiet option.

Deploy via active directory to machines should not have this problem so I'd be interested in how you are deploying the MSI.

garthy
A: 

Can I assume that you are deploying updates to multiples machines (and effectively you wish to know if an update was successful?)

If that is the case, would it not be possible to code such that when the deployed software executes, it reports (via email?) the PC name and the Software Version Number?

You could then simply right a script to start the application periodically and then close it as well.

Darknight