Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 2, 2011, 01:37 AM   #1
hehe299792458
macrumors 6502a
 
hehe299792458's Avatar
 
Join Date: Dec 2008
autorun on Mac

Is there a way to configure a disk image such that every time I mount it, a file contained within the disk image automatically opens?
hehe299792458 is offline   0 Reply With Quote
Old Jun 2, 2011, 10:30 PM   #2
MisterMe
macrumors G4
 
Join Date: Jul 2002
Location: USA
Quote:
Originally Posted by hehe299792458 View Post
Is there a way to configure a disk image such that every time I mount it, a file contained within the disk image automatically opens?
Autorun of executables on removable storage is a huge security risk. You cannot do that on a Mac.
__________________
Neither a borrower nor a lender be
For loan oft loses both itself and friend
William Shakespeare from Hamlet
MisterMe is offline   0 Reply With Quote
Old Jun 2, 2011, 10:34 PM   #3
hehe299792458
Thread Starter
macrumors 6502a
 
hehe299792458's Avatar
 
Join Date: Dec 2008
Quote:
Originally Posted by MisterMe View Post
Autorun of executables on removable storage is a huge security risk. You cannot do that on a Mac.
I agree that it can be a security risk.
But firstly, it's not removable storage - it's an image file I created. And secondly, it's not an executable. It's a html document that I created.
hehe299792458 is offline   0 Reply With Quote
Old Jun 2, 2011, 10:36 PM   #4
r0k
macrumors 68040
 
r0k's Avatar
 
Join Date: Mar 2008
Location: Detroit
Autorun is part of a bad nightmare I remember from my windows days along with "hide extensions." I might not be the typical switcher who is looking for Windows-like things on OS X because I used Linux before OS X and one of my favorite things is I could click on stuff I wanted to happen and stuff I didn't click on never ever happened. What a concept.

The reason Apple has disabled this is security. They don't want malware, adware or crippleware launching when you insert a CD. I seem to remember there were DRM programs Sony used to include on music CDs that would install and run before you knew what was going on. Whether it's some greedy company trying to stop you from listening to stuff you bought unless you pay for it over again or some hacker trying to steal your logon Apple wants no part of that nonsense and I don't blame them one bit. The itsy bitsy down side is you gotta click to run something. Now where'd I put my violin?



BTW, while I agree that running something you created from a dmg, memory stick or even a cd would be nice, html can include malware these days and I don't mind the situation we are in. Suppose there was a big switch you could throw to enable autorun. You get your project done and forget about it. About 3 years later, a friend comes over, inserts some CD in your Mac and it installs something you don't want or need before you realize it.

There is only a handful of malware out for OS X, but one in particular relies on a user to be logged in as Admin and running Safari. Malware gets downloaded and installed if the user has left "automatically open safe files" enabled. And wouldn't you know a dmg is considered a safe file, even if you just downloaded it from hackerz.gunning.4.u
__________________
-r0k
Macbook Pro (late 2011) + iPad mini + iPhone5 + (GS4 for work)
Got a scan to ftp scanner? Enable ftpd in Mavericks!

Last edited by r0k; Jun 2, 2011 at 10:43 PM.
r0k is offline   0 Reply With Quote
Old Jun 2, 2011, 11:06 PM   #5
hehe299792458
Thread Starter
macrumors 6502a
 
hehe299792458's Avatar
 
Join Date: Dec 2008
Quote:
Originally Posted by r0k View Post
Autorun is part of a bad nightmare I remember from my windows days along with "hide extensions." I might not be the typical switcher who is looking for Windows-like things on OS X because I used Linux before OS X and one of my favorite things is I could click on stuff I wanted to happen and stuff I didn't click on never ever happened. What a concept.

