how to silently install .dmg in MacOS?
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 :).
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
- goes to your Desktop folder
- grabs DarwinPorts from the opendarwin site
- mounts the dmg
- goes to the newly mounted DarwinPorts volume
- installs the package, targeted to the root, as the root user
- 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!