我们正在将 VC++ 项目从 Visual Studio 2003 移植到 Visual Studio 2008 SP1(9.0.30729.4148)。依赖的外部库还有
使用 Visual Studio 2008 SP1 编译。
MainApp - Main application Compiled with VS SP1 9.0.30729.4148
ExtStaticLib1 - External static library compiled with VS SP1 9.0.30729.4148
ExtDynamicDll1 - External DLL compiled with VS SP1 9.0.30729.4148
主应用程序有两种部署方案:
- 具有用户管理权限的计算机:
我们建议在使用应用程序 MainApp 之前先安装 Visual Studio 可再发行组件包。这很有效,因为用户具有管理员权限并且安装可再发行软件包没有问题。应用程序自动链接到 WinSxS 文件夹中的 VC redist DLL。
- 具有非管理员用户的机器:
这种情况是有问题的。用户没有管理员权限。因此,无法安装 VS2008SP1 可再发行包。
我们正在执行以下操作来解决此问题:
问题:
- 使用标志 _BIND_TO_CURRENT_VCLIBS_VERSION 是否有任何副作用(特别是当 VC 可再发行包和私有 VC redist 程序集同时存在时)?
- 我们对外部库 ExtStaticLib1、ExtDynamicDll1 没有太多控制,因此,它们不会使用宏 _BIND_TO_CURRENT_OPENMP_VERSION 进行编译。但它们已经用 VSSp1 编译了。这样设置会不会有问题呢?
- 如果有更新版本的 VS 可再发行组件可用(高于 9.0.30729.4248),是否会出现任何问题。
谢谢。
We are porting a VC++ project from Visual Studio 2003 to Visual Studio 2008 SP1(9.0.30729.4148). The dependent external libraries are also
compiled with Visual Studio 2008 SP1.
MainApp - Main application Compiled with VS SP1 9.0.30729.4148
ExtStaticLib1 - External static library compiled with VS SP1 9.0.30729.4148
ExtDynamicDll1 - External DLL compiled with VS SP1 9.0.30729.4148
There are two deployment scenarios for the Main application:
- Machine with User Admin rights:
We recommended to put a pre-rquisite to install Visual Studio redistributable package before using the application MainApp. This works well as user has the admin rights and installing redistributable package has no issues. Application links to the VC redist DLLs in WinSxS folders automatically.
- Machine with non-admin user:
This scenario is problematic. The user is not having the admin rights. Hence, it is not possible to install VS2008SP1 redistrtibutable package.
We are doing following to solve this:
-
Compile MainApp targets with macro _BIND_TO_CURRENT_OPENMP_VERSION ( for all the projects in MainApp).
-
Distribute the VS2008SP1 redistributable DLLs as private assemblies and copy them in application install directory.
Questions:
- Is there any side-effect of using the flag _BIND_TO_CURRENT_VCLIBS_VERSION (Specially when both VC redistributable package and private VC redist assemblies exists together)?
- We do not have much control on the external libraries ExtStaticLib1, ExtDynamicDll1 and hence, they will not be compiled with macro _BIND_TO_CURRENT_OPENMP_VERSION. But they are already compiled with VSSp1. Will there be any issue with this setup?
- Will there be any issue if there is a newer version of VS redistributable available (newer than 9.0.30729.4248).
Thanks.
发布评论
评论(2)
我会避免使用任何 BIND 宏。你迟早会遇到麻烦。
即使您将 VC 运行时 dll 作为私有程序集分发,您也无法确定用户是否已将它们与其他应用程序一起安装。
出现的一个问题是您最终可能会得到一个引用多个 c 运行时版本的清单。 这是一个关于此问题的未决问题(仅供参考:我也遇到了同样的问题!)。
因此,如果没有理由迫使您只使用特定版本的 c 运行时而不是最新的兼容版本,那么就不要使用这些定义宏!
I would avoid using any of the BIND macros. You'll get into troubles sooner than later.
Even if you distribute the VC runtime dlls as private assemblies, you can't be sure that the user doesn't have them installed already with some other app.
One problem that arises is that you can end up with a manifest that references multiple c-runtime versions. Here's an open issue about this (FYI: I had that very same issue!).
So if there's no reason that would force you to only use a very specific version of the c-runtime and not the latest compatible one, then don't use those define macros!
找到这个博客资源可以回答您的问题。
请参阅“更新、补丁和服务包”部分
http://helgeklein.com/博客/2010/03/部署-visual-c-runtime-files-as-private-assemblies/
Found this blog resource which has answer to your question.
Refer section which says "Updates, patches and service packs"
http://helgeklein.com/blog/2010/03/deploying-visual-c-runtime-files-as-private-assemblies/