Skip to content

Commit

Permalink
wechatplayer work
Browse files Browse the repository at this point in the history
Signed-off-by: Vufa <[email protected]>
  • Loading branch information
vufa committed Dec 1, 2022
1 parent 94e1d89 commit c47e7df
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .SRCINFO
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pkgbase = deepin-wine-wechat
pkgdesc = Tencent WeChat on Deepin Wine(com.qq.weixin.deepin) For Archlinux
pkgver = 3.8.0.41
pkgrel = 1
pkgrel = 2
url = https://weixin.qq.com/
install = deepin-wine-wechat.install
arch = x86_64
Expand Down Expand Up @@ -30,7 +30,7 @@ pkgbase = deepin-wine-wechat
md5sums = d841406c6a892707904029953266ad41
md5sums = cf87ad9db0bf279ddf9e5c1dce64a716
md5sums = 89b10711889f52ab0a386f37b4eb3212
md5sums = 8affc899887c042937a623406346871c
md5sums = 8ff0cb8e9c126641593ee8d31b94042b
md5sums = 05b05416ef1fa4e1baaf64736e15a057

pkgname = deepin-wine-wechat
8 changes: 4 additions & 4 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgver=3.8.0.41
wechat_installer=WeChatSetup
deepinwechatver=3.4.0.38deepin6
debpkgname="com.qq.weixin.deepin"
pkgrel=1
pkgrel=2
pkgdesc="Tencent WeChat on Deepin Wine(${debpkgname}) For Archlinux"
arch=("x86_64")
url="https://weixin.qq.com/"
Expand All @@ -27,7 +27,7 @@ md5sums=('6c4edb108a0593bab7a556a6c9e8a012'
'd841406c6a892707904029953266ad41'
'cf87ad9db0bf279ddf9e5c1dce64a716'
'89b10711889f52ab0a386f37b4eb3212'
'8affc899887c042937a623406346871c'
'8ff0cb8e9c126641593ee8d31b94042b'
'05b05416ef1fa4e1baaf64736e15a057')

