如何在不先启动文件类型的情况下将其与MacOS X App关联? [英] How to associate file type with MacOS X App without launching it first?

查看:104
本文介绍了如何在不先启动文件类型的情况下将其与MacOS X App关联?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Mac OS X应用程序的最后安装版本与某种文件类型相关联.进行了一些实验,发现 info.plist 文件似乎在启动应用程序时被操作系统读取和解释,而不是在将应用程序捆绑包拖到磁盘上时被读取和解释. Apple的运行时文档配置在该主题上讲的不多.

有没有办法使用简单的.dmg映像作为安装介质,以确保系统将该特定文件类型与我新安装的应用程序关联,而无需先启动?

我应该澄清一下,我希望在安装过程中自动完成此操作(我不希望用户自己做).

解决方案

当用户将应用程序拖到应用程序"文件夹中时,系统应自动将其注册到Launch Services.请参阅应用程序注册.

I would like to associate the last installed version of my Mac OS X application with a certain type of file. A little experimentation shows that the info.plist file seems to be read and interpreted by the operating system when launching the application, not when dragging the application bundle to the disk. Apple's documentation on run-time configuration does not say much on that topic.

Is there any way, using a simple .dmg image as installation medium, to make sure the system associates that particular file type with my newly installed app without having to launch it first?

I should clarify that I want this to be done automatically during the installation (I don't want my users to have to do it themselves).

解决方案

When a user drags an application into the Applications folder, the system should register it with Launch Services automatically. See Application Registration in the Launch Services Guide.

这篇关于如何在不先启动文件类型的情况下将其与MacOS X App关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