Why doesn't OS X eject the DMG?

Discussion in 'OS X Yosemite (10.10)' started by tigres, Sep 4, 2014.

  1. tigres macrumors 68040

    tigres

    Joined:
    Aug 31, 2007
    Location:
    Land of the Free-Waiting for Term Limits
    #1
    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?
     
  2. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #2
    How is Mac OS X to know you are done with a disk image or not?
     
  3. tigres thread starter macrumors 68040

    tigres

    Joined:
    Aug 31, 2007
    Location:
    Land of the Free-Waiting for Term Limits
    #3
    Because the program completes Intallation.
     
  4. triptolemus macrumors 6502

    triptolemus

    Joined:
    Apr 17, 2011
    #4
    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?
     
  5. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #5
    How does OS X tell the difference between a disk image for an Installer package, one for backups, and one for personal files?
     
  6. tigres thread starter macrumors 68040

    tigres

    Joined:
    Aug 31, 2007
    Location:
    Land of the Free-Waiting for Term Limits
    #6
    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.
     
  7. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #7
    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.
     
  8. tigres thread starter macrumors 68040

    tigres

    Joined:
    Aug 31, 2007
    Location:
    Land of the Free-Waiting for Term Limits
    #8
    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.
     
  9. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #9
    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.
     
  10. Nermal Moderator

    Nermal

    Staff Member

    Joined:
    Dec 7, 2002
    Location:
    New Zealand
    #10
    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.
     
  11. airlied macrumors regular

    airlied

    Joined:
    Jul 8, 2011
  12. mmomega macrumors demi-god

    mmomega

    Joined:
    Dec 30, 2009
    Location:
    DFW, TX
    #12
    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.
     
  13. w0lf macrumors 65816

    w0lf

    Joined:
    Feb 16, 2013
    Location:
    USA
    #13
    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.
     
  14. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #14
    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.
     
  15. tigres thread starter macrumors 68040

    tigres

    Joined:
    Aug 31, 2007
    Location:
    Land of the Free-Waiting for Term Limits
    #15
    Why?

    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.)
     
  16. leman macrumors 604

    Joined:
    Oct 14, 2008
    #16
    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.
     
  17. iBanker macrumors regular

    Joined:
    Aug 14, 2014
    Location:
    46th floor
    #17
    I've always wondered about this - thanks for the explanations above.
     
  18. j800r macrumors regular

    Joined:
    Jan 5, 2011
    Location:
    Coventry, West mids, England
    #18
    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.
     
  19. tigres thread starter macrumors 68040

    tigres

    Joined:
    Aug 31, 2007
    Location:
    Land of the Free-Waiting for Term Limits
    #19
    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.
     
  20. colourfastt macrumors 6502a

    colourfastt

    Joined:
    Apr 7, 2009
    #20
    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.
     
  21. igucl macrumors 6502a

    igucl

    Joined:
    Oct 11, 2003
    #21
    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.
     
  22. Tubamajuba macrumors 68000

    Joined:
    Jun 8, 2011
    #22
    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.
     
  23. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #23
    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.
     
  24. stu.h macrumors 65816

    stu.h

    Joined:
    May 8, 2010
    Location:
    West Midlands, England.
    #24
    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.
     
  25. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #25
    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.
     

Share This Page