【发布时间】:2015-03-06 13:43:16
【问题描述】:
如何检测“Visual C++ 2013 redistributable”何时安装?
以下 c++ 代码正确检测到 2010 redist:
// Visual C++ 2010 Redist detection...
INSTALLSTATE state = pMsiProc( _T("{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}") );
if(state == INSTALLSTATE_DEFAULT)
{
// Visual C++ 2010 redist installed.
}
我希望对 2013 redist 使用相同类型的代码,但无论软件包是否安装,INSTALLSTATE 总是返回 INSTALLSTATE_DEFAULT。有人知道为什么吗?
// call MsiQueryProductStateW...
INSTALLSTATE state = pMsiProc(_T("{13A4EE12-23EA-3371-91EEEFB36DDFFF3E}"));
//
if ((state == INSTALLSTATE_DEFAULT || state == INSTALLSTATE_LOCAL)
{
// 2013 redist is installed.
}
【问题讨论】: