PDA

View Full Version : [C++] Open DMG or mpkg from execl




MetaCipher
Mar 3, 2008, 02:13 PM
I have a program that displays images for different devices to install drivers for. What I want it to do is you click on your OS (10.4 or 10.5) and have it automatically open the DMG or mpkg (DMG is preferred) like it does as if I opened it from a folder or the desktop. Does anyone know how to do this?

(I've looked at execl and it doesn't do anything currently, I assume I need to pass the dmg is an argument to some program so it automatically mounts, and opens and Mac does its fun stuff).

Thanks.



kpua
Mar 3, 2008, 03:00 PM
I'm not sure it's what you're looking for, but passing an argument to /usr/bin/open is essentially the same as double-clicking the file in the Finder.

MetaCipher
Mar 7, 2008, 12:30 PM
kpua, thanks that is exactly what I needed, but it seems that everytime I try to use execl it simply doesn't work. It always returns "Operation not Supported" - 45 error. I've tried using simply ls, and such, and it still doesn't work.

execl("ls", 0);

I am not sure what is going on.

Running the command from a terminal though works just fine.