Re: Program won't load fonts when run outside of installed dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 
prefix):

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:

word

	...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:


#!/bin/sh
# 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]);
  }
  '`"
  export WINEPREFIX
  if [[ ! -d "$WINEPREFIX" ]]; then
  {
    unset WINEPREFIX
  } fi
} fi
ARGS="$RPATH"
shift
while [[ "$1" != "" ]]; do
{
  FILE="`winepath -w \"$1\" | sed 's/ /\\ /g'`"
  if [[ -e "`winepath -u \"$FILE\"`" ]]; then
  {
    ARGS="$ARGS $FILE"
  }
  else
  {
    ARGS="$ARGS $1"
  } fi
  echo "$ARGS"
  shift
} done
wine start /unix "$ARGS"


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux