Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create an auto-opening disk image System
Ever wondered how to create a disk image that mounts and opens when you instert it? For example, the Apple OS X install CD "autostarts;" that is, the root folder of the CD (or .DMG) opens up when you pop it in. Here's how to create your own auto-open disk images.

Make sure yer AppleScript Script Menu widget is enabled. Go to Applications -> AppleScript, and drag "Script Menu.menu" to the main menubar; you'll now have a small AppleScript icon in your menubar.

Make a disk image of the CD that you want to burn (or in fact, an actual *.DMG), and mount that image. Now go to the new Script Menu icon, and select Folder Actions -> Attach Action to Folder -> Open, and navigate to your mounted disk image, select that, and you're done. Now all you need is a custom background, and some cool icons, and you're all set!

I don't know if this hint is any good, but it made me very happy when I found out how to do it!

[Editor's note: I have not tested this hint myself.]
    •    
  • Currently 2.50 / 5
  You rated: 2 / 5 (2 votes cast)
 
[22,155 views]  

Create an auto-opening disk image | 15 comments | Create New Account
Click here to return to the 'Create an auto-opening disk image' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Removing the applescript menu
Authored by: charliemorss on Nov 18, '02 11:58:44AM

This may be a dumb question, but how the heck do you remove the script menu when you don't wan't it anymore?!? Thanks...



[ Reply to This | # ]
Removing the applescript menu
Authored by: pete on Nov 18, '02 12:06:09PM

Command-drag it off the menu bar. That's all.



[ Reply to This | # ]
Removing the applescript menu
Authored by: Vent on Nov 18, '02 04:02:26PM

Just hold down the Apple (Command) key while dragging the script menu out of the menubar.



[ Reply to This | # ]
Removing the applescript menu
Authored by: murphyc on Nov 19, '02 09:42:11PM

Command-drag it from the menubar.

al



[ Reply to This | # ]
Or use DropDMG
Authored by: andrewz on Nov 18, '02 12:11:00PM

DropDMG 2.0 now supports creating auto-open disk images as well.



[ Reply to This | # ]
Or use DropDMG
Authored by: PapaJosh on Nov 18, '02 12:21:05PM

FileStorm (from mindvision software) will also allow you to do this. It actually does everything described in the article (allows you to create a .dmg with a background, set all the properties on the window, specify it as Auto-Open, set a custom icon for the disc, and burn it to a CD). It also allows you to create installers. Pretty damn awesome! Check it out at www.mindvision.com/filestorm.



[ Reply to This | # ]
Or use DropDMG
Authored by: smallduck on Nov 21, '02 01:14:07AM

This site must have a bug because the previous poster had his sig stripped. Judging from another one of his posted comments, it should have read:

Josh Ferguson
QA Engineer
MindVision Software (makers of Installer VISE)

:-) just poking fun, I'm sure their OS X product is delightful.



[ Reply to This | # ]
Security???
Authored by: ScooterComputer on Nov 18, '02 01:36:26PM

Does this hint beg the question: Isn't this a security risk?
I mean, if any disk image/CD can fire Applescripts upon insertion, what is to stop an embeded script from pulling a dreaded 'do shell script "rm -R ~"?

Most of your home dir would be nuked before you knew what happened!

And I thought the fact that Apple's Installer doesn't run in a sandbox was bad (everyone does realize that Installers can run pre- and post-install/upgrade scripts as root and DO ANYTHING, as long as you have authorized prior to the install). Apple needs to start doing some security housecleaning and documenting FAST. Otherwise they are going to have a mess on their hands.



[ Reply to This | # ]
Security???
Authored by: mervTormel on Nov 18, '02 01:54:35PM


i agree. this has always seemed, to me, an exploit just waiting to get legs.



[ Reply to This | # ]
Security???
Authored by: mahakali on Jan 06, '03 04:10:10AM
I tried it, it wouldn't run for some reason. I made a doc on my desktop "rm.txt" and an image then attached this script to the mounted volume: do shell script "rm -f ~/Desktop/rm.txt". I unmounted it and mounted it back again. Nothing happened.

[ Reply to This | # ]
Security???
Authored by: Jaharmi on Dec 04, '03 03:01:07PM

I'm not sure that "do shell script" runs scripts as your user, or even in your normal shell. There's a TechNote about "do shell script" and how it works on the Apple Developer site.



[ Reply to This | # ]
Simpler way?
Authored by: vonleigh on Nov 19, '02 12:25:21AM

I remember that before if you burned the CD with the window open, said window would open on it's own on insertion of the CD. I wonder if this still works, anyone care to comment?


v



[ Reply to This | # ]
Simpler way?
Authored by: ClassicUser on Mar 01, '09 07:26:44PM
I remember that before if you burned the CD with the window open, said window would open on it's own on insertion of the CD. I wonder if this still works, anyone care to comment?
Nope - unfortunately, this is very inconsistent. The Finder seems to not reflect the right state of the volume in some cases, while it does in others.

All sorts of workarounds have been discussed, but the easiest approach is to ensure the HFS+ volume header has the correct setting - as is done by the simple one-trick-pony "AutoOpen" http://autoopen.nibfile.com/

[ Reply to This | # ]

Set flag in HFS+ volume header instead
Authored by: daniel_steffen on Nov 20, '02 08:56:51AM
The right way to do this is to set a flag in the finder info of the HFS+ volume header, as explained in the following post & sample code by an Apple filesystem engineer on the macosx dev list:

Making mounted DMGs pop up

The sample code compiles trivially using the commandline included in the header comment and works very well for me.

[ Reply to This | # ]

Set flag in HFS+ volume header instead
Authored by: ClassicUser on Mar 01, '09 07:39:11PM
Agreed - this is the way to achieve the desired effect.

For my money, the best way to ensure this works as needed, is to utilize the wonderfully-simple "AutoOpen" http://autoopen.nibfile.com/

[ Reply to This | # ]