[C++] Open DMG or mpkg from execl

Discussion in 'Mac Programming' started by MetaCipher, Mar 3, 2008.

  1. MetaCipher macrumors newbie

    Mar 3, 2008
    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).

  2. kpua macrumors 6502

    Jul 25, 2006
    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.
  3. MetaCipher thread starter macrumors newbie

    Mar 3, 2008
    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.

Share This Page