Suppress an MSI error code

时光总嘲笑我的痴心妄想 提交于 2019-12-12 01:57:26

问题


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?


回答1:


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/en-us/library/aa370573(v=vs.85).aspx

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

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.

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.



来源:https://stackoverflow.com/questions/29607994/suppress-an-msi-error-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!