从 MSI 中提取安装条件 (C#)
我们有一个使用 .MSI 文件部署的大型 C# 应用程序,该文件是通过 Visual Studio 2010(或 MSBuild.exe)从 .VDProj 文件构建的。正常运行时,.MSI 安装程序将检查某些软件是否已安装,并满足某个最低版本,如果不满足版本条件,将生成有用的错误消息并退出。
这一切都很好。但是,我们正在尝试使用 msiexec.exe 以静默方式运行现有安装程序。如果 MSI 所需的附加软件已安装,那么我们会从 msiexec 处收到 0 错误代码,同样,如果 MSI 由于系统上不存在其他软件或未达到最低版本要求而失败,我们会收到返回非零错误代码。
有什么方法可以以编程方式询问 .MSI 文件并找出它的启动条件是什么?我尝试使用 msiexec 从 .MSI 中提取文件,但我仍然看不到任何类型的配置文件,其中列出了安装的最低版本要求。
任何帮助将不胜感激。
We have a large C# application which is deployed using an .MSI file which is built through Visual Studio 2010 (or MSBuild.exe) from a .VDProj file. When run normally, the .MSI installer will check that certain pieces of software are installed, and meet some minimum version, and will produce a helpful error message and exit if the version conditions are not met.
This all works fine. However, we are experiementing with using msiexec.exe to run the existing installer silently. If the additional software required for the MSI is already installed, then we get a 0 error code back from the msiexec, and likewise, if the MSI fails because other software does not exist on the system or fails the minimum version requirement, we get a non-zero error code back.
Is there any way to programmatically interrogate the .MSI file and find out what it's launch conditions are? I've tried experimenting with msiexec to extract the files from the .MSI, but I still can't see any kind of config file which lists the minimum version requirements for the install.
Any help would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
询问 MSI 以查看其中的条件确实会为您提供所述条件的列表,但不会为您提供失败的条件。您可能需要使用 /L 运行 msiexec 来切换以获得更好的日志记录(请参阅文档以获取精确的语法)。
如果条件列表足够,我建议看看 Orca (MSDN),一种查看 .msi 文件内部的简单方法。
Interrogating the MSI to see the conditions inside will indeed give you the list of said conditions, but not which one failed. You may want to run msiexec with the /L to switch to have better logging (please refer to the doc for precise syntax).
If the list of conditions is enough, I'd suggest to have a look at Orca (MSDN), an easy way to peep inside .msi files.