Jim Wintermyre writes:
> I'm trying to use KUNCExecute from my IOKit driver in order to launch
> a user-space app to do some stuff that can't happen at kernel level.
> I'm running into a few snags:
>
> 1) It seems that KUNCExceute will only launch an application that
> actually lives in the /Applications folder. I'd like to include the
FWIW, I use KUNCExecute() to launch a shell script which lives in my
installation directory (which defaults to /opt/mx), and I've had no
problems. However, I don't get any helpful info when the script is
not present.
Perhaps you could launch your app via a shell script?
Here is my launching code:
int
mx_start_mapper(mx_instance_state_t *is)
{
kern_return_t ret;
char *exec_path = "/opt/mx/etc/mx_macosx_start_mapper.sh";
if (mx_mapper_path != NULL)
exec_path = mx_mapper_path;
MX_INFO(("Starting usermode helper: %s\n", exec_path));
ret = KUNCExecute(exec_path, kOpenAppAsRoot, kOpenApplicationPath);
if (ret != 0) {
MX_INFO(("Problem starting usermode mapper, ret = %d\n", ret));
}
return ret;
}
Cheers,
Drew