Hackerl / Wine_Appimage

Appimage For Wine
480 stars 69 forks source link

Is there any way to specify wine appimage file&path? #30

Closed yinflying closed 5 years ago

yinflying commented 5 years ago

I have found that I cant not change the wine path using EXPORT PATH=/wine/image/path:$PATH. Is there any way to change the wine appimage path rather than link to /usr/bin/wine

Hackerl commented 5 years ago

在QQ等Appimage启动脚本AppRun运行时,外部自定义的PATH无法正确传入,需要解包手动修改。

#!/bin/bash
command -v wine >/dev/null 2>&1 || { echo -e >&2 "I require wine.\nYou can download Wine-x86_64.AppImage from https://github.com/Hackerl/Wine_Appimage/releases.\nThen run: chmod 777 \$(pwd)/Wine-x86_64.AppImage; sudo ln -s \$(pwd)/Wine-x86_64.AppImage /usr/bin/wine"; exit 1; }

HERE="$(dirname "$(readlink -f "${0}")")"

export WINEDEBUG=-all

RO_DATADIR="$HERE/opt/QQLight"
RW_DATADIR="$HOME/.QQLight"
TOP_NODE="/tmp/.QQLight.unionfs"

mkdir -p $RW_DATADIR $TOP_NODE

$HERE/usr/bin/unionfs-fuse -o use_ino,nonempty,uid=$UID -ocow "$RW_DATADIR"=RW:"$RO_DATADIR"=RO "$TOP_NODE" || exit 1

function finish {
  echo "Cleaning up"
  killall $HERE/usr/bin/unionfs-fuse
}
trap finish EXIT

export WINEPREFIX="$TOP_NODE"
wine "c:\\Program Files\\Tencent\\QQLite\\Bin\\QQ.exe" "$@"

上面为QQ轻聊版的AppRun,在wine命令之前加上 EXPORT PATH=$HOME/.local/bin:$PATH 即可,然后把wine.appimage链接到$HOME/.local/bin/wine。$HOME/.local/bin只是个示例,我个人的习惯是用户可执行文件都放在$HOME/.local/bin。

yinflying commented 5 years ago

Ok, I have learnt how to using --appimage-extract to uncompress the appimage. Thank you for your detailed reply.

Hackerl commented 5 years ago

我是国人,你没必要说英文:grimacing:

yinflying commented 5 years ago

I find that the appimage have contained your wine user file: drive_c/users/hackerl , Maybe it will be bad for you .

Hackerl commented 5 years ago

里面不包含任何隐私文件,这个文件夹只是在测试的时候自动生成的,所有的个人文件都会重定向到$Home/.XXX。

yinflying commented 5 years ago

export ARCH=x86_64 ./appimagetool-x86_64.AppImage ./squashfs-root ,然后运行:

$ ./QQLight-x86_64.AppImage 
fusermount: failed to access mountpoint /tmp/.QQLight.unionfs: Permission denied

这是咋回事?

Hackerl commented 5 years ago

你前一个进程没退出吧, /tmp/.QQLight.unionfs是unionfs-fuse的挂载点,ps -ef看一下进程,kill掉。2.0的应用都会检测是否有killall命令,进程退出时会使用killall 结束unionfs-fuse进程。

yinflying commented 5 years ago

搞定, :D 看起来灰常不错。(不过还是建议在打包的时候直接加一个/home/.local/bin路径也挺好,毕竟连接/usr/bin/wine这事有点怪异,也需要管理员权限。

Hackerl commented 5 years ago

我发2.0版本之前就考虑了,忘了加进去,然后懒得再修改了。