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
These can be packaged in an OS X/macOS disk image (
.dmg) or a traditional archive format such as
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.
.dmgs can be given custom icons, custom background images and the layout of the contents can be fixed.
.dmgs 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,
.dmgs 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
.app includes a number of resources in
<appname>.app/Contents/Resources/. These resources include icons, graphics and localisation files such as