Visual C++ 2010 Runtime Libraries prerequisite keeps popping up on a VS 2010 created installer

与世无争的帅哥 提交于 2019-11-27 11:16:02

问题


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:


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:

C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\

You can then select the prerequisite in your setup project properties page.



来源:https://stackoverflow.com/questions/7785328/visual-c-2010-runtime-libraries-prerequisite-keeps-popping-up-on-a-vs-2010-cre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!