25

Every time I download and install software onto my Mac, it mounts a drive with the name of that application. E.g., I installed the IntelliJ IDEA IDE (see the picture below). Every time I then have to eject that drive. Is there a way to disable this?

Enter image description here

4

4 Answers 4

37

Most non-App Store software applications are delivered as a DMG file. A DMG file (with the file extension .dmg) is a file whose content looks just like a small disk.

The DMG is downloaded to your Downloads folder and is opened (automatically or by double clicking). Since the content looks like a small disk, Finder mounts it as if it were a real disk.

You then install the software by, for example, dragging the application from within the mounted disk to /Applications.

Afterwards the DMG remains mounted until you eject it.

Historically the DMG format is a disk like container for Internet downloads where in times past you would have purchased a physical disk (e.g. a DVD, CD or floppy disk). Since a DMG behaves in the same way as a physical disk it requires ejection when you are finished with it.

10
  • 4
    A DMG file is a disk image similar to an ISO but created by Apple.
    – agarza
    May 31, 2021 at 0:37
  • 34
    -1 Because "Since the content looks like a small disk, Finder mounts it as if it were a real disk." makes it sound as if that's a bug. A DMG isn't a 'a file whose content looks like a small disk', but it's a disk image meant to virtualize the process of inserting a physical disk. So when you open a DMG you basically are 'inserting a CD' and then you install from the virtual CD. May 31, 2021 at 9:00
  • 35
    @DavidMulder I think you are splitting hairs. I deliberately styled my answer to match what I thought was the knowledge level of the questioner. Referring to a "disk image" and "virtualising the process" might well cause confusion. And surely a 'disk image' is a file whose content is like a disk - it contains a file system, just like a disk.
    – Gilby
    May 31, 2021 at 9:06
  • 15
    Not a Mac guy but dragging an application from a mounted drive into an applications folder is a lot more intuitive than the Windows or Linux equivalent, unless you're installing from the Windows Store.
    – Alan B
    May 31, 2021 at 15:42
  • 6
    Indeed, DMG stands for Disk iMaGe
    – OrangeDog
    May 31, 2021 at 15:55
15

This is the conventional way for installing software on macOS.

  1. The software is provided on an Apple Disk Image (the .dmg file), the purpose of which is to emulate a physical disk (CD, floppy, etc.) and provide compression if needed (like a ZIP archive). This is functionally very similar to an ISO file (used a lot on Windows) but very different in nature (see What is the difference between ISO and DMG images? for more information).
  2. Once downloaded, you open the .dmg file which will mount the disk image and make it appear as a removable drive.
  3. The installation process usually consists of copying the Application Bundle (.app) from inside the drive to your Application folder, the disk image usually contains a shortcut to the local Application folder for this very purpose (to drag & drop).
  4. Once finished, you are supposed to eject the drive (which will unmount the disk image) and disposed of the image file if no longer required.

This is a just the conventional way that macOS users are accustomed to but not all software follow this procedure :

  • Software from the App Store doesn't follow this procedure but are installed automatically in the background.
  • Some software are provided on an Installer Package File (.pkg) which once open makes the users go through an installation wizard, very similar to an .exe or .msi installer on Windows.
  • Some software are provided as an .app in a ZIP archive, which (following the default behaviour of Safari and Finder) is automatically uncompressed leaving you with only the .app that can be moved from the Download folder to the Application folder without a disk image.

It is in the hand of the software provider to decide how they want to distribute their application. If they provide you with a .dmg file, you'll have to mount and unmount it, there is not much you can do on your side.

If you are more accustomed to a package manager approach (like in linux distributions), you may take a look at Homebrew. It is initially designed for open-source CLI software, but its Cask extension allow for command line management of graphical application (including IntelliJ IDEA for example, you can check if your software is supported here).

