简体   繁体   English

如何在Mac OS X上的文件夹复制期间关联文件

[英]How to associate file during folder copy on Mac OS X

I involved with the development of an application that is intended to deploy on multiple desktop system including the Macintosh. 我参与了旨在部署在包括Macintosh在内的多个桌面系统上的应用程序的开发。

Our team decided we would like to a drag and drop installation for the Macintosh. 我们的团队决定我们要为Macintosh拖放安装。 However, the application is intended to ship with other content besides the application itself such as example files. 但是,该应用程序旨在与应用程序本身一起提供其他内容,例如示例文件。

Originally these files were placed in the application bundle, however this was discovered to be problematic as the cross platform libraries used for the user interface will not allow someone to access the contents in the bundle. 这些文件最初放置在应用程序捆绑包中,但是发现这是有问题的,因为用于用户界面的跨平台库不允许某人访问捆绑包中的内容。 Also force users to have to dive into a bundle to find content does not offer a great user experience. 也迫使用户不得不陷入捆绑之中以寻找无法提供出色用户体验的内容。

To that end, we decided to pull these examples file and what not out of the bundle and place them in a separated folder that lived along side the application bundle. 为此,我们决定将这些示例文件以及不包含在示例文件中的文件拉出,并将它们放在应用程序包旁边的单独文件夹中。 To make sure everything including the examples and the application were copied together during the drag and drop installation, a new top level folder was created that contained everything to be copied. 为了确保在拖放安装过程中将所有示例和应用程序都复制到一起,创建了一个新的顶层文件夹,其中包含要复制的所有内容。

The problem that now exists is that whereby when originally just the application bundle was copied over to the system, the copying of this top level folder does not cause file associations for the application to occur automatically. 现在存在的问题是,当最初只是将应用程序捆绑包复制到系统时,此顶级文件夹的复制不会导致应用程序的文件关联自动发生。

What can be done to associate an application with certain files when someone installs by dragging a folder contain the application bundle? 当有人通过拖动包含应用程序捆绑包的文件夹进行安装时,如何将应用程序与某些文件相关联?

I suggest you to deliver it separately in one dmg. 我建议您将其单独服用一药。 So your dmg structure will look like next: 因此,您的dmg结构如下所示:
MyApp -> Applications MyApp->应用程序
MyApp Examples -> Application Support MyApp示例->应用程序支持

Simple, user-friendly, no problems with association. 简单,用户友好,关联没有问题。

Actually it looks like the file association is working after all. 实际上,看起来文件关联毕竟在起作用。 Someone reported a defect against the installation not making the associations. 有人报告了安装不建立关联的缺陷。 However, I just tested the installation on a clean system and copying over the folder does seem to make the associations. 但是,我只是在干净的系统上测试了安装,并且在文件夹上进行复制似乎确实可以建立关联。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM