禁止显示MSI错误代码 [英] Suppress an MSI error code

查看:204
本文介绍了禁止显示MSI错误代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误2803:对话框视图找不到该对话框的记录。这是因为我已从安装程序中明确删除了 FilesInUse 对话框。当存在文件锁定时, msiexec 有时会要求显示此对话框。我的安装程序逻辑从未明确尝试显示此对话框。我的安装程序具有自定义操作,可以杀死正在锁定文件的进程,因此忽略此消息然后进行安装从来没有问题(但是对于此进程终止,我需要权限,因此,必须在对话框之后运行的自定义操作要延迟要求)。就我的所有意图和目的而言,该对话框实际上是没有用的。如何显示此错误代码而不是显示致命错误对话框,我如何抑制该错误代码?有人知道在WiX中是否有任何方法可以通过C#自定义操作等方式进行?可以使用任何方法来捕获和处理错误代码?

I get error 2803: dialog view did not find a record for the dialog. Its because I have explicitly removed the FilesInUse dialog from my installer. This is a dialog that is sometimes requested for presentation by msiexec when there are file locks. My installer logic does not explicitly ever try to show this dialog. My installer has custom actions to kill processes that are locking files, so there is never a problem with ignoring this message and then doing an installation (but for this process termination I need permissions, and thus a deferred custom action which must run after the dialog is requested). This dialog is essentially useless for all my intents and purposes. Instead of showing a fatal error dialog when this error code presents itself, how can I suppress this error code? Does anyone know if there any way to do that in WiX, perhaps through the form of a C# custom action or something? Any way to trap and handle error codes?

推荐答案

我认为您无法抑制该错误,除非您愿意使用您自己的UI并忽略FilesInUse对话框请求。或修改WiX代码(如果允许)。基本上,您会收到消息并对消息做出反应(或不响应):

I don't think you can suppress that error, unless you are prepared to use your own UI and ignore FilesInUse dialog requests. Or modify the WiX code, if that's allowed. Basically you'd be receiving the messages and reacting (or not) to them:

https://msdn.microsoft.com/zh-cn/library/aa370573(v = vs.85).aspx

您将返回忽略响应,而不是显示对话框。

You'd return the ignore response instead of showing a dialog.

您可以使用引导程序,该引导程序在启动时会升高,并且在运行MSI时会升高吗?在这种情况下,整个安装会提升,而CA在InstallFinalize之前运行时也会提升,即使它们是立即的。

Can you use a bootstrapper that elevates when it starts and which runs the MSI? In that case the entire install is elevated and your CAs are elevated when they run before InstallFinalize, even if they are immediate.

如果它们是您的应用程序,那么另一种解决方案是将它们与Restart Manager集成在一起,以便告诉它们关闭,并具有可以保存状态的附加功能。并在必要时将其还原。您不需要CA。

If they are your apps, then another solution would be to integrate them with Restart Manager so that they are told to shut down, with the added feature that they can save state and restore it if necessary. You wouldn't need your CAs.

这篇关于禁止显示MSI错误代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