For a lack of better answer, I'm sharing my current workaround/hack:
For *nix platforms, where I have deployment under control (OS X particularly), I copy the HOME
environment variable to another variable from a startup script (say the WINE_HOME
). Most environment variables (with notable exception of the HOME
) are exported to Windows/Wine environment. So I can read the WINE_HOME
from my application, prepend Z:\
and convert slashes to backslashes.
For platforms, where I do not have deployment under control, I can use the USERNAME
variable only to guess the home as Z:\home\%USERNAME%
. This particularly does not work on OS X, where the home is in the /users
not the /home
.
EDIT: I found a question Get Wine path of file that helps a bit. In *nix you can use the winepath -w ~
to get Z:\home\username
. But running the same from Windows environment does not resolve the ~
. You can at least run the winepath -w /home/username
to get Z:\home\username
to find out a drive of the Wine root (in case it's not the default Z:\
).