`
zengxx1989
  • 浏览: 300408 次
  • 性别: Icon_minigender_1
  • 来自: 湖南
社区版块
存档分类
最新评论

Building Fancy DMG Images on Mac OS X

阅读更多
On Mac OS X, applications are usually distributed using disk images (DMG’s). These images are mounted as a separate volume, and it often suffices to drag the application out of the image into your Applications folder. A nice extra feature of these disk images is that their look can be customized, just as every other folder under Mac OS X.

This document explains how such DMG files with a customized look can be built. Moreover, a Makefile is provided such that, once a template look is created for a DMG, the process of building a DMG file from a set of files can be fully automated.

If you have comments or suggestions for this page, please drop me a note.

Creating the template
First, we’ll start by specifying how our disk image should look when it is mounted (and opened). If you don’t need a fancy look, you can skip this section; the Makefile provided at the end of the page will automatically create a default template if you don’t create one yourself.

Using Disk Utility (which comes with Mac OS X), create a new disk image, and call it template.dmg. Select a size which is more than enough to store the contents you plan to put in the final DMG. The Encryption and Format settings (None and r/w respectively) should be left untouched. Then, create your image by clicking Create.
Open the newly created image.
From the View menu of Finder, choose Show View Options You can now customize the way your folder will look. Be careful, don’t forget to select This window only, such that your changes will only apply to the current folder. Using the View menu, you can change the looks of the window even further. Also note that, if you choose a background picture, the picture file must reside in the image itself. It is common to create a (hidden) directory .background in the root dir of the image, dropping the background picture there, and then selecting it as a background. Use Cmd-Shift-G in combination with the full path (e.g. /Volumes/MyDisk/.background) to open the hidden directory in Finder and copy your picture there (or, alternatively, use Terminal). The Select button in the View menu seems to open the .background dir by default if it exists. If not, also use Cmd-Shift-G.
Drag all the files you want in your image into the volume, and place them exactly where you want to. Assign icons to the files by control- clicking on the icons, and using the Show Info dialog. Note that the actual contents of the files in the template does not matter if you are planning to use the automatic build way; they will be overwritten anyway. Hence, you will get the most compact template if all your files are empty.
Customize the icon of the disk image in the same way as the other icons, only this time by control-clicking on the disk image icon on the desktop.
Eject the disk image.
Since the template.dmg file will be quite big, you probably want to compress it using bzip2. This is not strictly necessary, but if you created an initial disk size of 40M, using bzip2 you can reduce this to only 1M.
If all went well, you should now have a template.dmg(.bz2) which, when you open it, has a custom icon on the desktop, and looks exactly how you would like the final disk image to be. Now all we need to do is fill it up with the right files.

Manually building the final DMG
The easiest (but least efficient) way to create a final DMG is by doing it by hand. If you want to do this manually, I assume that you dragged the exact files you want the image to contain in the previous section. All you have to do then is:

Open Disk Utility
Select the image you created in the previous step
Select Convert… from the Images menu
Enter the name you want your final image to get
Select Compressed as your Image Format
Click Save
That’s it, your final DMG should be ready for distribution.

Automatically building the final DMG
Using the template we just created, we can now automatically build a DMG with the actual files. All you need to do is download this Makefile, modify the values on the top of the file, and run make. Alternatively, you can include the Makefile from within another Makefile after setting the proper values, as is illustrated in the example of the fancy-dmg package (also available from the Git repository)

The values that can be modified are:

NAME: The name of your application. This name will appear as the volume name of your disk image.
VERSION: The version number of your package. This is used in the filename of the final disk image.
SOURCE_DIR: The directory where the files you want in your disk image reside.
SOURCE_FILES: The names of the files (without the directory prefix) you want in your source image.
TEMPLATE_DMG: The name of the template DMG file (without the .bz2 extension if it was compressed)
Note that you don’t really need a template.dmg. If the Makefile can’t find one, it will create its own, default disk image.

7 Responses to “Building Fancy DMG Images on Mac OS X”
Michael Henderson » Blog Archive » Creating a Mac OS X Application and Installer says:
May 8, 2006 at 2:47
[...] El Tramo >> Building Fancy DMG Images on Mac OS X Bringing your Java Application to Mac OS X Adobe – Director TechNote: Considerations for creating a Macintosh projector bundle [...]

David Golding Design | | Web and Print Solutions says:
September 21, 2006 at 4:12
[...] Fortunately, Remko Troncon’s blog gives detailed instructions on how to not only add a background image to your disk, but also customize the view. I found it incredibly helpful for creating flashy disks and disk images for the Mac. [...]

Paketering av program - 99mac says:
September 21, 2006 at 11:47
[...] Alternativ 1: Creating a Package Alternativ 2: Building Fancy DMG Images on Mac OS X Detta �r ocks� en bra l�nk: Files & Software Installation [...]

AsUnit XUL UI for OS X at Aral Balkan says:
December 14, 2006 at 23:53
[...] Finally, package it into a DMG. I found these instructions for creating a DMG by Remko Tronçon to be very useful and owe a debt of gratitude to Adium, from which I ripped the background graphic and symlink for the Applications folder. AsUnit-X doesn’t have its own icon yet but that may change in the near future (OS X-style icon donations are welcome!) [...]

Ordner-Erscheinungsbild fixieren - Apfeltalk says:
February 14, 2007 at 18:42
[...] mal stellvertretend… Fuer solche huebschen DMGs gibt’s viele Anleitungen im Internet, und diese hier z.B. find’ ich klar strukturiert und gut verstaendlich. __________________ The Original [...]

The End of the Long Tail » Come and Get It! Interactive Renamer 1.0 says:
August 11, 2007 at 19:47
[...] developing some mad Photoshop skillz! A kind thanks to Remko and this entry on his El Tramo blog for the walk through on creating a nice looking DMG. Posted under Snooty [...]

Links: El Tramo » Building Fancy DMG Images on Mac OS X says:
September 20, 2008 at 0:58
[...] El Tramo » Building Fancy DMG Images on Mac OS X – How to build fancy disk images (with background images ,etc.) on Mac OS X, plus some ways to automate the process from the command line (tags: macosx dmg image howto reference ) Tags: dmg · howto · image · Linky · macosx · reference [...]

1.准备软件:
                DropDMG 英文原版 下载地址 http://c-command.com/dropdmg/
                破解:Name: Le Good Life
                             SN: drpdmg2-R1FJ-9F92-0M55-0203-RX48
2.制作方法:
                将你要打包的文件放到一个文件夹里,然后拖动这个文件夹到DropDMG的窗口(如图1),然后就会在同一目录下生成DMG。如果你的文件夹中有app文件(可执行文件),则生成的DMG文件在装载成虚拟磁盘后,会将这个app文件的图标贴在普通的白色图标上面,并且是立体效果(图2)。注意:请把DropDMG设置选项(Preferences...)里面use custom icon for mounted image勾选上。如果你想自己另外设置图标,就要在DropDMG菜单栏点击 Convert graphic to "Volumeicon.icns" ,然后选择你要转换的图片或者已经有的图标文件,最后将生成volumeicon,icons的路径设置到你要转换成dmg文件的文件夹中(根目录)。
                接下来说一下让dmg文件装载之后,在虚拟磁盘文件夹中显示背景图片,这个就要稍微麻烦一些了。首先将你想设置为背景的图片放到准备转换为dmg的文件夹里,可以放在这个文件夹的其他目录下,然后在DropDMG设置里面,选择转换模式为.dmg Read and write模式,之后转换成dmg,这个dmg并不是最终完成品,请装载它,打开这个虚拟磁盘的根目录,在这里点击右键,选择“查看显示选项”,注意选择“仅这个文件夹”以及最下面的“背景”(选择那张图片),现在你的文件夹显示有背景了吧,好,弹出这个可读可写的虚拟磁盘,设置DropDMG,吧模式改回.dmg read only ,再把这个dmg文件拖到DropDMG里面转换,最后生成的就是你要的东西了。


  • 大小: 325.3 KB
分享到:
评论

相关推荐

    fancy-dmg:制作精美 DMG 图像的工具

    总之,`fancy-dmg`是一个强大的工具,它结合了Makefile的自动化能力和对DMG图像的高级定制,为Mac OS X平台的软件开发者提供了创建精美、用户友好的分发工具。通过熟练掌握和使用这个工具,开发者可以提高他们的产品...

    I wanna be the Fancy ver1.02

    《I Wanna be the Fancy》是一款基于经典游戏"I Wanna"系列的独立制作游戏,版本为ver1.02。这款游戏以其高难度和独特的关卡设计深受玩家喜爱,是平台跳跃类游戏中颇具挑战性的一款。在尝试运行《I Wanna be the ...

    fancy_on_boarding:Fancy OnBoarding屏幕库

    【fancy_on_boarding:Fancy OnBoarding屏幕库】 `fancy_on_boarding` 是一个专门为 Flutter 应用程序设计的高级迎新(OnBoarding)屏幕库。在移动应用开发中,OnBoarding 屏幕通常用于引导新用户了解应用的核心...

    Fancy Footwork

    Fancy Footwork

    fancy用法点津.doc

    例如,句子"And do you fancy going to the dance on Saturday night?" 中,“fancy”表示的是“想要去”的意思。这种用法常见于日常对话中,如"I fancy a swim"(我想游泳)或"I fancy going to the cinema with my...

    Fancy Upload + ASP.NET 大文件上载

    "Fancy Upload + ASP.NET 大文件上载"是解决这一问题的一种方案,它结合了Fancy Upload组件与ASP.NET技术,提供了一种高效且用户友好的文件上传体验。 Fancy Upload是一个JavaScript库,设计用于创建吸引人的、具有...

    Fancy+Skies+[v1.1].zip

    标题"Fancy Skies [v1.1].zip"暗示我们正在处理一个游戏资源包,可能是为Minecraft这样的沙盒游戏设计的。版本号"v1.1"表明这是该资源包的一个更新版本,通常意味着修复了错误或添加了新的特性。 在描述中,同样...

    Fancy Widget 2.0.2

    使用「Fancy Widget」馬上讓你的Andorid手機擁有類似HTC Sense的氣象時鐘。

    Android代码-Fancybuttons

    Fancybuttons Icons, Borders, Radius ... for Android buttons Overview Demo Application : Download APK Features Border (stroke, radius, color) Background (normal, focus) Icon (Drawable, font icon)...

    Fancy Form Design

    ### Fancy Form Design:打造引人注目的网页表单设计 #### 标题解析与扩展知识点 **Fancy Form Design** 这个标题简洁明了地指出了本书的主要内容——如何设计出美观且实用的网页表单。在网页设计领域,表单是用户...

    numpy的Fancy Indexing和array比较详解

    在Python的科学计算库NumPy中,Fancy Indexing是一种高级索引方式,它允许我们使用整数数组、布尔数组或其他数组来选取原数组中的特定元素。本文将深入探讨Fancy Indexing及其与常规数组操作的比较。 首先,让我们...

    【WordPress插件】2022年最新版完整功能demo+插件v1.3.5.zip

    Fancy Product Designer Plus Add-Ons 花式产品设计师加附加组件" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目...

    JS+CSS Fancy Menu

    **JS+CSS Fancy Menu**是一种使用JavaScript和CSS技术创建的高级导航菜单,它以其流畅的交互性和独特的视觉效果而受到广泛关注。在网页设计中,菜单是用户与网站交互的重要元素,一个美观且易于使用的菜单可以极大地...

    华丽应用切换 Fancy Switcher v3.1.1 正式版

    当前版本:3.1.1 软件语言:中文 ...华丽应用切换Fancy Switcher是一款增强型的应用快速切换和管理工具,它可以通过手势轻松调出最近使用的App。支持特效和风格包,并可自定义各项视觉元素。相当的漂亮!

    爱上表单设计Fancy-Form-Design

    《爱上表单设计Fancy-Form-Design》是一本专注于前端开发中表单设计的专业书籍。这本书虽然篇幅不长,但内容精炼且全面,涵盖了表单设计的各个环节,对于前端开发者,尤其是对用户体验有高要求的设计师来说,是一本...

    Drupal fancy

    比如,可以使用视图(Views)模块创建动态内容展示,使用响应式图像(Responsive Images)模块优化移动设备的显示,或者使用 Webform 模块创建表单。 **主题配置**: Drupal 提供了后台的主题配置界面,允许非开发者...

    变态玛丽FANCY阿鑫修改版

    【标题】"变态玛丽FANCY阿鑫修改版"是一个基于经典游戏《超级玛丽》的非官方修改版本,由玩家FANCY阿鑫进行了一系列创新和调整,为玩家带来全新的游戏体验。这种修改版通常包含了对原游戏关卡设计、角色能力、图形...

    JSQSystemSoundPlayer, 面向 Cocoa 系统声音服务的fancy封装器.zip

    JSQSystemSoundPlayer, 面向 Cocoa 系统声音服务的fancy封装器 JSQSystemSoundPlayer Cocoa 系统声音服务的高级 Obj-C 包装器,适用于iOS和 OS X 。 这个库是一个重量轻的组件,可以在你的应用程序中播放声音效果。 ...

    变态玛丽fancy修改版以及源码

    《变态玛丽fancy修改版及源码》是一个独特的游戏作品,源自经典的马里奥游戏,但经过FANCY的创新性改动,呈现出全新的视觉风格和游戏体验。此压缩包包含了两个主要内容:游戏本身和源代码。 首先,让我们来探讨一下...

Global site tag (gtag.js) - Google Analytics