先对wine进行一下备份,建立一个脚本:
sudo cp /usr/bin/wine /usr/bin/wine-run
sudo rm /usr/bin/wine
sudo touch /usr/bin/wine
sudo chmod a+x /usr/bin/wine
然后编辑/usr/bin/wine,加入一下内容:
#!/bin/bash注意:wine-run 后的$@必须要有引号,否则不能处理带有空格的文件。
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:zh
export LC_CTYPE="zh_CN.UTF-8"
export LC_NUMERIC="zh_CN.UTF-8"
export LC_TIME="zh_CN.UTF-8"
export LC_COLLATE="zh_CN.UTF-8"
export LC_MONETARY="zh_CN.UTF-8"
export LC_MESSAGES="zh_CN.UTF-8"
export LC_PAPER="zh_CN.UTF-8"
export LC_NAME="zh_CN.UTF-8"
export LC_ADDRESS="zh_CN.UTF-8"
export LC_TELEPHONE="zh_CN.UTF-8"
export LC_MEASUREMENT="zh_CN.UTF-8"
export LC_IDENTIFICATION="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"
/usr/bin/wine-run "$@"
考虑到更新时候,wine会被覆盖掉,因此,下面一个脚本可以自动检测,并生成脚本:
#!/bin/bash
function create_wine_script()
{
echo '#!/bin/bash
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:zh
export LC_CTYPE="zh_CN.UTF-8"
export LC_NUMERIC="zh_CN.UTF-8"
export LC_TIME="zh_CN.UTF-8"
export LC_COLLATE="zh_CN.UTF-8"
export LC_MONETARY="zh_CN.UTF-8"
export LC_MESSAGES="zh_CN.UTF-8"
export LC_PAPER="zh_CN.UTF-8"
export LC_NAME="zh_CN.UTF-8"
export LC_ADDRESS="zh_CN.UTF-8"
export LC_TELEPHONE="zh_CN.UTF-8"
export LC_MEASUREMENT="zh_CN.UTF-8"
export LC_IDENTIFICATION="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"
/usr/bin/wine-run "$@" ' > $1
}
file /usr/bin/wine | grep ELF 1>/dev/null
if [ $? -eq 0 ]
then
cp /usr/bin/wine /usr/bin/wine-run
rm /usr/bin/wine
touch /usr/bin/wine
chmod a+x /usr/bin/wine
create_wine_script /usr/bin/wine
fi
没有评论:
发表评论