Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tigres

macrumors 601
Original poster
Aug 31, 2007
4,214
1,326
Land of the Free-Waiting for Term Limits
I have a silly question.

When you install most anything on osx, why does the DMG file remain mounted; forcing us to eject it manually?

To this day whenever you install java or whatever the open DMG needs to be closed.

Why doesn't apple clean that extra step up?
Am I missing something, or is there a reason for it?
 

triptolemus

macrumors 6502a
Apr 17, 2011
865
1,737
You're asking OS X to guess what a given disk image is in relation to a running application? Or even one that is not running any longer?
 

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
How does OS X tell the difference between a disk image for an Installer package, one for backups, and one for personal files?
 

tigres

macrumors 601
Original poster
Aug 31, 2007
4,214
1,326
Land of the Free-Waiting for Term Limits
So your saying that after an install completes, and I the machine closes the process, let's say Java for instance, that there is no way to auto eject that DMG after the process is complete?

I don't understand why this is (perhaps I am missing something) but why can't the complete command direct the machine that install done, go ahead and eject it now.

Seems simple enough- or perhaps logical that is.
 

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
You're not covering all possible things that could be happening when the disk image is open. The user could be copying files from it, there could be two identically named mounted at the same time and the wrong one could be ejected, maybe the user wants to run the installer package again. There are many different processes that could be accessing the mounted image. How does Mac OS X know if the process exited properly or crashed? Maybe the process is hung or waiting for user input? Why would Java be installing something from a disk image? That would be very unusual as it isn't used as an installation platform on Mac OS X unless it is a customer created installer.
 

tigres

macrumors 601
Original poster
Aug 31, 2007
4,214
1,326
Land of the Free-Waiting for Term Limits
Perhaps I am expressing my questions poorly.

Let me out it this way. Install a fresh copy of osx, you get a popup that Safari needs Java for some website- fine.

Download java. And double click the install package.
Java installs. After completing I have the open Java white disk image (for lack of a better way of explaining). That will remain there until I eject it.

My only question is- on software installs; why doesn't the program eject the disk after success? It cannot because the user can still be using it?

I just find this odd that's all. I am obviously not a programmer so I know I am naive on this a bit.

But it certainly makes sense in my eyes.
 

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
It doesn't eject it because Apple can't account for every foreseeable permutation of the variables that surround the installation of packages stored within a disk image.
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,978
4,543
New Zealand
My only question is- on software installs; why doesn't the program eject the disk after success? It cannot because the user can still be using it?

It can automatically eject; indeed some Adobe installers do (did?) this when installation is complete. It's really a question for the software developer, not Apple.
 

mmomega

macrumors demi-god
Dec 30, 2009
3,888
2,101
DFW, TX
Well a DMG is sort of like an ISO file in a way.

You double click a dmg in OS X or an ISO in Windows and the OS mounts the image, so the OS treats it as if it were an actual disk connected to the machine.

Like someone else mentioned, you have to really force this to whoever created the dmg so that when their installer file completes installing it runs a script to eject the DMG.

Apple can't really have control over this uniformly because some developers have more than 1 file in their dmg. So closing prematurely may cause you to miss a read file or something similar.
Some DMG's don't even have installation files at all.
 

w0lf

macrumors 65816
Feb 16, 2013
1,268
109
USA
DMG have little/nothing to do with installers.

Just because they're often used to distribute applications/installers doesn't mean that's their sole purpose.

It's the job of whoever wrote the installer to eject the mounted dmg and honestly I see no reason to do so.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,463
16,163
California
Perhaps I am expressing my questions poorly.

Let me out it this way. Install a fresh copy of osx, you get a popup that Safari needs Java for some website- fine.

Download java. And double click the install package.
Java installs. After completing I have the open Java white disk image (for lack of a better way of explaining). That will remain there until I eject it.

My only question is- on software installs; why doesn't the program eject the disk after success? It cannot because the user can still be using it?

I just find this odd that's all. I am obviously not a programmer so I know I am naive on this a bit.

But it certainly makes sense in my eyes.

If the developer wants to, they can make the DMG eject at the end of the install process, but for whatever reason most don't.

If you download the Dropbox app DMG and run it, it will eject after the install.

I agree it makes perfect sense to do this.
 

tigres

macrumors 601
Original poster
Aug 31, 2007
4,214
1,326
Land of the Free-Waiting for Term Limits
DMG have little/nothing to do with installers.

It's the job of whoever wrote the installer to eject the mounted dmg and honestly I see no reason to do so.

Why?

If the developer wants to, they can make the DMG eject at the end of the install process, but for whatever reason most don't.

If you download the Dropbox app DMG and run it, it will eject after the install.

I agree it makes perfect sense to do this.

Yes, that is what I thought I just could not recall a good example of a program that did.

I occasionally have to clean up my sons MBP, and there are always 2-4 open installer drives on his desktop needing to be ejected. Not sure what resources if any are being used; but I really find it pointless for the software vender not to build in the auto eject into the DMG.

I really was not blaming OSX or Apple for the cause, but it only happens on OS X verses windows environments.

