dmg是什么文件格式
DMG files are containers for apps in macOS. You open them, drag the app to your Applications folder, and then eject them, saving you the hassle of the dreaded “Install Wizard” of most Windows apps. So if all they are is a folder for an app, why do we use them instead of just downloading the app itself?
DMG文件是macOS中应用程序的容器。 您将它们打开,将应用程序拖到“应用程序”文件夹中,然后将其弹出,从而避免了大多数Windows应用程序可怕的“安装向导”的麻烦。 因此,如果它们只是一个应用程序的文件夹,为什么我们使用它们而不是仅下载应用程序本身?
为什么macOS使用DMG文件 (Why macOS Uses DMG Files)
The main reason macOS uses DMG files is to make sure the file downloaded properly and wasn’t tampered with. DMG files include something called a checksum, which basically verifies that the file is 100% intact. This is what you see when the file is opening:
macOS使用DMG文件的主要原因是为了确保文件下载正确并且未被篡改。 DMG文件包含一个称为校验和的东西,该校验和基本上可以验证该文件是否100%完整。 这是打开文件时看到的:
This little window first goes through a phase of verifying the file, and then once it’s sure the file is good, moves on to decompressing it. And that’s second reason why macOS uses DMG files: they’re a compressed format (like a ZIP file) that makes your download smaller. Saving your data usage on downloads is always a good thing.
这个小窗口首先经过验证文件的阶段,然后在确定文件正确之后,继续进行解压缩。 这就是macOS使用DMG文件的第二个原因:它们是一种压缩格式(如ZIP文件),可以减小下载量。 节省下载数据的使用量总是一件好事。
那么如何使用DMG文件? (So How Do I Use DMG Files?)
Well, luckily macOS does an excellent job of making everything easy. All you really need to do is double-click the DMG file to open it and mount it to your Mac.
好吧,幸运的是,macOS在简化一切方面做得非常出色。 您真正需要做的就是双击DMG文件将其打开并将其安装到Mac。
The DMG mounts in two places: on your desktop and in the Finder sidebar under your hard drive. Clicking either one of these opens the DMG file.
DMG可以安装在两个位置:在桌面上和硬盘驱动器下的Finder侧栏中。 单击其中任一打开DMG文件。
When you open a DMG file, you’ll usually see two things: the app and a link to your applications folder. Some DMGs—like the Steam DMG shown above—have styled backgrounds, but this is only cosmetic.
打开DMG文件时,通常会看到两件事:应用程序和指向应用程序文件夹的链接。 一些DMG(例如上面显示的Steam DMG)具有背景样式,但这仅仅是装饰性的。
To install the app, drag it into your Applications folder. It may take a second to copy over, but when it’s done, you can launch the app from Launchpad or Spotlight like you would any other app.
要安装该应用程序,请将其拖到“应用程序”文件夹中。 复制可能需要一秒钟,但是完成后,您可以像其他任何应用程序一样从Launchpad或Spotlight启动该应用程序。
Note: Do not launch the app right from the DMG. The app will no longer be there after you eject the DMG.
注意:请勿直接从DMG启动应用程序。 退出DMG之后,该应用将不再存在。
打扫干净 (Cleaning Up)
When you’re done installing the app, you’ll be left with two copies of it, one in DMG form, and one in your Applications folder. The DMG one can go since you don’t need it anymore.
安装完该应用程序后,将剩下两个副本,一个为DMG格式,另一个在Applications文件夹中。 DMG可以使用了,因为您不再需要它了。
First, eject the DMG by right-clicking it and selecting the “Eject” command, or by pressing the eject button next to the disk in finder. This unmounts the DMG file from your system.
首先,右键单击DMG并选择“弹出”命令,或按Finder中磁盘旁边的弹出按钮弹出DMG。 这将从系统中卸载DMG文件。
Next, delete the DMG file itself unless you have a reason for keeping it around.
接下来,删除DMG文件本身,除非有理由保留它。
我可以在Windows中使用DMG文件吗? (Can I Use DMG Files in Windows?)
There’s not much reason you’d want to use DMG files in Windows since they usually contain macOS apps and not Windows apps. But, if you need to get one open, 7-Zip has support for extracting DMGs. If you want to convert the DMG to a different compressed format (like ISO, which is much like the DMG file format for Windows), a tool like dmg2img will get the job done.
您没有太多理由要在Windows中使用DMG文件,因为它们通常包含macOS应用程序而不是Windows应用程序。 但是,如果您需要打开一个文件夹,则7-Zip支持提取DMG。 如果要将DMG转换为其他压缩格式(例如ISO ,与Windows的DMG文件格式非常相似),则可以使用dmg2img之类的工具来完成。
我可以制作自己的DMG文件吗? (Can I Make My Own DMG Files?)
Yes, you can, and doing so is more useful than you might think.
是的,您可以,而且这样做比您想象的有用。
In addition to offering decent levels of compression, DMG files also support 128- and 256-bit AES encryption, which means you can make a compressed folder that’s password protected.
除了提供不错的压缩级别外,DMG文件还支持128位和256位AES加密,这意味着您可以创建一个受密码保护的压缩文件夹。
Open up Disk Utility and choose File > New Image > Image from Folder (or blank image if you want to make an empty DMG file you can add stuff to later). In the window that pops up, select the folder you want to encrypt and click the “Choose” button.
打开“磁盘工具”,然后选择“文件”>“新图像”>“文件夹中的图像”(如果要创建一个空的DMG文件,则为空白图像,可以在以后添加内容)。 在弹出的窗口中,选择要加密的文件夹,然后单击“选择”按钮。
After that, you’ll have the chance to configure some additional options, like where to save the file and whether to use encryption. When you encrypt the folder, your Mac will prompt you to enter your password twice.
之后,您将有机会配置一些其他选项,例如在哪里保存文件以及是否使用加密。 加密文件夹时,Mac会提示您输入两次密码。
Also, by default, DMG file read-only, but if you want a read-write DMG, change the “Image Format” option from “Compressed” to “Read/Write.”
同样,默认情况下,DMG文件为只读,但是如果您要读写DMG,请将“图像格式”选项从“压缩”更改为“读/写”。
That’s about it. When you go to open your new DMG file, it will prompt you for the password you chose. After typing the password, the DMG file will mount like any other.
就是这样当您打开新的DMG文件时,它将提示您输入选择的密码。 输入密码后,DMG文件将像其他任何文件一样挂载。
Except that this time, it’s not just an app. The DMG file contains whatever you stored there.
除了这次,它不仅是一个应用程序。 DMG文件包含您存储在其中的所有内容。
翻译自: https://www.howtogeek.com/362166/what-is-a-dmg-file-and-how-do-i-use-one/
dmg是什么文件格式