分页: 1 / 1

突然发现Portal2游戏目录下有一个sh文件

发表于 : 2011-05-26 21:14
萌名雪
简单分析了一下,似乎是创建目录变量什么的,最后有一个疑似…运行的命令
尝试直接sh,输出结果只是:XXX:是一个目录
另外还有Mac的可执行文件:portal2.osx

如果这个脚本能运行成功的话,就可以摆脱Wine了?

附:全文

代码: 全选

#!/bin/bash

# figure out the absolute path to the script being run a bit
# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the
# specified directory, then uses $PWD to figure out where that
# directory lives - and all this in a subshell, so we don't affect
# $PWD

GAMEROOT=$(cd "${0%/*}" && echo $PWD)

#determine platform
UNAME=`uname`
if [ "$UNAME" == "Darwin" ]; then
   # prepend our lib path to LD_LIBRARY_PATH
   export DYLD_LIBRARY_PATH="${GAMEROOT}"/bin:$DYLD_LIBRARY_PATH
elif [ "$UNAME" == "Linux" ]; then
   # prepend our lib path to LD_LIBRARY_PATH
   export LD_LIBRARY_PATH="${GAMEROOT}"/bin:$LD_LIBRARY_PATH
fi

if [ -z $GAMEEXE ]; then
	if [ "$UNAME" == "Darwin" ]; then
		GAMEEXE=portal2_osx
	fi
fi

ulimit -n 2048

# and launch the game
cd "$GAMEROOT"

STATUS=42
while [ $STATUS -eq 42 ]; do
	if [ "${DEBUGGER}" == "gdb" ]; then
		ARGSFILE=$(mktemp $USER.portal2.gdb.XXXX)
		echo run $@ > "$ARGSFILE"
		${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} -x "$ARGSFILE"
		rm "$ARGSFILE"
	else
		${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
	fi
	STATUS=$?
done
exit $STATUS

Re: 突然发现Portal2游戏目录下有一个sh文件

发表于 : 2011-05-26 21:34
luojie-dune
mac 也用shell

Re: 突然发现Portal2游戏目录下有一个sh文件

发表于 : 2011-05-26 21:37
灰色小狼
shell里也是调用的那个osx啊

Re: 突然发现Portal2游戏目录下有一个sh文件

发表于 : 2011-05-26 22:00
萌名雪
灰色小狼 写了:shell里也是调用的那个osx啊
不是,里面有一个判断系统版本的语句,有Darwin和Linux两个判断

Re: 突然发现Portal2游戏目录下有一个sh文件

发表于 : 2011-05-26 22:03
枫叶饭团
一切都是假象=,= :em04

Re: 突然发现Portal2游戏目录下有一个sh文件

发表于 : 2011-05-26 22:34
wjh36845
:em05 表示已经在win7下通关了