At any rate, I think it should always be ejected after successful install, (and yes I am only speaking of installing programs, or updating software.)
 

leman

macrumors Core
Oct 14, 2008
19,495
19,632
I really was not blaming OSX or Apple for the cause, but it only happens on OS X verses windows environments.

Windows also does not auto-eject the installation medium after install, so I don't really see what you are comparing. At any rate, if you wish to have such a feature, then you need to ask the developer to provide for it. Apple and OS X cannot do it for you, because they have no way of knowing what is on the disk image and what you are doing with it.

Or, a better approach would be to abandon using the dmg containers for installers. Just zip the app bundle — the code signing will determine whether the file is corrupted or not.
 

j800r

macrumors 6502
Jan 5, 2011
399
140
Coventry, West mids, England
Apples and Oranges. Windows is a completely different OS and handles installations on a completely different way. It installs most crap via executable files. It doesn't use disk images. However if you install something from a disc that disc usually won't auto-eject when you're finished.


I think you're a recent migrant who's looking for a Windows experience on OSX and you're not gonna get that. If you want Windows you need to use Windows cause OSX is a whole other ball game.

When most installs are drag an drop I don't think it's much of a problem to manually eject the disk image after when Windows has you click through a lengthy installer for literally EVERYTHING you install.
 

tigres

macrumors 601
Original poster
Aug 31, 2007
4,214
1,326
Land of the Free-Waiting for Term Limits
Apples and Oranges. Windows is a completely different OS and handles installations on a completely different way. It installs most crap via executable files. It doesn't use disk images. However if you install something from a disc that disc usually won't auto-eject when you're finished.


I think you're a recent migrant who's looking for a Windows experience on OSX and you're not gonna get that. If you want Windows you need to use Windows cause OSX is a whole other ball game.

When most installs are drag an drop I don't think it's much of a problem to manually eject the disk image after when Windows has you click through a lengthy installer for literally EVERYTHING you install.

I am not a migrant, been on OS X for about 10 years.
i think my posts express my question pretty clear. People can stop getting so disjointed regarding the initial question. I have yet to hear a good reason why it is not so.

I suppose everyone just leaves the mounted images on their respective desktops for ages after installs, since it's really no big deal.
 

colourfastt

macrumors 65816
Apr 7, 2009
1,047
964
I am not a migrant, been on OS X for about 10 years.
i think my posts express my question pretty clear. People can stop getting so disjointed regarding the initial question. I have yet to hear a good reason why it is not so.

I suppose everyone just leaves the mounted images on their respective desktops for ages after installs, since it's really no big deal.

No; we install the apps (which most of the time consists of nothing more than dragging the app from the open DMG to the Apps folder) then eject the DMG.
 

igucl

macrumors 6502a
Oct 11, 2003
569
17
I always eject the disks shortly after installing the app. It's not a big deal, and sometimes there are instructional text files from the developer included on the disk image.


I have both Mac and PC, and I think I prefer the OS X way for one main reason. All those Windows installers that extract themselves to prepare for installation, well, they don't clean up after themselves either. They sit there taking up space in various hidden, "temp" folders, usually found in the "AppData" subfolder of a user's folder.


I much prefer that OS X mounts a disk for installation, and then allows it to be ejected and removed, instead of having one's storage slowly eaten up by installer programs.


This is my limited knowledge based on recent experience with Windows 8.1. If someone more knowledgeable on the subject wishes to correct me, please do.
 

Tubamajuba

macrumors 68020
Jun 8, 2011
2,188
2,446
here
As a long time Windows user that switched to Mac two years ago, it's the one thing in OS X that still seems foreign to me. I certainly don't mind ejecting disk images after installations, but the idea of installers being inside disk images still baffles me. Why not just use a plain old .pkg file? I certainly prefer the OS X Installer app over any Windows installation software, but the usage of disk images makes no sense to me. I'm sure there's a good reason, I'm just unaware of it.
 

Intell

macrumors P6
Jan 24, 2010
18,955
509
Inside
The way internet downloads work is that they work best downloading one file such as a zip, exe, or dmg file. pkg files are not one file, they are a folder that Mac OS X sees and manipulates as a file. Because of this, it is not logical or easy to download a pkg file from the internet. In the cases where it is done, often parts of the pkg file is missing, corrupt, or doubled due to how downloads work. Applications in Mac OS X follow this same folder but seen as a file methodology.
 

stu.h

macrumors 65816
May 8, 2010
1,385
578
West Midlands, England.
Or at the final screen of installation successful, a tick box (pre-ticked) could say 'Eject disk image on exit'.

The user could then unstick the box if they wish to keep it mounted.
 

maflynn

macrumors Haswell
May 3, 2009
73,682
43,740
Or at the final screen of installation successful, a tick box (pre-ticked) could say 'Eject disk image on exit'.

The user could then unstick the box if they wish to keep it mounted.

The problem is if the application issues an eject disk command, it will fail because there is an application using that dmg (the program issuing the eject). You need the installer to finish and close before the eject can be accomplished.

I'm sure apple could do something, but in reality, its not that high of a priority. There's a simple solution, clicking the eject triangle on the finder window.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.