The reason Apple has disabled this is security. They don't want malware, adware or crippleware launching when you insert a CD. I seem to remember there were DRM programs Sony used to include on music CDs that would install and run before you knew what was going on. Whether it's some greedy company trying to stop you from listening to stuff you bought unless you pay for it over again or some hacker trying to steal your logon Apple wants no part of that nonsense and I don't blame them one bit. The itsy bitsy down side is you gotta click to run something. Now where'd I put my violin?

Image

BTW, while I agree that running something you created from a dmg, memory stick or even a cd would be nice, html can include malware these days and I don't mind the situation we are in. Suppose there was a big switch you could throw to enable autorun. You get your project done and forget about it. About 3 years later, a friend comes over, inserts some CD in your Mac and it installs something you don't want or need before you realize it.

There is only a handful of malware out for OS X, but one in particular relies on a user to be logged in as Admin and running Safari. Malware gets downloaded and installed if the user has left "automatically open safe files" enabled. And wouldn't you know a dmg is considered a safe file, even if you just downloaded it from hackerz.gunning.4.u
Thanks for that really detailed explanation. Macs' lack of an autorun feature is a really good security precaution. But is there a way to bypass it?

I know it's a security risk, but for this one disk, I think I'm pretty safe. Trust me when I say the files on the disk image are 100% safe and created entirely by me. Is there a workaround to the autorun thing? Perhaps some sort of automator script?
hehe299792458 is offline   0 Reply With Quote
Old Jun 3, 2011, 08:44 AM   #6
GGJstudios
macrumors Westmere
 
Join Date: May 2008
Quote:
Originally Posted by hehe299792458 View Post
Thanks for that really detailed explanation. Macs' lack of an autorun feature is a really good security precaution. But is there a way to bypass it?
No, there isn't.
GGJstudios is offline   0 Reply With Quote
Old Jun 3, 2011, 09:16 AM   #7
Krevnik
macrumors 68020
 
Krevnik's Avatar
 
Join Date: Sep 2003
Quote:
Originally Posted by hehe299792458 View Post
Thanks for that really detailed explanation. Macs' lack of an autorun feature is a really good security precaution. But is there a way to bypass it?

I know it's a security risk, but for this one disk, I think I'm pretty safe. Trust me when I say the files on the disk image are 100% safe and created entirely by me. Is there a workaround to the autorun thing? Perhaps some sort of automator script?
The workaround that would let you do this also allows malware in. Hence no workaround.

Even with automator, you have to run the script which is double-clicking something.

What is the HTML? Is it a license or similar? If so, DMGs support displaying a license that must be accepted in order to open it.
__________________
iMac 2013 27", 13" rMBP, iPad 4, iPhone 5s
Krevnik is offline   0 Reply With Quote
Old Jun 3, 2011, 09:38 AM   #8
Jolly Jimmy
macrumors 65816
 
Jolly Jimmy's Avatar
 
Join Date: Dec 2007
If it's just one particular image you're looking to mount then an applescript to mount and open the file may be a solution.
Jolly Jimmy is offline   0 Reply With Quote
Old Jun 3, 2011, 09:45 AM   #9
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Can you attach a Folder Action to the root folder in a DMG?
robbieduncan is offline   0 Reply With Quote
Old Jun 3, 2011, 10:18 AM   #10
maflynn
Moderator
 
maflynn's Avatar
 
Join Date: May 2009
Location: Boston
As others stated there isn't a way and it would be a security problem regardless of the fact that most of the time you'll be running a safe app.
__________________
~Mike Flynn
maflynn is online now   0 Reply With Quote
Old Jun 4, 2011, 03:44 AM   #11
hehe299792458
Thread Starter
macrumors 6502a
 
hehe299792458's Avatar
 
Join Date: Dec 2008
Quote:
Originally Posted by Jolly Jimmy View Post
If it's just one particular image you're looking to mount then an applescript to mount and open the file may be a solution.
Yes, that is what I am trying to accomplish. Do you know what sort of applescript commands I ought to use?
hehe299792458 is offline   0 Reply With Quote
Old Jun 4, 2011, 05:22 AM   #12
Jolly Jimmy
macrumors 65816
 
