Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a .dmg MacOS package (with 'continue' buttons, EULA etc) that i need to install on multiple computers. Is it a way to do so silently via a bash/python/ruby/etc script just like silent MSI installation in Windows? I can automate installation writing script that will click buttons for me, but that looks kinda unnatural :).

share|improve this question
up vote 12 down vote accepted

to instal a DMG you can do this:

cd ~/Desktop

curl -O

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

share|improve this answer
ahem... could you just comment that you copypasted ? :D – Andor May 28 '09 at 12:34
what's the point? – balexandre May 28 '09 at 13:12
Giving credit to the original author? – ceejayoz May 28 '09 at 13:57
who tells me that he didn't copied from other ;) – balexandre May 28 '09 at 16:41
what's the point? – Andor May 29 '09 at 9:27

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!

share|improve this answer
to answer the question, and using ARD, see this link: – balexandre May 28 '09 at 9:52

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...

share|improve this answer
.dmg with a .pkg inside. .pkg can be extracted before install, it's no problems. – Eye of Hell May 28 '09 at 10:32
then: – Andor May 28 '09 at 12:33
echo "mounting server"
  mount_afp afp://username:password@yourserver
  hdiutil attach /Volumes/yourserver/pathtodmg.dmg
  /usr/sbin/installer -pkg /Volumes/pathtopkgfile.pkg -target / -verboseR
echo "umounting the repository"
  umount /Volumes/yourserver
    if [ $status != 0 ]
        echo "Something went wront unmounting the server... no problem... we'll just remove the directory"
        rmdir /Volumes/yourserver

I've found this to be really clean way of installing and is almost entirely silent (Except for the initial attach)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.