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?
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.
This is the conventional way for installing software on macOS.
- 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).
- Once downloaded, you open the .dmg file which will mount the disk image and make it appear as a removable drive.
- 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).
- 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).
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.
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.