[Wine] Program won't load fonts when run outside of installed dir

L. Rahyen research at science.su
Fri Feb 6 14:38:01 CST 2009

On 2009-02-06 (Friday) 19:41:40 L. Rahyen wrote:
> in many cases you can use hard or symbolic links instead of launchers

	I forgot to mention that if you create symbolic or hard link to a Windows 
program outside of its Wine prefix it will not find its Wine prefix and will run 
in default one (this is obviously wrong behavior).
	I decided to improve my script so it can handle symbolic links to Windows 
programs in non-default Wine prefix correctly. For example if you do this 
(assuming you have installed Microsoft Word 2007 in ~/.wine-office2007 Wine 

sudo ln -s ~/.wine-office2007/drive_c/Program\ Files/Microsoft\ Office/Office12/WINWORD.EXE /usr/local/bin/word

	...you will be able to run Word 2007 in ~/wine-office2007 Wine prefix by running it 
like this:


	...and open files with it:

word ~/existing-file.doc

	Of course you can link like this any Windows program you want. Here is improved 
version of the script /usr/local/bin/winestart:

# Copyright (C) 2009 L. Rahyen (research {a} science.su)
# License: GNU LGPL version 2 or later
if [[ -z "$WINEPREFIX" ]]; then
  RPATH="`realpath \"$1\"`"
  WINEPREFIX="`echo \"$RPATH\" | sed 's/\/\.\//\//g;s/\/dosdevices\/.:\//\/drive_c\//;s/\harddiskvolume0/\/drice_c\//' |
  awk '
    split($0, a, "/drive_c/")
    printf("%s", a[1]);
  if [[ ! -d "$WINEPREFIX" ]]; then
    unset WINEPREFIX
  } fi
} fi
while [[ "$1" != "" ]]; do
  FILE="`winepath -w \"$1\" | sed 's/ /\\ /g'`"
  if [[ -e "`winepath -u \"$FILE\"`" ]]; then
    ARGS="$ARGS $1"
  } fi
  echo "$ARGS"
} done
wine start /unix "$ARGS"

More information about the wine-users mailing list