[RFC] winewrap

Dimitrie O. Paun dpaun at rogers.com
Fri Dec 6 11:21:26 CST 2002


On December 6, 2002 12:16 pm, Alexandre Julliard wrote:
> I don't think a symlink would work. IMO it should be a self-contained
> thing that you can move around, copy to other machines, etc.

Well, depends on what you call "work" :))) I've attached what I had
in mind for a generic wineapploader script.

But regardless, you want to simply output the script, or generate
an ELF executable?

Also, should I delete the intermediate files? I think I should,
one can get to them by manually running winebuild.

-- 
Dimi.

#!/bin/sh
#
# Wrapper script to start a Winelib application once it is installed
#
# Copyright (C) 2002 Alexandre Julliard
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

# determine the app Winelib library name
appname=`basename "$0" .exe`.exe

# determine the application directory
appdir=""
case "$0" in
  */*)
    # $0 contains a path, use it
    appdir=`dirname "$0"`
    ;;
  *)
    # no directory in $0, search in PATH
    saved_ifs=$IFS
    IFS=:
    for d in $PATH
    do
      IFS=$saved_ifs
      if [ -x "$d/$0" ]; then appdir="$d"; break; fi
    done
    ;;
esac

# figure out the full app path
if [ -n "$appdir" ]; then
    apppath="$appdir/$appname.so"
else
    apppath="$appname"
fi

# first try explicit WINELOADER
if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$apppath" "$@"; fi

# then default bin directory
if [ -x "/usr/local/bin/wine" ]; then exec "/usr/local/bin/wine" "$apppath" "$@"; fi

# now try the directory containing $0
if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$apppath" "$@"; fi

# finally look in PATH
exec wine "$appname" "$@"




More information about the wine-devel mailing list