build() {
Expand All @@ -46,8 +46,8 @@ build() {
7z x -aoa "${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/files.7z" -o"${srcdir}/deepinwechatdir"
msg "Cleaning up the original package directory ..."
rm -r "${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/WeChat"
msg "Patching reg files ..."
patch -p1 -d "${srcdir}/deepinwechatdir/" < "${srcdir}/reg.patch"
#msg "Patching reg files ..."
#patch -p1 -d "${srcdir}/deepinwechatdir/" < "${srcdir}/reg.patch"
msg "Creating font file link ..."
ln -sf "/usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc" "${srcdir}/deepinwechatdir/drive_c/windows/Fonts/wqy-microhei.ttc"
msg "Copying latest WeChat installer to ${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/ ..."
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ yay -S noto-fonts-sc

> 根据 [deepin-wine-wechat-arch#173](https://github.com/vufa/deepin-wine-wechat-arch/issues/173),由[abcfy2](https://github.com/abcfy2)提供的方法
编辑 `~/.pam_environment`,添加:
编辑 `/etc/environment`,添加:

```
DEEPIN_WINE_SCALE=1.25
Expand All @@ -245,7 +245,7 @@ DEEPIN_WINE_SCALE=1.25
/opt/apps/com.qq.weixin.deepin/files/run.sh -w
```

可以参考 [deepin-wine-wechat-arch#263](https://github.com/vufa/deepin-wine-wechat-arch/issues/263) 将该命令存入脚本并添加到全局快捷键中,方便使用
可以参考 [deepin-wine-wechat-arch#96](https://github.com/vufa/deepin-wine-wechat-arch/issues/96)[deepin-wine-wechat-arch#263](https://github.com/vufa/deepin-wine-wechat-arch/issues/263) 将该命令存入脚本并添加到全局快捷键中,方便使用

## 感谢

Expand Down
98 changes: 43 additions & 55 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export APPRUN_CMD="deepin-wine6-stable"
DISABLE_ATTACH_FILE_DIALOG=""
EXPORT_ENVS=""

export SPECIFY_SHELL_DIR=`dirname $START_SHELL_PATH`
export SPECIFY_SHELL_DIR=$(dirname $START_SHELL_PATH)

ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files"

Expand All @@ -35,22 +35,19 @@ export LD_LIBRARY_PATH=/opt/apps/$DEB_PACKAGE_NAME/files/lib32

export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"

msg()
{
ECHO_LEVEL=("\033[1;32m==> " "\033[1;31m==> ERROR: ")
echo -e "${ECHO_LEVEL[$1]}\033[1;37m$2\033[0m"
msg() {
ECHO_LEVEL=("\033[1;32m==> " "\033[1;31m==> ERROR: ")
echo -e "${ECHO_LEVEL[$1]}\033[1;37m$2\033[0m"
}

OpenWinecfg()
{
OpenWinecfg() {
msg 0 "Launching winecfg with $APPRUN_CMD in $WINEPREFIX ..."
env WINEPREFIX=$WINEPREFIX $APPRUN_CMD winecfg
}

DeployApp()
{
DeployApp() {
# backup fonts
if [ -d "$WECHAT_FONTS" ];then
if [ -d "$WECHAT_FONTS" ]; then
msg 0 "Backing up fonts ..."
mkdir -p $HOME/.deepinwine/.wechat_tmp
cp $WECHAT_FONTS/* $HOME/.deepinwine/.wechat_tmp/
Expand All @@ -64,81 +61,72 @@ DeployApp()
env WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$WECHAT_INSTALLER_PATH" "$@"

# restore fonts
if [ -d "$HOME/.deepinwine/.wechat_tmp" ];then
if [ -d "$HOME/.deepinwine/.wechat_tmp" ]; then
msg 0 "Restoring fonts ..."
cp -n $HOME/.deepinwine/.wechat_tmp/* $WECHAT_FONTS/
rm -rf "$HOME/.deepinwine/.wechat_tmp"
fi
touch $WINEPREFIX/reinstalled
msg 0 "Creating $WINEPREFIX/PACKAGE_VERSION ..."
cat /opt/apps/$DEB_PACKAGE_NAME/files/files.md5sum > $WINEPREFIX/PACKAGE_VERSION
cat /opt/apps/$DEB_PACKAGE_NAME/files/files.md5sum >$WINEPREFIX/PACKAGE_VERSION
}

WakeApp()
{
WakeApp() {
env WINEPREDLL="$ARCHIVE_FILE_DIR/dlls" \
WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64 \
WINEPREFIX=$WINEPREFIX $APPRUN_CMD /opt/deepinwine/tools/sendkeys.exe w
WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64 \
WINEPREFIX=$WINEPREFIX $APPRUN_CMD /opt/deepinwine/tools/sendkeys.exe w
}

Run()
{
if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ];then
Run() {
if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ]; then
export ATTACH_FILE_DIALOG=1
fi

if [ -n "$EXPORT_ENVS" ];then
if [ -n "$EXPORT_ENVS" ]; then
export $EXPORT_ENVS
fi

if [ -n "$EXEC_PATH" ];then
if [ ! -f "$WINEPREFIX/reinstalled" ];then
if [ -n "$EXEC_PATH" ]; then
if [ ! -f "$WINEPREFIX/reinstalled" ] || [ ! -f "$EXEC_FILE" ]; then
DeployApp
exit 0
fi

if [ -z "${EXEC_PATH##*.lnk*}" ]; then
msg 0 "Launching $EXEC_PATH lnk file ..."
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
else
# missing exec file
if [ ! -f "$EXEC_FILE" ];then
msg 1 "Missing $EXEC_FILE, re-deploying ..."
DeployApp
exit 0
fi

if [ -z "${EXEC_PATH##*.lnk*}" ];then
msg 0 "Launching $EXEC_PATH lnk file ..."
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
else
msg 0 "Launching $EXEC_PATH ..."
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
fi
msg 0 "Launching $EXEC_PATH ..."
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
fi
else
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
fi
}

HelpApp()
{
echo " Extra Commands:"
echo " winecfg Open winecfg"
HelpApp() {
echo " Extra Commands:"
echo " winecfg Open winecfg"
echo " -w/--wake Wake up background program"
echo " -h/--help Show program help info"
echo " -h/--help Show program help info"
}

if [ -z $1 ]; then
Run "$@"
exit 0
Run "$@"
exit 0
fi
case $1 in
"winecfg")
OpenWinecfg
;;
"-w" | "--wake")
WakeApp
;;
"-h" | "--help")
HelpApp
;;
*)
Run "$@"
;;
"winecfg")
OpenWinecfg
;;
"-w" | "--wake")
WakeApp
;;
"-h" | "--help")
HelpApp
;;
*)
Run "$@"
;;
esac
exit 0

0 comments on commit c47e7df

Please sign in to comment.