I am looking for small bash or python script that will install a .dmg
file.
We'll assume that the dmg contains one or more .app
directories that have to be copied to /Applications
, overriding any already existing directories.
Files or directories not matching the *.app
pattern are to be ignored.
You can mount the disk image using
hdiutil attach -mountpoint <path-to-desired-mountpoint> <filename.dmg>
The disk image will be mounted at the selected path (the argument following -mountpoint
). Then, search for an .app
file and copy the file to /Applications
.
Once you have finished installation unmount the disk image:
hdiutil detach <path-to-mountpoint>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With