
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是什么文件格式