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

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

问题描述

我想将我的 Mac OS X 应用程序的上次安装版本与某种类型的文件相关联.一些实验表明,info.plist 文件似乎在启动应用程序时被操作系统读取和解释,而不是在将应用程序包拖到磁盘时.Apple 的运行时文档配置在这个话题上没有说太多.

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.

有什么方法可以使用简单的 .dmg 图像作为安装介质,以确保系统将特定文件类型与我新安装的应用相关联而无需启动它第一?

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).

推荐答案

当用户将应用程序拖入 Applications 文件夹时,系统应自动将其注册到 Launch Services.参见 启动服务指南中的应用注册.

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天全站免登陆