6
  • dmgs used for apps are usually read only so the app is copied not moved from the dmg
    – mmmmmm
    May 31, 2021 at 15:20
  • 2
    If you are a developer note that most users don't have Homebrew as it is command line - stick to .dmg or App Store etc
    – mmmmmm
    May 31, 2021 at 15:22
  • 3
    @mmmmmm The last section was aimed at people looking for a package manager (especially useful for software developers) for their own use. It was not intended for app developper to consider as a distribution channel to rely on for their own app. I tried to avoid the confusion in the last edit.
    – zakinster
    May 31, 2021 at 15:46
  • DMGs are a way more user-friendly format than .tar.gz. Application bundles (.app "files") are entire directories and can't be compressed or downloaded conveniently. Having to "run an installer" a la MacOS "package bundles" or "Windows Installers" always seemed stupid and heavy-handed to me. I run one program so I can run another program? Huh? Allowing users to download "virtual thumb drives" seems perfectly natural to me, and I'm a programmer and *NIX system administrator. Jun 2, 2021 at 20:43
  • @ChristopherSchultz I agree with you, but I'm not sure what you're replying to. I didn't mentioned .tar.gz in my answer because that's not something I see a lot on macOS, except for ported linux software but I specifically use Homebrew for this purpose (much quicker to do a brew install xxx than a wget xxx; tar -xvf xxx; mv xxx /...).
    – zakinster
    Jun 3, 2021 at 15:32
1

Just tacking on a few points to the existing answers:

E-mail, web-forms, etc. typically don't let you transmit folders. Mac apps are actually bundles, not files. Bundles are like folders, except that they have a pretty icon, a fancy double-click action (which launches the app, versus opening the folder), extra metadata, and so on.

So this is a problem, you can't transmit these over a lot of internet technologies, because they're not singular files.

For that reason, several technologies were created to convert folder structures into singular files, such as compressed files, .tar tarballs, and indeed, .dmg disk images.

DMGs also have the added benefit of being able to store a background image, icon layout, etc. On the downside, they can't be extracted in a single click as you could with e.g. a zip file.

5
  • 1
    Re: "they can't be extracted in a single click" ... nobody would want that kind of behavior, either, just like you wouldn't want your USB thumb drive to auto-copy its contents onto your Desktop any time you inserted it. Jun 2, 2021 at 20:45
  • 2
    Note that DMGs aren't responsible for providing all that eye candy (background colors/images, icons, custom layouts, etc.): the Finder can do all of that with any old folder. It's just very common for a DMG to include that stuff for branding purposes and/or to clean things up for the user. I always allow Finder to show hidden files and folders and nearly every DMG file I open is scarred by a ghostly .foobar folder or two appearing somewhere the packager didn't think of because most Mac users just use the default configuration for everything. Jun 2, 2021 at 20:48
  • "nobody would want that kind of behavior, either" Eh, if it's a single .app bundle, I would prefer it to just extract in-place. That's why I prefer .zip files for that use-case.
    – Alexander
    Jun 2, 2021 at 20:53
  • "the Finder can do all of that with any old folder." Yes, but can that folder metadata be captured and transmitted formats other than DMG (e.g. tarball or zip)?
    – Alexander
    Jun 2, 2021 at 20:54
  • 2
    That metadata is provided by files on the disk. Specifically, in the .DS_Store file in the folder (or top-level folder in a volume like a DMG). So it can definitely survive a trip through a ZIP file or tarball. Jun 3, 2021 at 14:58
-2

The DMG metaphor will make a lot more sense if you remember that when OS X was released in 2001, most users installed new software via optical discs. They would buy a copy of Microsoft Office (perhaps from RadioShack), insert the CD, click the new volume that appeared on their desktop, and drag Microsoft Word.app to their Applications folder. Afterwards, they would presumably want to eject the CD, put it back in its case, and store it safely away in the back closet.

Of course, some users also installed software via the internet. So Apple, ever trying to keep the UX consistent, came up with an equivalent workflow—users could download "virtual" CDs in the form of .dmg files, and "insert" them with a double click. It was quite clever, really, and indicative of the excellent work Apple was doing at the time.

Today, when 99.99% of software is downloaded via the internet, this process is perhaps in need of a rethink.

2
  • 2
    The problem is how do you package a macOS App it has to have the correct directory structure to run so an unzip or expand dmg like stage is needed anyway.
    – mmmmmm
    Jun 3, 2021 at 18:20
  • @mmmmmm but you could imagine an install flow that didn’t require users to unmount drives at the end. For example, the Mail app lets you send folders as attachments by secretly turning them into zip files with a special mime type in the background. Or it could work more like .pkg’s (the modern “flat” format), or Windows installers. Jun 4, 2021 at 11:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .