在可可中查找已安装的应用程序 [英] Find Installed applications in cocoa
问题描述
我正在开发一个应用程序在cocoa.I需要检查iTunes是否安装在机器上。有任何方法可以找到已安装的应用程序????
I am developing an application in cocoa.I need to check whether iTunes is installed or not in the machine.Is there any way to find the installed applications????
推荐答案
LSFindApplicationForInfo()函数可以获取一个包ID(例如 com.apple.iTunes
),是否通过尝试查找iTunes安装。
The function LSFindApplicationForInfo() can take a bundle ID (e.g. com.apple.iTunes
), so you can find out whether iTunes is installed by trying to look it up.
要回答问题的第二部分,是 LaunchServices上的隐藏接口,以获取所有应用程序名称的列表。但是,因为你的目标是找到iTunes是否安装,不要使用它 - 只是寻找iTunes。
To answer the second part of your question, there is a hidden interface on LaunchServices to get a list of all application names. However, as your goal is to find whether iTunes is installed, don't use it - just look for iTunes.
这篇关于在可可中查找已安装的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!