[Wine]start a linux command using a win32 apps ?

penna at bb.com.br penna at bb.com.br
Mon Jan 17 15:29:42 CST 2005


    I'm not sure about you want but you can do something like this in 
order to start shell scripts or acroread (for linux), for example:

a) put the keys below at the "~/.wine/system.reg":
----------------- 8< --------------------
[Software\\Classes\\.pdf] 1051470000
[Software\\Classes\\acroread.pdf\\shell\\open\\command] 1051470000
@="\"C:\\Program Files\\Acroread\\acroread.exe\" \"%1\""
------------------ 8< -------------------

b) in the fake windows directory, pointed by "~/.wine/dosdevices/c:", put 
the "acroread.exe" at the "Program Files/Acroread", as described in the 
key-registry above. If necessary, create the "Program Files/Acroread" 
------------------ 8< -------------------

#set -x
mkdir -p "$HOME/tmp"
LOG="$HOME/tmp/acroread.exe-log.`id -u -n`"
echo "Arguments received: $@" > $LOG

# winepath replaces "X:\path\to\application" to the Unix format
RESULT=`winepath "$@" 2>> $LOG`
echo "/usr/local/bin/acroread $RESULTADO" >> $LOG
TMP=$TMPDIR ; TEMP=$TMPDIR ; /usr/local/bin/acroread "$RESULT"

rm -f "$RESULT"
------------------ 8< -------------------

     The same logic works for all extensions you can imagine (doc, xls, 
sxw, ppt, zip, htm, html, ...)
     I mean, you can put a registry entry (at system.reg) for the 
extension you need and a "executable" (in fact, a shell script) to start 
that extension. 
     I've done some scripts to deal with some extensions. All you have to 
do is to look the way the linux application works passing the proper 
arguments to them. For instance, "ark" forks itself so the script to deal 
with ZIP extension (very similar to the one above) was deleting the file 
before ark could read it. I had to pass "ark --nofork" in order the script 
to work.
     You can improve the scripts in order to find the application you want 
to start instead of acroread (xpdf, gpdf, kghostview, etc).

Ulisses de Sousa Penna
Analista Consultor - Banco do Brasil
Fone: +55-61-310-6320   Fax: +55-61-310-6435
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-users/attachments/20050117/fdbf7143/attachment.html

More information about the wine-users mailing list