问题描述
我正在寻找一个需要在 Windows 和 OSX 上运行的应用程序.由于我已经非常熟悉 C#/.NET,我想我会看看使用 Mono.但我也希望它非常易于安装,并且不希望用户必须单独安装 Mono 包.是否可以创建一个包含所有内容的 OS X .app 包?也就是说,我的应用、资源和完整的 Mono 运行时?
I'm looking to work on an application that needs to run on both Windows and OSX. Since I'm already very familiar with C#/.NET I thought I would take a look at using Mono. But I also want it to very easy to install and don't want the users to have to install the Mono package separately. Is it possible to create an OS X .app bundle that simply includes EVERYTHING? That is, my app, resources and the complete Mono runtime?
推荐答案
是的,你可以这样做.选择一个应用程序,任何应用程序,然后显示包内容.稍微探索一下,您会发现里面有一个 Contents/MacOS 目录.它将包含一个设置了执行位的文件.这可以是机器代码或任何以 #!
开头的旧脚本.你需要做的就是用一个骨架应用程序复制目录结构,将你的 Mono 运行时推到某个地方的 Resources 目录中,然后编写一个初始化所有内容的 bash 脚本.可能有自动实用程序可以在某处执行此操作,但手动执行此操作非常容易.
Yes, you can do this. Pick an app, any app, and Show Package Contents. Explore around a bit and you'll see that there's a Contents/MacOS directory inside. It will contain a file with the execute bit set. This can be machine code or any old script with a #!
line at the beginning. All you need to do is duplicate the directory structure with a skeleton app, shove your Mono runtime into the Resources directory somewhere, and write a bash script that initializes everything. There may be automated utilities for doing this floating around somewhere, but it's pretty easy to do this manually.
我建议使用您最喜欢的构建工具来自动执行此过程.
I'd recommend using your favorite build tool to automate this process.
这篇关于可以在 OSX .app 包中包含 Mono 运行时吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!