简体   繁体   English

如何监视Windows对话框?

[英]How to monitor Windows Dialog?

I am looking for a way to monitor Windows dialog during a MSI deployment. 我正在寻找一种在MSI部署期间监视Windows对话框的方法。 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. 这是我的情况:我们有一些机器每天都在部署MSI,其中的一些有时会失败,并显示带有错误消息的Windows对话框

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. 我试图找到一种方法来编写脚本(也许在Powershell中),该脚本每分钟运行一次,并查找带有“确定”按钮的Windows对话框。 Is there a simple way to do that? 有没有简单的方法可以做到这一点?

Thanks! 谢谢!

You can depoly a MSI with options to not display a GUI at all. 您可以通过选择不显示任何GUI的选项来解散MSI。

Using MSIEXEC with the /quiet option. 将MSIEXEC与/ quiet选项一起使用。

Deploy via active directory to machines should not have this problem so I'd be interested in how you are deploying the MSI. 通过活动目录部署到计算机应该不会出现此问题,因此我对您如何部署MSI感兴趣。

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. 如果自动确定“您确定要删除c:\\的内容”,可能会对您的用户造成问题。

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. 另外,如果您的设置是在启用UAC的Vista / Windows7 / server2008上运行的,则您的脚本将必须以管理员权限运行,否则任何单击消息都将被拒绝。

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? 如果是这样,是否不可能进行编码,使得在部署的软件执行时,它会报告(通过电子邮件?)PC名称和软件版本号?

You could then simply right a script to start the application periodically and then close it as well. 然后,您可以简单地纠正脚本以定期启动应用程序,然后也将其关闭。

Darknight 黑夜

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM