Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Something
Tuesday, May 29th, 2007 at 9:39:42pm UTC 

  1. #!/bin/sh
  2. #
  3. # Product setup script - Loki Entertainment Software
  4.  
  5. # Go to the proper setup directory (if not already there)
  6. cd `dirname $0`
  7.  
  8. # Return the appropriate architecture string
  9. function DetectARCH {
  10.         status=1
  11.         case `uname -m` in
  12.                 i?86)  echo "x86"
  13.                         status=0;;
  14.                 *)     echo "`uname -m`"
  15.                         status=0;;
  16.         esac
  17.         return $status
  18. }
  19.  
  20. # Return the appropriate version string
  21. function DetectLIBC {
  22.       status=1
  23.       if [ -f `echo /lib/libc.so.6* | tail -1` ]; then
  24.               if fgrep GLIBC_2.1 /lib/libc.so.6* 2>&1 >/dev/null; then
  25.                       echo "glibc-2.1"
  26.                       status=0
  27.               else   
  28.                       echo "glibc-2.0"
  29.                       status=0
  30.               fi       
  31.       elif [ -f /lib/libc.so.5 ]; then
  32.               echo "libc5"
  33.               status=0
  34.       else
  35.               echo "unknown"
  36.       fi
  37.       return $status
  38. }
  39.  
  40. # Detect the Linux environment
  41. arch=`DetectARCH`
  42. libc=`DetectLIBC`
  43.  
  44. # Find the installation program
  45. function try_run
  46. {
  47.     setup=$1
  48.     shift
  49.     fatal=$1
  50.     if [ "$1" != "" ]; then
  51.         shift
  52.     fi
  53.  
  54.     # First find the binary we want to run
  55.     failed=0
  56.     setup_bin="setup.data/bin/$arch/$libc/$setup"
  57.     if [ ! -f "$setup_bin" ]; then
  58.         setup_bin="setup.data/bin/$arch/$setup"
  59.         if [ ! -f "$setup_bin" ]; then
  60.             failed=1
  61.         fi
  62.     fi
  63.     if [ "$failed" -eq 1 ]; then
  64.         if [ "$fatal" != "" ]; then
  65.             cat <<__EOF__
  66. This installation doesn't support $libc on $arch
  67.  
  68. Please contact Loki Technical Support at [email protected]
  69. __EOF__
  70.             exit 1
  71.         fi
  72.         return $failed
  73.     fi
  74.  
  75.     # Try to run the binary
  76.     # The executable is here but we can't execute it from CD
  77.     setup="$HOME/.setup$$"
  78.     cp "$setup_bin" "$setup"
  79.     chmod 700 "$setup"
  80.     if [ "$fatal" != "" ]; then
  81.         "$setup" $*
  82.         failed=$?
  83.     else
  84.         "$setup" $* 2>/dev/null
  85.         failed=$?
  86.     fi
  87.     rm -f "$setup"
  88.     return $failed
  89. }
  90.  
  91.  
  92. # Try to run the setup program
  93. status=0
  94. rm -f "$setup"
  95. if ! try_run setup.gtk && ! try_run setup -fatal; then
  96.     echo "The setup program seems to have failed on $arch/$libc"
  97.     echo
  98.     echo "Please contact Loki Technical Support at [email protected]"
  99.     status=1
  100. fi
  101. exit $status

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right