I've gotten annoyed with manually installing various things from disk images, and I'm in the process of writing my own installer.
The mount code is working nicely, so I thought I'd pass it on.
-------------------------------------------------------------------------
tell application "Finder"
set fndrSel to selection as alias list
if length of fndrSel = 1 then
set dskImgAlias to first item of fndrSel
if dskImgAlias's kind does not contain "Disk Image" then ¬
error "Selected File is not a Disk Image!"
else
error "Problem with Finder Selection!"
end if
end tell
set posixPath to POSIX path of dskImgAlias
set shCMD to "yes | hdiutil mount " & qf(posixPath) & ¬
set diskImgAlias to alias POSIX file (do shell script shCMD)
tell application "Finder"
open diskImgAlias # Redundant when disk image auto-opens, but who cares.
set itemList to (items of diskImgAlias whose kind is not "Alias") as alias list
end tell
-------------------------------------------------------------------------
--» HANDLERS
-------------------------------------------------------------------------
on qf(_text)
return (quoted form of _text)
end qf
-------------------------------------------------------------------------