Why do Macs mount an additional drive every time I install software?
Solution 1:
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.
Solution 2:
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).
Solution 3:
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.