以编程方式检测是否已安装Windows Media Player
有人对如何以编程方式检测是否安装了Windows Media Player有任何建议吗?
Anybody have any advice on how to programmatically detect if Windows Media Player is installed?
我知道要查找注册表设置,但是不信任它,因为它可能会引起误解(未安装可能不会将其删除).而且我考虑过只是发布视频,但是由于未安装Media Player可能会导致错误,因此也不是确定性的.
I know about the registry setting look up, but don't trust it since it's more than a little misleading (uninstalled may not remove it). And I've considered just launching a video, but an error could be caused by something other than Media Player not being installed, so it's not conclusive either.
理想情况下,我希望可以在我的C ++应用程序和我的 NSIS 中使用的解决方案安装程序.但是我的C ++应用程序是最重要的,我愿意忍受安装程序中的注册表黑客攻击.
Ideally, I'd prefer a solution which could be used from both my C++ application AND my NSIS installer. But my the C++ app is the most important, I'm willing to live with the registry hack in the installer.
查看键HKLM\Software\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}
下的IsInstalled
值.如果已安装,则为1
,否则为0
.
Look at the IsInstalled
value under key HKLM\Software\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}
. It is 1
if installed, 0
otherwise.