我使用 Visual Studio 2010 版本 10.0.40.219.1 SP1 Rel 创建了一个安装程序。我的应用程序是为 x86 构建/编译的,需要 VC++ 运行时库。因此,安装项目必须配置 VC++ 运行时库作为先决条件。
每次运行安装程序时,都会弹出“以下组件将安装在您的计算机上”的消息。 “Visual C++ 2010 运行时库 (x86)”。第一次按预期安装。第二次及以后,它询问我是否修复或删除 VC++ 2010。
此弹出窗口应该只显示一次,这是第一次发现未安装 VC++ 可再发行组件时。
有人见过这个吗?有人知道我该如何解决这个问题吗?
解决方案:
我接受的答案为我提供了解决问题所需的信息。以下是我为解决此问题所做的详细信息,实际上非常简单。我编辑了该文件:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\vcredist_x86\product.xml
在该文件中,您将找到以下内容:
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{6EE91C1A-A2E7-38CD-AEBB-3B900A4D8868}"/>
</InstallChecks>
以上包含不正确的产品代码。将上述内容替换为 Visual C++ 2010 SP1 可再发行组件的正确产品代码,如下所示:
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}"/>
</InstallChecks>
链接 此处 显示了各种 VC++ 2010 Redistributables 的正确产品代码。
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.
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.
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?
Solution:
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>
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>
The link here shows the correct product codes for the various VC++ 2010 Redistributables.
发布评论
评论(1)
发生这种情况是因为先决条件检测标准不正确。
解决方案是使用正确的标准创建您自己的自定义先决条件。也许这篇文章会有所帮助:
http://blogs.msdn.com/b/astebner/archive/2010/ 05/05/10008146.aspx
Visual Studio 安装项目不支持此功能。但可以通过手动生成所需的清单来完成。
您可以在此处找到清单结构: http://msdn.microsoft.com/en -us/library/ms229223(VS.80).aspx
这些清单可以使用 Bootstrapper 自动生成清单生成器工具。
生成包清单后,您可以将所有这些文件(包括包)添加到 Visual Studio 先决条件文件夹中的单独文件夹中,例如:
然后您可以在安装项目属性页中选择先决条件。
This happens because the prerequisite detection criteria is incorrect.
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 setup projects do not support this. But it can be done by manually generating the required manifests.
You can find the manifests structure here: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx
These manifests can be generated automatically with the Bootstrapper Manifest Generator tool.
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:
You can then select the prerequisite in your setup project properties page.