Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Autostart script in .dmg file

Autostart script in .dmg file
Thread Tools
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
May 16, 2003, 12:25 PM
 
Is there a way to make a script run as soon as a user mounts the image.

It looks like Apple does that with some of their images. (e.g. iTunes)
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 16, 2003, 01:46 PM
 
If you mean to copy the files over, you can do this with "hdiutil internet-enable" in ther Terminal (also via recent versions of FileStorm).
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
May 16, 2003, 03:37 PM
 
Disk images can't run arbitrary scripts when they mount. (The world learned how much of a security risk that was with the whole AutoStart/AutoRun fiasco years ago.) The "internet-enable" flag causes it to copy the disk image's contents to the desktop and then trash the disk image, and if the disk image contains an Installer package it'll automatically launch that. But that's it.
Rick Roe
icons.cx | weblog
     
Banned
Join Date: Apr 2002
Location: -
Status: Offline
Reply With Quote
May 16, 2003, 10:26 PM
 
A bit OT, but interesting nevertheless,

you can remotely mount a disk with disk://url

it's quite spiffy, because you don't have to trash the dmg file after..

anyway, developers should start having this option too. it impresses users
     
hayesk  (op)
Professional Poster
Join Date: Sep 1999
Location: Ottawa, ON, Canada
Status: Offline
Reply With Quote
May 19, 2003, 05:29 PM
 
Thanks for the info. Unfortunately, I was looking to make an encrypted disk image, but want to open the files on the disk when the user mounts them. Basically, I want to save an extra step of mounting and then opening.

I'll probably do it via an external applescript installed on the users machine.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:33 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2