Mailbag: How to detect the presence of the Visual C++ 9.0 runtime redistributable package

转载:http://blogs.msdn.com/b/astebner/archive/2009/01/29/9384143.aspx

 

Question:

I saw a couple of previous blog posts that you wrote about how to detect the presence of the Visual C++ 2005 runtime files and the Visual C++ 2005 SP1 runtime files.  I am creating an installer that requires the Visual C++ 2008 runtime files.  How can I detect the presence of the Visual C++ 2008 and 2008 SP1 runtime files?

Answer:

Like in the Visual C++ 2005 runtime files, there is not a specific detection mechanism designed and built into the Visual C++ 2008 runtime files installers.  You can use an algorithm like the one I described in my previous blog posts to detect the presence of the Visual C++ 2008 runtime files products on a system:

  1. Call the MsiQueryProductState API
  2. Pass in the product code for the package that you want to detect based on the list below
  3. Check the return value of this API.  If it is anything other than INSTALLSTATE_DEFAULT, the package is not yet installed

Visual C++ 2008 runtime files

Visual C++ 2008 SP1 runtime files

Visual C++ 2008 SP1 ATL Security Update runtime files

Visual C++ 2008 SP1 MFC Security Update runtime files

<update date="11/19/2009"> Added information about the Visual C++ 2008 SP1 ATL Security Update product codes. </update>

<update date="11/7/2011"> Added information about the Visual C++ 2008 SP1 MFC Security Update product codes. </update>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值