创建一个.DMG [英] Creating a .DMG

查看:165
本文介绍了创建一个.DMG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为Mac项目创建一个dmg文件.有人可以告诉我该怎么做吗?这是我的第一个Mac项目,我不知道如何进行.我还想给用户一个在启动时运行应用程序的选项.我该怎么做?

I want to create a dmg file for my Mac project. Can someone please tell me how to do this? This being my first Mac project, I do not have any idea how to proceed. I also want to give the user an option of running the app on start-up. How do I do this?

谢谢.

P.S.我还想添加自定义许可协议.

P.S. I also want to add a custom license agreement.

推荐答案

要手动执行此操作:

方法1:

  • 创建一个文件夹,其中包含DMG将包含的文件.

  • 打开磁盘实用程序(在/Applications/Utilities/中)

  • 转到文件>新建>文件夹(Cmd + Shift + N)中的新图像
  • Go to File > New > New Image from Folder (Cmd + Shift + N)

  • 选择包含您文件的文件夹
  • 确保选中压缩",然后设置要保存创建的DMG的位置

方法2:

要做诸如设置背景图像之类的操作可能有些麻烦(您基本上将背景图像添加到DMG中,设置windows属性以使用该图像,使用命令行将背景图像从background.png移至.background.png使其隐藏)

To do things like setting a background image can be a bit convoluted (You basically add the background image to the DMG, set the windows properties to use that image, using the command line you move the background image from background.png to .background.png to make it hidden)

我建议使用 iDMG ,这会使事情变得不那么繁琐.

I would recommend iDMG, which makes things a bit less tedious.

您也可以使用命令hdiutil编写DMG的脚本.类似于

You can also script the creation of DMGs using the command hdiutil. Something along the lines of

hdiutil create -srcfolder mydirtodmg mydmg.dmg

关于自定义许可协议,您应该研究开发人员工具"PackageMaker"附带的工具-这是不言而喻的.在/Developers/Application/Utilities/

As for the custom license agreement, you should look into the tool included with the Developer Tools "PackageMaker" - it's pretty self-explanatory. It's in /Developers/Application/Utilities/

这篇关于创建一个.DMG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