开发者

How to get the Location of an Application installed in Mac OS X using Package Manager?

I am trying to create an installer using Package Maker, which installs a plugin into App's sub-directory. I can create a simple "If File Exists"开发者_如何转开发 to see if the Application Bundle (".app") exists at the default location. But, How do I know the location if the user changes the location?

I know that using Applescript we can obtain the location using the Bundle identifier. But for this application there can exist multiple versions with the same Bundle Identifier (like Adobe Photoshop) and I have to install the plugin files for all the versions. What's a good solution for this problem?

EDIT: I have just found out a way of getting all the Applications' locations using LocationServices tool "lsregister" from the terminal. I assume thats the way to go. If you have a better way of doing it, let me know.


You might consider a tool I wrote to find the path to all applications that can open a certain file type. That would give you the paths, you'd just need to filter that list to find only the application-type you're looking for. I think my tool should be faster than your lsregister idea but either should work. I'd run my tool and pipe the results to grep to filter on the application name. See here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