使用 WiX 自动安装运行时库
当我的文件集包含对 C++ 运行时 DLL 有一个或多个依赖项的 DLL 时,我需要从 VCRedist.exe 安装该文件。这可能很困难,因为每个 DLL 都依赖于特定版本的 C++ 运行时。
如何自动将运行时可再发行组件添加到我的安装程序中?
如何在 WinSxS 中处理需要不同版本的 C++ 运行时的 DLL?
When my file set includes DLLs with one ore more dependencies to the C++ run-time DLLs I need to install the file from VCRedist.exe. This can be difficult, since each DLL is dependent on a specific version of the C++ run-time.
How do I add automatically the run-time redistributables to my installer?
How do I handle DLLs that require different versions of the C++ run-time in the WinSxS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要安装库所需的最新版本(最高)以及将旧版本重定向到新版本的策略文件。
您可以使用随 Visual Studio 安装的合并模块来完成这两项操作。它们通常位于 C:\Program Files\Common Files\Merge Modules 中。请参阅
MergeRef
元素和示例 如何使用您的安装程序。您还需要在安装中添加策略合并模块。You need to install the latest version (highest) version required by your libraries and a policy file that redirects older versions to the new version.
You can do both with merge modules installed with Visual Studio. They're usually located in
C:\Program Files\Common Files\Merge Modules
. SeeMergeRef
element and an example how to install Visual C++ redistributable with your installer. You will also need to add a policy merge module to your install.您可以简单地确保安装了最新的 vcredist,它会自动包含对旧版本的支持。
我认为最简单的方法是在安装程序运行之前使用 bootstrapper 安装运行时。您可能需要创建自己的包,但使用 Bootstrapper Manifest Generator 可以轻松实现此目的。
在product.xml中,您可以添加安装检查以确保它不会安装两次,例如:
请参阅此处用于其他 GUID。
You can simple make sure the latest vcredist is installed, it automatically includes support for older versions.
I think the easiest it to use bootstrapper to install the runtime before your installer runs. You might need to create your own package, but it is easy to use Bootstrapper Manifest Generator for this.
In the product.xml you can add an installation check to make sure it is not installed twice, for example:
See here for other GUIDs.
heat 和 Votive 都不支持所请求的功能。必须手动添加运行时 DLL。
Neither heat nor Votive does support the requested feature. The run-time DLLs must be added manually.