可可 + .app 文件

发布于 2024-08-05 23:23:30 字数 152 浏览 3 评论 0原文

我的可可应用程序有一个可执行文件 xyz.app 文件。但是当我在 Windows 上复制它时,它会将其显示为包含所有资源文件和内容的目录。有没有办法在 Mac 上创建单个文件可执行文件(如 Windows 上的 .exe 文件),以便禁止用户查看资源文件和其他文件?

谢谢

i have an executable for my cocoa application as xyz.app file. But when i copy this on windows, it is showing this as a directory with all the resource files and stuff. Is there any way to create a single file executable on mac also (like .exe file on windows) so as to disable the user from seeing the resource files and other files?

Thanks

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

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

发布评论

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

评论(2

治碍 2024-08-12 23:23:30

您谈论的是捆绑包,它是一个具有扩展名的文件夹,操作系统将其视为单个文件,而实际上它是一个包含资源的文件夹。 NIB 文件以及可执行文件和 info.plist 文件都存储在该捆绑包中。这就是应用程序在 Cocoa 中的工作方式。

解决这个问题的唯一方法是用不同的语言编写您的应用程序,但我不确定哪种语言(如果有的话)会给您一个单一的可执行文件。

您在应用程序目录中存储了哪些您不希望人们访问的内容?

You talking about a Bundle, which is a folder that is given an extension and the OS treats it as if it is a single file, while in reality it is a folder with resources in it. The NIB files are stored in this bundle as well as your executable and the info.plist file. This is just the way apps work in Cocoa.

The only way around it would be to write your app in a different language, but i'm not sure which, if any, will give you a single file executable.

What are you storing in your app directory that you don't want people to have access to?

寻梦旅人 2024-08-12 23:23:30

当然,有一些极其复杂的方法可以做到这一点。例如,您可以对所有资源文件进行 gzip 压缩并在运行时解压缩它们。但这样做没有充分的理由——它所做的只是为您带来更多工作,引入额外的复杂性并使您的应用程序变慢。 Adobe 不会这样做,微软不会这样做,微型 ISV 不会这样做——这只是不可取的。

There are ridiculously complicated ways to do that, sure. For example, you could gzip all your resource files and decompress them at runtime. But there's no good reason to do so — all it does is make more work for you, introduce additional complexity and make your app slow. Adobe doesn't do this, Microsoft doesn't do this, micro-ISVs don't do this — it's just not advisable.

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