A DMG file is a sort of disk image file. Mac OS X opens these files and mounts them in a similar way to how it mounts USB thumb drives or external hard drives.
The format allows secure password protection as well as file compression and hence serves both security and file distribution functions. Its most common function is the distribution of software over the Internet. When opened, DMG files are “mounted” as a drive within the Finder.
When you download a DMG file from the web, Safari and other Mac browsers may open and mount the DMG file automatically, usually on the Desktop. New users think that the application is installed and run it from the icon on the Desktop. Of course when the Mac is shutdown or restarted the DMG file is unmounted. Users boot into their Mac and panic because their program has been deleted.
The proper way to install a Mac application from the DMG (or ZIP) file is simpler. Once the DMG file is mounted (double click the DMG file), find the application icon and drag it to the Application folder.
You will be prompted for the system admin user name and password.
Mac OS X will copy all the application files to the Application folder. That’s it. The app is now installed. To uninstall the app, drag the app icon from Applications to the trash can. Done.
Don’t forget to unmount (eject) the DMG file. You can do that from the Finder.