Jolly Jimmy's Avatar
 
Join Date: Dec 2007
Quote:
Originally Posted by hehe299792458 View Post
Yes, that is what I am trying to accomplish. Do you know what sort of applescript commands I ought to use?
Dead easy.

Code:
tell application "Finder"
	open item "Path:to:disk:image"
	delay 1
	open item "Path:to:file:in:image"
end tell
Jolly Jimmy is offline   0 Reply With Quote
Old Jun 16, 2011, 02:10 PM   #13
Darruk
macrumors newbie
 
Join Date: Jun 2011
Autorun

I don't think this fits exactly into what this thread is talking about, but I've been trying to run a cd in my mac. Every time i put it in it spins, clicks, and spits it out. About three months ago I had the same problem and I found an autorun hotkey and it worked every time I used it! now I can't find it anywhere and no one seems to know about it!?

help please!
Darruk is offline   0 Reply With Quote
Old Jun 17, 2011, 06:46 AM   #14
hehe299792458
Thread Starter
macrumors 6502a
 
hehe299792458's Avatar
 
Join Date: Dec 2008
Quote:
Originally Posted by Jolly Jimmy View Post
Dead easy.

Code:
tell application "Finder"
	open item "Path:to:disk:image"
	delay 1
	open item "Path:to:file:in:image"
end tell
Thanks for the code. However, I can't seem to get it work, even though I checked the file path several times. Could you do an example for me?

Assuming my inputs are as follows,

disk image file: \a.dmg

file inside disk image: b.pages
hehe299792458 is offline   0 Reply With Quote
Old Jun 17, 2011, 06:57 AM   #15
thejadedmonkey
macrumors 604
 
thejadedmonkey's Avatar
 
Join Date: May 2005
Location: Pa
Send a message via AIM to thejadedmonkey
Another way to do this is to create a shortcut to the linked file you want to open, and then when you click on it, OS X Will auto-mount the dmg to open the file.

pro-tip: If you want to password-protect an application, create an encrypted DMG, and put the app, in the DMG, in your dock. Clicking the app icon will mount the DMG, ask you for the password, and then open the app!

Hope that helps (:
__________________
MacBook 17" MacBook Pro iPod Nano Apple TV
PS4 Custom Windows 8.1 Desktop WP8.1
"Good judgment comes from experience,
experience comes from bad judgment."
- Mulla Nasrudin
thejadedmonkey is offline   0 Reply With Quote
Old Jun 17, 2011, 07:34 AM   #16
Jolly Jimmy
macrumors 65816
 
Jolly Jimmy's Avatar
 
Join Date: Dec 2007
Quote:
Originally Posted by hehe299792458 View Post
Thanks for the code. However, I can't seem to get it work, even though I checked the file path several times. Could you do an example for me?

Assuming my inputs are as follows,

disk image file: \a.dmg

file inside disk image: b.pages
To get the correct paths to use in this particular script, select a file and run this script. The path will be copied to the clipboard.

Code:
tell application "Finder" to set the clipboard to the selection as text
Jolly Jimmy is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Migration assistant (Mac - Mac). New mac has mutiple drives, can't pick the right one Daftones MacBook Pro 4 Aug 29, 2013 09:32 AM
Mac Mini not visible in Mac network (shared drives, remote desktop) xterminated OS X 10.8 Mountain Lion 1 Jul 19, 2013 12:13 PM
Linux and mac shared Data partition. (paragon extFS-mac, ntfs-mac, ntfs-3G ?) HiDeHo OS X 10.8 Mountain Lion 15 Jul 17, 2013 05:09 PM
Autorun files on mac? Luddethebest Mac Programming 1 Oct 17, 2012 02:53 PM

Forum Jump

All times are GMT -5. The time now is 04:45 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC