Visual C++ 2010 运行时库先决条件在 VS 2010 创建的安装程序上不断弹出 [英] Visual C++ 2010 Runtime Libraries prerequisite keeps popping up on a VS 2010 created installer
问题描述
我使用 Visual Studio 2010 版本 10.0.40.219.1 SP1 Rel 创建了一个安装程序.我的应用程序是为 x86 构建/编译的,需要 VC++ 运行时库.因此,安装项目使用 VC++ 运行时库作为先决条件进行配置.
I created an installer with Visual Studio 2010 Version 10.0.40.219.1 SP1 Rel. My application is built/compiled for x86 and requires VC++ runtime libraries. Thus, the setup project is configured with VC++ runtime libraries as a prerequisite.
每次运行安装程序时,都会弹出以下组件将安装在您的计算机上".Visual C++ 2010 运行时库 (x86)".第一次按预期安装.第二次及以后它问我是否修复或删除VC++ 2010.
Every time I run the installer I get the popup "The following components will be installed on your machine." "Visual C++ 2010 Runtime Libraries (x86)". The first time it gets installed asa expected. The second and subsequent times it asks me whether to repair or remove VC++ 2010.
这个弹窗应该只显示一次,第一次发现没有安装VC++ redistributable.
This popup should only be displayed once, the first time it is discovered that VC++ redistributable is not installed.
有人看过吗?有人知道我该如何解决这个问题吗?
Has anyone seen this? Anyone know how I can fix this?
解决方案:
我接受的答案为我提供了解决问题所需的条件.以下是我为解决此问题所做的详细信息,实际上非常简单.我编辑了文件:
The answer I accepted gave me what I needed to resolve the issue. Here are the details on what I did to fix this, which was very simple in fact. I edited the file:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\vcredist_x86\product.xml
在此文件中,您将找到以下内容:
In this file you will find the following:
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{6EE91C1A-A2E7-38CD-AEBB-3B900A4D8868}"/>
</InstallChecks>
以上包含不正确的产品代码.将上述内容替换为 Visual C++ 2010 SP1 可再发行组件的正确产品代码,如下所示:
The above contains the incorrect product code. Replace the above with the correct product code for the Visual C++ 2010 SP1 redistributable as follows:
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}"/>
</InstallChecks>
链接此处显示正确各种 VC++ 2010 Redistributables 的产品代码.
The link here shows the correct product codes for the various VC++ 2010 Redistributables.
推荐答案
发生这种情况是因为先决条件检测标准不正确.
This happens because the prerequisite detection criteria is incorrect.
解决方案是使用正确的标准创建您自己的自定义先决条件.也许这篇文章会有所帮助:http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx
A solution is to create your own custom prerequisite with a correct criteria. Perhaps this article will help: http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx
Visual Studio 安装项目不支持此功能.但是可以通过手动生成所需的清单来完成.
Visual Studio setup projects do not support this. But it can be done by manually generating the required manifests.
您可以在此处找到清单结构:http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx
You can find the manifests structure here: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx
这些清单可以使用 Bootstrapper Manifest Generator 工具自动生成.
These manifests can be generated automatically with the Bootstrapper Manifest Generator tool.
生成包清单后,您可以将所有这些文件(包括包)添加到 Visual Studio 先决条件文件夹中的单独文件夹中,例如:
After generating the package manifests, you can add all these files (including the package) in a separate folder in the Visual Studio prerequisites folder, for example:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\
然后您可以在设置项目属性页面中选择先决条件.
You can then select the prerequisite in your setup project properties page.
这篇关于Visual C++ 2010 运行时库先决条件在 VS 2010 创建的安装程序上不断弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!