how to silently install .dmg in MacOS?

to instal a DMG you can do this:

cd ~/Desktop

curl -O http://darwinports.opendarwin.org/downloads/DarwinPorts-1.2-10.4.dmg

hdiutil attach DarwinPorts-1.2-10.4.dmg

cd /Volumes/DarwinPorts-1.2/

sudo installer -pkg DarwinPorts-1.2.pkg -target "/"

hdiutil detach /Volumes/DarwinPorts-1.2/

In a nutshell, this

  1. goes to your Desktop folder
  2. grabs DarwinPorts from the opendarwin site
  3. mounts the dmg
  4. goes to the newly mounted DarwinPorts volume
  5. installs the package, targeted to the root, as the root user
  6. ejects the mounted disc image.

you then can use Automator to do this...

code taken from this page


If you're administrating multiple Macs, I highly recommend investing in a copy of ARD - I'm sure there is a scripting answer to your question, but I've been using ARD for so long, I'm afraid I don't know it!


Is that a DMG plus a PKG?

Because DMG, as is, cannot be installed, it just a volume, an image, like an ISO. So probably what you have is a DMG plus a PKG or an installer inside...

If it's a PKG, probably can be installed remotely or silently, but if it's another installer, it can be more tricky, note sure right now...

Remote desktop also, as adamvs says, can deploy packages into your installs...