Posted  by 

Dmg Package

If you happen to be faced with a package (.pkg) or meta-package (.mpkg) file and want to inspect its contents before you initiate an install, there's a nifty OS X utility that can dump out the files contained inside for your inspection.

_____________________

Jan 20, 2018  DMG is a disk image format for Mac just like an ISO file in Windows. That means, it is possible to mount a DMG file on a virtual disk or write it to a DVD and access its contents. A macOS installation package with DMG extension enables creating bootable installer DVDs. Create a package and policy on the NS server that contains the dmg file and the above script, as described in KB# 24411. Notes: Change the name and paths accordingly to the actual file you are using.

Application Packages

First, I need to backtrack for a minute.

As OS X users, we're familiar with the fact that applications are actually complex folders in disguise—packages in developer lingo. OS X recognizes application packages and knows how to give them their unique icon. There is a contextual menu item, 'Show Package Contents' that allows one to drill into the guts of an application and view all its resources.

Sow Package Contents on an app.
Right click for contextual menu.

Inspecting Installer Packages

One might think, at first, that the OS X command 'Show Package Contents' will work on another package file, an installer that ends in .pkg or .mpkg. That may or may not work depending on how the package file is constructed.

Note that .mpkg files are meta-packages that may contain .pkg files inside them that may be amendable to Show Package Contents.

However, if Show Package Contents isn't provided as a contextual menu option for either type of installer, don't despair. A different kind of tool is needed to analyze it. In this case, one can use a nifty OS X command line tool called pkgutil. It extracts the contents of the package file into its component pieces and can write it all out to a folder for inspection.

The easiest way to get started is to do a simple expand option and write it out to a named folder. The 'man' page, of course, shows all the options. In the simplest case, the terminal commands would be:

Download

In these examples, the destination folder will be in the same folder as the package file, but one could define a path to somewhere else.

Here's what a dump looks like for one of my .mpkg files.

Sample dump of a .mpkg file.

In researching this command, I discovered a nice GUI utility called Pacifist (OS X 10.8 or later) that can drill into, amongst others, .dmg and .pkg files. It's $20 shareware, and if one works in the above mode a lot, it could well be worth the investment. But for casual inspection, the pkgutil command is nice to know about.

One of the most common mistakes I see among new Mac users is fumbling with how to install new software. The process for installing new applications on your Mac can be confusing at first because it differs greatly from Windows’ software installation process. Nevertheless, the Mac method of installing software is actually quite simple and intuitive once you are accustomed to it. If your desktop is littered with DMG files and white “drive”-looking icons, read on!

What are .DMG Files?

Dmg Package

DMG stands for Disk Image, and is a format commonly used to distribute files and applications among Apple computers. A DMG file is like a virtual DVD or hard drive. They can be “mounted” on your Mac in order to work with their contents, or even burned to an actual physical disc.

Play Barbarian.Look, I’m not going to tell you to play any other class than that. Diablo’s, and if you haven’t decided what to play — or you’re thinking of trying something new — I’m here to help by telling you to play a Barbarian.No, that’s it. Icy veins d3 highest dmg spec

In order to understand the concept of a DMG disk image, think of a storage volume such as a CD, DVD, hard drive, or external drive. A DMG file is like one of these devices in that it serves as a means to encapsulate documents, images, software, and other files. The difference is that with a DMG, there is no physical storage medium. There is only the DMG file, which can be written to a hard drive, burned to a CD or DVD, or sent over the Internet.

Dmg Package Os X

In order to work with the contents of a DMG file, you must mount the the disk image to your system. This may sound daunting, however “mounting” a DMG file with Mac OS X is no more complicated than double-clicking it’ icon. The operating system will load the load image and place a new icon both on your desktop, and in the sidebar of the Finder. The icon will have the same name as the DMG, and you’ll be able to browse through its contents like any other folder.

Once you are done working with the contents of the file, you will want to remove or “unmount” it from your system. Do this by opening the Finder and clicking the eject icon next to the virtual drive’s icon. Or, go to the Desktop, click once on the icon, and press CMD+E.

Software installation with Mac OS X is very different than in the Windows world. On a Windows PC you run an installer, tick off a few checkboxes, and wait for the progress meter to reach completion. There usually is no such “installation wizard” on a Mac &emdash; you simply drag and drop the program into your computer’s “Applications” directory. The trick is that most Mac applications are distributed as images called DMG files, and many new Mac users end up running applications directly from the image instead of installing them to the “Applications” directory.

Enough explanation, here’s how to install an OS X app from a DMG file:

  1. Find the downloaded file, which usually ends up in your Desktop or Downloads folder.
  2. Double-click the .DMG file to mount it. A new Finder window showing its contents should appear.
    • If the window also contains a shortcut icon to “Applications”, drag and drop the app onto the shortcut.
    • If not, double-click the mounted volume on your desktop and drag the app icon from there to the “Applications” icon in the Finder sidebar.

Further Explanation

Alright, that was the abridged version. Here’s the long version. I’ve just downloaded the DeskLickr application, and the DeskLickr_1.2.dmg is sitting on my desktop. I double-click it and a new icon labeled “DeskLickr 1.2” appears on my desktop. Here’s what my desktop looks like at this point:

Since most of the time a new Finder window also pops up when the image is ready for use, this one is now sitting on my desktop:

Different applications are going to show you slightly different Finder windows. Each application’s designers like to add their own artwork. Glitter aside, most applications are trying to tell you the same thing. See the arrow pointing from the DeskLickr icon to the “Applications’ shortcut? It’s telling you to drag and drop the icon into that folder. Once you’ve done so, the app will be installed.

If a program doesn’t provide a shortcut to the Applications folder, you’ll need to pop open a new Finder window. Press CMD+N to open a new window, then drag the program over to “Applications” in the left-hand side of the window.

Once the new program is installed it’s time to do some house cleaning. You no longer need the disk image you downloaded, so follow these steps:

  1. Close any Finder windows that have been left open.
  2. Eject the disk image (not the .DMG file). Click on its desktop icon, then press CMD+E.
  3. Delete the .DMG file by dragging it to the trash.

That’s it! Your new Mac application is ready to use. But wait…

Bonus Tip: Add Your New Application to the Dock

Dmg

Dmg Package What Is It

I knew you were going to ask, so I figured I would cut you off at the pass. In order to add the new application to the dock, follow these steps:

Dmg Package.json

  1. Open up a new Finder window.
  2. Click on “Applications”.
  3. Locate your new program’s icon.
  4. Drag the icon to your Dock, and drop it wherever you like.