Mac software can be delivered as as a .app
application bundle (essentially a folder containing all the program resources) or as a .pkg
installer which is a program that installs applications in a similar way to Windows.
Only command line tools are available as plain binaries which would then be copied to somewhere in the user's PATH
such as /usr/local/bin
.
These can be packaged in an OS X/macOS disk image (.dmg
) or a traditional archive format such as .zip
or .tar
.
What is the logic for which software needs to be installed with such a "virtual disk"?
This is largely up to the developer. A .dmg
is just a virtual hard drive not an installer. The choice to utilise a .dmg
is about packaging rather than installation.
If an application is a simple .app
bundle it is self contained and can be run by double clicking it. It is commonly copied to /Applications
for convenience.
In addition to encryption and EULAs on opening, the benefit of a .dmg
over an archive type is branding. .dmg
s can be given custom icons, custom background images and the layout of the contents can be fixed. .dmg
s are commonly also read only so the contents will remain exactly as the developer intended it.
They also force the user to select where they would like an application; when you unzip an archive the contents will typically be extracted to wherever the archive was located. In contrast, .dmg
s will mount in the filesystem and then the .app
bundle must be explicitly copied.
Why doesn't it come as a simple binary file or I don't know what?
A Mac application is more than just a binary. In addition to the the binary (located at <appname>.app/Contents/MacOS/
) an .app
includes a number of resources in <appname>.app/Contents/Resources/
. These resources include icons, graphics and localisation files such as en.lproj
.