I have a program compiled in windows. I execute it using "wine program.exe" under linux. program.exe needs to execute openoffice , thats installed on linux machine ,..... how can I achieve this, how can I do it ?
fachamix wrote:> program.exe needs to execute openoffice , thats installed on linux machine ,..... how can I achieve this, how can I do it ?http://wiki.winehq.org/FAQ#head-68d921c50355f280a905e3574b7dda58d76ff51f
thanks I will try that as soon I get home
solved this is the code used in codeblocks and compiled under windows xp: #include <stdio.h> #include <stdlib.h> int main() { printf("probando ejecutable"); printf("llamando a ABIWORD desde wine ..."); system("/bin/sh -c /usr/bin/abiword"); return 0; } I compiled the program as program.exe under linux i call that program like: wine program.exe works perfectly this code should open ABIWORD
SOLLLLVEDDDDDDDDDDDDDDDD original code of program.exe: Code: #include <stdio.h> #include <stdlib.h> int main() { printf("probando ejecutable"); printf("llamando a ABIWORD desde wine ..."); system("/bin/sh -c /script.run file.txt"); return 0; } modified code: Code: #include <stdio.h> #include <stdlib.h> int main() { printf("probando ejecutable"); printf("llamando a ABIWORD desde wine ..."); system("/bin/sh -c \"/script.run file.txt\""); return 0; } works perfectly
fachamix wrote:> > DaVince wrote: > > Wouldn't calling > > > > Code: > > system("/usr/bin/abiword"); > > > > > > be enough considering Wine sees abiword as something runnable and just runs it, anyway? > > > no ... > > I dont want to use : > > wine /usr/bin/abiword > > I want : > > wine program.exe > > and insidde program.exe ... call abiwordFollowing that logic you're doing this: wine /bin/sh -c /usr/bin/abiword Not much of a difference. [Rolling Eyes]
Gert van den Berg wrote:> On Mon, Nov 30, 2009 at 17:10, fachamix <wineforum-user at winehq.org> wrote: > > > Code: > > #include <stdio.h> > > #include <stdlib.h> > > > > int main() > > { > > ?? ??printf("probando ejecutable"); > > ?? ??printf("llamando a ABIWORD desde wine ..."); > > ?? ??system("/bin/sh -c \"/script.run file.txt\""); > > ?? ??return 0; > > } > > > > works perfectly > > > > > any reason why its necessary to involve a shell? > > Just a note: You might want to use http://wiki.winehq.org/winepath if > paths get involved... > > In perl what would be: (emulating backtick is something I haven't > figured out in C) > my $filename = `winepath "file.txt"`; # this would be where to put the > windows path > system('/usr/bin/abiword',($filename)); # the multi-parameter form > doesn't have quoting issues... > > (Standard system does not seem to support it, but one of exec & > friends might...) > > Gertperl does not adjust to this problem, because I already have a WINXP compiled program in C++