Passing "current dir" to linux program (or other ways to associate it)

Mikhail Ramendik mr at ramendik.ru
Sat Mar 6 17:42:09 CST 2004


Hello,

I wanted to associate the Linux Acrobat Reader to .pdf files (so that
another program can call it when it opens its manual). Of course there's
the Windows version, but then, running a native program is usually
better.

So I looked at the existing registry associations and made the
following: (adapting from regedit exports)


[HKEY_CLASSES_ROOT\.pdf]
@="AdobePDF.1"
[HKEY_CLASSES_ROOT\AdobePDF.1]
@="Adobe PDF"
[HKEY_CLASSES_ROOT\AdobePDF.1\shell]
[HKEY_CLASSES_ROOT\AdobePDF.1\shell\open]
[HKEY_CLASSES_ROOT\AdobePDF.1\shell\open\command]
@="\"d:\\acrostub.exe\" \"%1\""

d:\acrostub.exe is actually a Linux script. And I had to make it like
this:

#!/bin/sh
env TEMP=/tmp TMP=/tmp acroread /path/to/pdf/files/$1

It's because Windows passes only the filename, and the directory is
supposedly "current". As I don't know of a way to get the "current" dir,
all I could do was fix the path.

Of course it won't work if all PDF files are not in one and the same
place... and anyway it's an obvious hack. 

Perhaps there is a way to pass the "current dir", or the full pathname,
from Wine to a linux program when running it via file type association? 

Would be best to get it in the Linux format already, but the Windows
format is OK, after all one can read the config and write a "path
expand" utility (or perhaps it already exists?)

Any help would be greatly appreciated.

Yours, Mikhail Ramendik

P.S.The fact that TMP and TEMP need to be reset is understandable, no
problem.





More information about the wine-users mailing list