hdiutil detach doesn't remove icon from desktop

I am writing an installer script. Using hdiutil, I am able to mount the DMG, copy the bits off and then, supposedly, detach the disk. The detach appears to succeed (paste is from log file capturing output):


08/30/16 21:18:30 APPLY UPDATE: hdiutil detach succeeded

08/30/16 21:18:30 APPLY UPDATE: "disk3" unmounted.

"disk3" ejected.


however, the installer icon is still on the desktop.


Is there a way to get hditutil to remove the icon it put there?


Thanks,


coyot

MacBook Pro, OS X Yosemite (10.10.4)

Posted on Aug 30, 2016 2:51 PM

Reply
4 replies

Sep 12, 2016 3:06 PM in response to leroydouglas

So, Leroy's suggests using hdiutil eject, but the man page says that that's a synonym for detach, which is what I am using.


"detach a disk image and terminate any associated process. dev_name is a partial /dev node path (e.g. "disk1"). As of Mac OS X 10.4, dev_name can also be a mountpoint. If Disk Arbitration is running, detach will use it to unmount any filesystems and detach the image. If not, detach will attempt to unmount any filesystems and detach the image directly (using the `eject' ioctl). If Disk Arbitration is not running, it may be necessary to unmount the filesystems with umount(8) before detaching the image. eject is a synonym for detach. In common operation, detach is very similar to diskutil(8)'s eject."

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

hdiutil detach doesn't remove icon from desktop

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.