How Do I launch a Native Linux application from Within Wine

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How Do I launch a Native Linux application from Within Wine

Craig macLeod
As the subject says,
    I have a Windows application and I wish to run a native linux application from withing it. The main Win32 API calls for running another apllication are
 
ShellExecute
WinExec
CreateProcess
 
I have tried calling a native linux program with these (nautilus) and it consistently fails. Do I need a fully specified path (nautilus is in the search path mind you)?
 
It either does nothing or hangs Wine when I try calling these applications. I assume Wine is running the application as if it is a Windows app and failing.
 
Thanks for any help in advance.


Reply | Threaded
Open this post in threaded view
|

Re: How Do I launch a Native Linux application from Within Wine

Dan Kegel-3
On 10/12/05, Craig macLeod <[hidden email]> wrote:

> As the subject says,
>     I have a Windows application and I wish to run a native linux
> application from withing it. The main Win32 API calls for running another
> apllication are
>
> ShellExecute
> WinExec
> CreateProcess
>
> I have tried calling a native linux program with these (nautilus) and it
> consistently fails. Do I need a fully specified path (nautilus is in the
> search path mind you)?

I just tried it, and it works.
Here's what I did:
copied example CreateProcess code from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_processes.asp
Modified it to use an absolute path, e.g.
    CreateProcess( NULL,  TEXT("c:\\windows\\MyChildProcess"), ...
since it didn't seem to work otherwise (probably a PATH problem).
Created a shell script with that name, e.g.

$ cat >  .wine/drive_c/windows/MyChildProcess <<_EOF_
#!/bin/sh
xeyes
_EOF_
$ chmod 755 .wine/drive_c/windows/MyChildProcess

Compiled the demo app with msvc, ran it with wine, voila!  xeyes are
following me around on the screen.


Reply | Threaded
Open this post in threaded view
|

Re: How Do I launch a Native Linux application from Within Wine

Kuba Ober
In reply to this post by Craig macLeod
> I have tried calling a native linux program with these (nautilus) and it
> consistently fails. Do I need a fully specified path (nautilus is in the
> search path mind you)?

I'd say that you're free to use a linux syscall to do whatever you want,
including forking the process and exec'ing the linux program. That's the
beauty of wine. You have win32 *and* linux APIs available at the same time.

Cheers, Kuba