Reputation: 28
Is there an elegant way of converting ZIP files to DMG? I would avoid to expand the (many) files manually and then to repack'em to a DMG. Could that be done via terminal, maybe in a single step?
Upvotes: 0
Views: 5981
Reputation: 4802
There is an app called DropDMG that lets you convert between file types. The description on the website claims you go from .zip to a dmg file. The app is not free but they have a free trail available that may work for you.
A terminal command that might work is hdiutil.
hdiutil create -format UDZO -srcfolder folder_to_compress archive_name.dmg
I just tried this on a .zip file and it worked. But note that when I launch the .dmg file I just get the .zip file back.
You could also write a two line script. First line is to unzip the zip file and then use the hdiutil command to make a dmg from the expanded files.
Upvotes: 2