创建捆绑包 - 出了什么问题?

发布于 2024-07-22 06:02:16 字数 1660 浏览 4 评论 0原文

我这里有一个相对简单的。 我正在将捆绑包放置在应用程序的 Resources 文件夹中(也可能位于应用程序支持文件夹中)。 这些包将包含应用程序处理的数据的模板信息。 我已经构建了一个捆绑包,扩展名为“booksprintstyle”,并且目录结构符合规范。 我已经准备好了 Info.plist,并且我想我已经填写了我需要的所有值。 我是否需要更改应用程序中的某些内容才能将这些带有扩展名的文件夹识别为捆绑文件,或者我是否在捆绑包结构中丢失了某些内容? 我注意到有些捆绑包有一个名为 PkgInfo 的文件; 这很重要吗?

下面是我的包中的 Info.plist。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleGetInfoString</key>
    <string>1.0, Copyright © 2009 Joey Lange</string>
    <key>CFBundleIdentifier</key>
    <string>net.atherial.books.exporter.printingpress.printstyle</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Books Print Style - Generic</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleDisplayName</key>
    <string>Books Print Style - Generic</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2009 Joey Lange</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
</dict>
</plist>

I've got a relatively simple one here. I'm making bundles to live inside the Resources folder of my application (and possibly in the Application Support folder). These bundles will contain template information for the data the application handles. I've constructed a bundle, with extension "booksprintstyle", and the directory structure is up to spec. I have an Info.plist all set and I think I've filled in all the values I need to. Do I need to change something in my App to have these folders-with-extensions recognized as bundle files, or am I missing something in my bundle structure? I noticed that some bundles have a file called PkgInfo; is that important?

Below is the Info.plist from my bundle.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleGetInfoString</key>
    <string>1.0, Copyright © 2009 Joey Lange</string>
    <key>CFBundleIdentifier</key>
    <string>net.atherial.books.exporter.printingpress.printstyle</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Books Print Style - Generic</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleDisplayName</key>
    <string>Books Print Style - Generic</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2009 Joey Lange</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
</dict>
</plist>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱*していゐ 2024-07-29 06:02:16

我是否需要在我的应用程序中进行某些更改才能将这些带有扩展名的文件夹识别为捆绑文件...

是的。 在应用程序的 Info.plist 中导出这些捆绑包类型的 UTI 声明。 您将声明 UTI 符合 com.apple.package。 有关详细信息,请参阅了解统一类型标识符

下面是我的包中的 Info.plist。

那不相关。 必要的声明位于您的应用程序包中,而不是您的文档/插件包中。

我注意到一些捆绑包有一个名为 PkgInfo 的文件; 这很重要吗?

不。

Do I need to change something in my App to have these folders-with-extensions recognized as bundle files…

Yes. Export a UTI declaration in your app's Info.plist for the type of these bundles. You'll declare the UTI as conforming to com.apple.package. See Understanding Uniform Type Identifiers for more.

Below is the Info.plist from my bundle.

That isn't relevant. The necessary declaration goes in your application bundle, not your document/plug-in bundles.

I noticed that some bundles have a file called PkgInfo; is that important?

No.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文