[问题] 如何在程序启动器(Lancher)中打开一个脚本[已解决]

sh/bash/dash/ksh/zsh等Shell脚本
回复
antonym55
帖子: 353
注册时间: 2007-04-03 9:52
联系:

[问题] 如何在程序启动器(Lancher)中打开一个脚本[已解决]

#1

帖子 antonym55 » 2007-04-15 10:55

最近装了游戏""无冬之夜" linux版, 但是每次启动都要到游戏所在目录中从终端中输入./nwn才能启动游戏
想在桌面上建个启动器,结果失败了。

nwn 是个脚本, 内容如下

代码: 全选

#!/bin/sh

# This script runs Neverwinter Nights from the current directory

export SDL_MOUSE_RELATIVE=0
export SDL_VIDEO_X11_DGAMOUSE=0

# If you do not wish to use the SDL library included in the package, remove
# ./lib from LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./lib:./miles:$LD_LIBRARY_PATH

./nwmain $@

如果从终端中直接输入程序名nwmain启动主程序就会出错

代码: 全选

antony@Ubuntu:~/games/nwn$ ./nwmain
./nwmain: error while loading shared libraries: libmss.so.6: cannot open shared object file: No such file or directory
antony@Ubuntu:~/games/nwn$ 
请问有怎么样在桌面上建一个启动器?

因为不会shell脚本,最好能简单讲解一下脚本的意思

谢谢大家
上次由 antonym55 在 2007-05-09 3:19,总共编辑 1 次。
antonym55
帖子: 353
注册时间: 2007-04-03 9:52
联系:

#2

帖子 antonym55 » 2007-05-09 3:16

已解决,把这个脚本链接到
/usr/local/bin 下面

代码: 全选

ln -s  /home/antony/games/nwn/nwn /usr/local/bin/nwn
原始的 nwn 脚本
中加入一条改变路径到nwn的路径的代码

代码: 全选

#!/bin/sh

cd /home/antony/games/nwn

# This script runs Neverwinter Nights from the current directory

export SDL_MOUSE_RELATIVE=0
export SDL_VIDEO_X11_DGAMOUSE=0

# If you do not wish to use the SDL library included in the package, remove
# ./lib from LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./lib:./miles:$LD_LIBRARY_PATH

./nwmain $@ 
然后就可以在终端或启动器中打开nwn了
回复