SHARE
TWEET

Untitled

a guest Nov 13th, 2016 174 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. #
  3. # Wrapper script to start a Winelib application once it is installed
  4. #
  5. # Copyright (C) 2002 Alexandre Julliard
  6. #
  7. # This library is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU Lesser General Public
  9. # License as published by the Free Software Foundation; either
  10. # version 2.1 of the License, or (at your option) any later version.
  11. #
  12. # This library is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. # Lesser General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Lesser General Public
  18. # License along with this library; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  20. #
  21.  
  22. # determine the app Winelib library name
  23. appname=`basename "$0" .exe`.exe
  24.  
  25. # first try explicit WINELOADER
  26. if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi
  27.  
  28. # now try the directory containing $0
  29. appdir=""
  30. case "$0" in
  31.   */*)
  32.     # $0 contains a path, use it
  33.     appdir=`dirname "$0"`
  34.     ;;
  35.   *)
  36.     # no directory in $0, search in PATH
  37.     saved_ifs=$IFS
  38.     IFS=:
  39.     for d in $PATH
  40.     do
  41.       IFS=$saved_ifs
  42.       if [ -x "$d/$0" ]; then appdir="$d"; break; fi
  43.     done
  44.     ;;
  45. esac
  46. if [ -x "$appdir/wine" ]; then exec "$appdir/wine" "$appname" "$@"; fi
  47. if [ -x "$appdir/wine64" ]; then exec "$appdir/wine64" "$appname" "$@"; fi
  48.  
  49. # now look in PATH
  50. saved_ifs=$IFS
  51. IFS=:
  52. for d in $PATH
  53. do
  54.   IFS=$saved_ifs
  55.   if [ -x "$d/wine" ]; then exec "$d/wine" "$appname" "$@"; fi
  56.   if [ -x "$d/wine64" ]; then exec "$d/wine64" "$appname" "$@"; fi
  57. done
  58.  
  59. # finally, the default bin directory
  60. if [ -x "/usr/bin/wine" ]; then exec "/usr/bin/wine" "$appname" "$@"; fi
  61. if [ -x "/usr/bin/wine64" ]; then exec "/usr/bin/wine64" "$appname" "$@"; fi
  62.  
  63. echo "$0: the Wine loader is missing"
  64. exit 1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top