aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO35
-rw-r--r--.gitignore7
-rw-r--r--.travis.yml41
-rw-r--r--PKGBUILD86
-rw-r--r--README.md363
-rw-r--r--deepin-wine-wechat.install14
-rwxr-xr-xgen.sh83
-rw-r--r--reg.patch58
-rwxr-xr-xrun.sh215
9 files changed, 588 insertions, 314 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b8024a47eafc..d079d67b2e54 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,15 @@
pkgbase = deepin-wine-wechat
- pkgdesc = Tencent WeChat (com.wechat) on Deepin Wine For Archlinux
- pkgver = 2.6.8.51
- pkgrel = 1
+ pkgdesc = Tencent WeChat on Deepin Wine(com.qq.weixin.deepin) For Archlinux
+ pkgver = 3.9.0.28
+ pkgrel = 3
url = https://weixin.qq.com/
install = deepin-wine-wechat.install
arch = x86_64
license = custom
depends = p7zip
- depends = wine
- depends = wine-mono
- depends = wine_gecko
+ depends = lib32-udis86-git
+ depends = deepin-wine6-stable>=6.0.0.42-1
+ depends = deepin-wine-helper>=5.1.45_1-1
depends = xorg-xwininfo
depends = wqy-microhei
depends = lib32-alsa-lib
@@ -18,15 +18,22 @@ pkgbase = deepin-wine-wechat
depends = lib32-openal
depends = lib32-mpg123
depends = lib32-libldap
+ optdepends = noto-fonts-sc: display some Chinese characters
+ optdepends = lib32-nvidia-utils: required for nvidia graphics card
conflicts = deepin-wechat
- source = https://mirrors.ustc.edu.cn/deepin/pool/non-free/d/deepin.com.wechat/deepin.com.wechat_2.6.2.31deepin0_i386.deb
- source = https://dldir1.qq.com/weixin/Windows/WeChatSetup.exe
+ source = https://com-store-packages.uniontech.com/appstore/pool/appstore/c/com.qq.weixin.deepin/com.qq.weixin.deepin_3.4.0.38deepin6_i386.deb
+ source = WeChatSetup-3.9.0.28.exe::https://github.com/tom-snow/wechat-windows-versions/releases/download/v3.9.0.28/WeChatSetup-3.9.0.28.exe
+ source = https://community-packages.deepin.com/deepin/pool/main/o/openldap/libldap-2.4-2_2.4.47+dfsg.4-1+eagle_i386.deb
+ source = https://community-packages.deepin.com/deepin/pool/main/c/cyrus-sasl2/libsasl2-2_2.1.27.1-1+dde_i386.deb
source = run.sh
- source = reg.patch
- md5sums = c66a173fe6817afd898e0061d9eaf42e
- md5sums = 06b1072dfeb2eba50027cd9b237accff
- md5sums = 88abd550ffce483a3f9627d84e4d5e3a
- md5sums = 9c9d51ff585ff630473ce827159a8230
+ source = https://github.com/vufa/deepin-wine-wechat-arch/raw/action/mmmojo.dll
+ source = https://github.com/vufa/deepin-wine-wechat-arch/raw/action/mmmojo_64.dll
+ md5sums = 6c4edb108a0593bab7a556a6c9e8a012
+ md5sums = 3efd527ee04c027f401e3b0a460242c2
+ md5sums = cf87ad9db0bf279ddf9e5c1dce64a716
+ md5sums = 89b10711889f52ab0a386f37b4eb3212
+ md5sums = 758b560950adccb5778a7347410efcf6
+ md5sums = e8296fadc17b303dd5c77e4a05677ebd
+ md5sums = 2aa6b65bd19bbde32432ea06c28cc33d
pkgname = deepin-wine-wechat
-
diff --git a/.gitignore b/.gitignore
index db484d761956..fb4360a2c448 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,10 @@
-/deepin.com.wechat*
-/deepin-wine-wechat-*.tar.xz
+/com.qq.weixin.deepin*
+/deepin-wine-wechat-*.pkg*
+/libldap*
+/libsasl2*
/pkg/
/src/
/WeChat*
/reg_tmp_fixed/
/reg_tmp/
+/*.dll
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index d229052adbbc..000000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-sudo: required
-
-services:
-- docker
-
-arch:
- repos:
- - archlinuxfr=http://repo.archlinux.fr/$arch
- packages:
- - p7zip
- - wine
- - wine-mono
- - wine_gecko
- - xorg-xwininfo
- - xdotool
- - wqy-microhei
- - adobe-source-han-sans-cn-fonts
- - lib32-alsa-lib
- - lib32-alsa-plugins
- - lib32-libpulse
- - lib32-openal
- - lib32-mpg123
- - lib32-libldap
- script:
- - "makepkg"
-
-script:
-- "curl -s https://raw.githubusercontent.com/mikkeloscar/arch-travis/master/arch-travis.sh | bash"
-
-deploy:
- provider: releases
- skip_cleanup: true
- overwrite: true
- api_key: $GH_TOKEN
- file_glob: true
- file:
- - "deepin-wine-wechat-*-x86_64.pkg.tar.xz"
- on:
- tags: true
- all_branches: true
- repo: countstarlight/deepin-wine-wechat-arch
diff --git a/PKGBUILD b/PKGBUILD
index dc1f6eb7ec9c..30520ae0f14e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,51 +1,85 @@
-# Maintainer: CountStarlight <countstarlight@gmail.com>
+# Maintainer: Vufa <countstarlight@gmail.com>
pkgname=deepin-wine-wechat
-pkgver=2.6.8.52
+pkgver=3.9.0.28
wechat_installer=WeChatSetup
-deepinwechatver=2.6.2.31deepin0
-pkgrel=1
-pkgdesc="Tencent WeChat (com.wechat) on Deepin Wine For Archlinux"
+deepinwechatver=3.4.0.38deepin6
+debpkgname="com.qq.weixin.deepin"
+pkgrel=3
+pkgdesc="Tencent WeChat on Deepin Wine(${debpkgname}) For Archlinux"
arch=("x86_64")
url="https://weixin.qq.com/"
license=('custom')
-depends=('p7zip' 'wine' 'wine-mono' 'wine_gecko' 'xorg-xwininfo' 'wqy-microhei' 'lib32-alsa-lib' 'lib32-alsa-plugins' 'lib32-libpulse' 'lib32-openal' 'lib32-mpg123' 'lib32-libldap')
+depends=('p7zip' 'lib32-udis86-git' 'deepin-wine6-stable>=6.0.0.42-1' 'deepin-wine-helper>=5.1.45_1-1' 'xorg-xwininfo' 'wqy-microhei' 'lib32-alsa-lib' 'lib32-alsa-plugins' 'lib32-libpulse' 'lib32-openal' 'lib32-mpg123' 'lib32-libldap')
+optdepends=('noto-fonts-sc: display some Chinese characters'
+ 'lib32-nvidia-utils: required for nvidia graphics card')
conflicts=('deepin-wechat')
install="deepin-wine-wechat.install"
-_mirror="https://mirrors.ustc.edu.cn/deepin"
-source=("$_mirror/pool/non-free/d/deepin.com.wechat/deepin.com.wechat_${deepinwechatver}_i386.deb"
- "https://dldir1.qq.com/weixin/Windows/${wechat_installer}.exe"
+_mirror="https://com-store-packages.uniontech.com"
+_mirror_lib="https://community-packages.deepin.com/deepin/pool/main"
+source=("$_mirror/appstore/pool/appstore/c/${debpkgname}/${debpkgname}_${deepinwechatver}_i386.deb"
+ "${wechat_installer}-${pkgver}.exe::https://github.com/tom-snow/wechat-windows-versions/releases/download/v${pkgver}/WeChatSetup-${pkgver}.exe"
+ "$_mirror_lib/o/openldap/libldap-2.4-2_2.4.47+dfsg.4-1+eagle_i386.deb"
+ "$_mirror_lib/c/cyrus-sasl2/libsasl2-2_2.1.27.1-1+dde_i386.deb"
"run.sh"
- "reg.patch")
-md5sums=('c66a173fe6817afd898e0061d9eaf42e'
- 'f4b84e3c21c3bd7f2217b144fdf8ebe0'
- '88abd550ffce483a3f9627d84e4d5e3a'
- '9c9d51ff585ff630473ce827159a8230')
+ "https://github.com/vufa/deepin-wine-wechat-arch/raw/action/mmmojo.dll"
+ "https://github.com/vufa/deepin-wine-wechat-arch/raw/action/mmmojo_64.dll")
+md5sums=('6c4edb108a0593bab7a556a6c9e8a012'
+ '3efd527ee04c027f401e3b0a460242c2'
+ 'cf87ad9db0bf279ddf9e5c1dce64a716'
+ '89b10711889f52ab0a386f37b4eb3212'
+ '758b560950adccb5778a7347410efcf6'
+ 'e8296fadc17b303dd5c77e4a05677ebd'
+ '2aa6b65bd19bbde32432ea06c28cc33d')
build() {
msg "Extracting DPKG package ..."
mkdir -p "${srcdir}/dpkgdir"
+ ar -x ${debpkgname}_${deepinwechatver}_i386.deb
tar -xvf data.tar.xz -C "${srcdir}/dpkgdir"
- sed "s/\(Categories.*$\)/\1Network;/" -i "${srcdir}/dpkgdir/usr/share/applications/deepin.com.wechat.desktop"
+ ar -x libldap-2.4-2_2.4.47+dfsg.4-1+eagle_i386.deb
+ tar -xvf data.tar.xz -C "${srcdir}/dpkgdir"
+ ar -x libsasl2-2_2.1.27.1-1+dde_i386.deb
+ tar -xvf data.tar.xz -C "${srcdir}/dpkgdir"
+ sed "s/\(Categories.*$\)/\1Network;/" -i "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/applications/${debpkgname}.desktop"
+ sed "13s/WeChat.exe/wechat.exe/" -i "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/applications/${debpkgname}.desktop"
+ sed "s/run.sh\".*/run.sh\"/" -i "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/applications/${debpkgname}.desktop"
msg "Extracting Deepin Wine WeChat archive ..."
- 7z x -aoa "${srcdir}/dpkgdir/opt/deepinwine/apps/Deepin-WeChat/files.7z" -o"${srcdir}/deepinwechatdir"
- msg "Removing original outdated WeChat directory ..."
+ 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/ ..."
+ install -m644 "${srcdir}/${wechat_installer}-${pkgver}.exe" "${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/"
+ msg "Copying mmmojo.dll and mmmojo_64.dll to ${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/ ..."
+ install -m644 "${srcdir}/mmmojo.dll" "${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/"
+ install -m644 "${srcdir}/mmmojo_64.dll" "${srcdir}/deepinwechatdir/drive_c/Program Files/Tencent/"
+ msg "Creating 'XPlugin/Plugins/XWeb' to forbid wechat browser creating crash logs ..."
+ mkdir -p "${srcdir}/deepinwechatdir/drive_c/users/@current_user@/Application Data/Tencent/WeChat/XPlugin/Plugins/"
+ touch "${srcdir}/deepinwechatdir/drive_c/users/@current_user@/Application Data/Tencent/WeChat/XPlugin/Plugins/XWeb"
+ #find -L "${srcdir}/deepinwechatdir/dosdevices" -maxdepth 1 -type l -delete
msg "Repackaging app archive ..."
7z a -t7z -r "${srcdir}/files.7z" "${srcdir}/deepinwechatdir/*"
}
package() {
msg "Preparing icons ..."
- install -d "${pkgdir}/usr/share"
- cp -a ${srcdir}/dpkgdir/usr/share/* "${pkgdir}/usr/share/"
- msg "Copying WeChat to /opt/deepinwine/apps/Deepin-WeChat ..."
- install -d "${pkgdir}/opt/deepinwine/apps/Deepin-WeChat"
- install -m644 "${srcdir}/files.7z" "${pkgdir}/opt/deepinwine/apps/Deepin-WeChat/"
- install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/deepinwine/apps/Deepin-WeChat/"
- install -m644 "${srcdir}/${wechat_installer}.exe" "${pkgdir}/opt/deepinwine/apps/Deepin-WeChat/"
+ install -d "${pkgdir}/usr/share/applications"
+ install -Dm644 "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/applications/${debpkgname}.desktop" "${pkgdir}/usr/share/applications/${debpkgname}.desktop"
+ cp -r "${srcdir}/dpkgdir/opt/apps/${debpkgname}/entries/icons/" "${pkgdir}/usr/share/"
+ msg "Copying deepin files ..."
+ install -d "${pkgdir}/opt/apps/${debpkgname}/files"
+ cp -r "${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/dlls" "${pkgdir}/opt/apps/${debpkgname}/files/"
+ install -m644 "${srcdir}/files.7z" "${pkgdir}/opt/apps/${debpkgname}/files/"
+ # cp ${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/helper_archive* "${pkgdir}/opt/apps/${debpkgname}/files/"
+ # install -m755 "${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/gtkGetFileNameDlg" "${pkgdir}/opt/apps/${debpkgname}/files/"
+ md5sum "${srcdir}/files.7z" | awk '{ print $1 }' > "${pkgdir}/opt/apps/${debpkgname}/files/files.md5sum"
+ install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/apps/${debpkgname}/files/"
+ msg "Copying deepin lib32 files ..."
+ install -d "${pkgdir}/opt/apps/${debpkgname}/files/lib32"
+ # cp ${srcdir}/dpkgdir/usr/lib/i386-linux-gnu/{liblber-2.4.so.2,libldap-2.4.so.2,libldap_r-2.4.so.2,libsasl2.so.2} "${pkgdir}/opt/apps/${debpkgname}/files/lib32"
+ cp ${srcdir}/dpkgdir/usr/lib/i386-linux-gnu/* "${pkgdir}/opt/apps/${debpkgname}/files/lib32"
}
diff --git a/README.md b/README.md
index efbe8c8a1076..9ce2f32476c7 100644
--- a/README.md
+++ b/README.md
@@ -1,41 +1,53 @@
-在Archlinux及衍生发行版上运行微信(WeChat)
-=======
+# 在 Archlinux 及衍生发行版上运行微信(WeChat) <!-- omit in toc -->
<p align="center">
- <a href="https://travis-ci.org/countstarlight/deepin-wine-wechat-arch">
- <img src="https://travis-ci.org/countstarlight/deepin-wine-wechat-arch.svg?branch=master" alt="Build Status">
+ <a href="https://github.com/vufa/deepin-wine-wechat-arch/actions">
+ <img src="https://img.shields.io/github/actions/workflow/status/vufa/deepin-wine-wechat-arch/ci.yml?branch=action&logo=github&style=flat-square">
</a>
<a href="https://pc.weixin.qq.com/">
- <img src="https://img.shields.io/badge/WeChat-2.6.8.52-blue.svg" alt="WeChat Version">
+ <img src="https://img.shields.io/badge/WeChat-3.9.0.28-blue?style=flat-square&logo=wechat" alt="WeChat Version">
</a>
<a href="https://aur.archlinux.org/packages/deepin-wine-wechat/">
- <img src="https://img.shields.io/aur/version/deepin-wine-wechat.svg" alt="AUR Version">
+ <img src="https://img.shields.io/aur/version/deepin-wine-wechat?label=AUR&logo=arch-linux&style=flat-square" alt="AUR Version">
</a>
- <a href="https://github.com/countstarlight/deepin-wine-wechat-arch/releases">
- <img src="https://img.shields.io/github/downloads/countstarlight/deepin-wine-wechat-arch/total.svg" alt="GitHub Release">
+ <a href="https://github.com/vufa/deepin-wine-wechat-arch/releases">
+ <img src="https://img.shields.io/github/downloads/vufa/deepin-wine-wechat-arch/total?logo=github&style=flat-square" alt="GitHub Release">
</a>
- <a href="https://github.com/countstarlight/deepin-wine-wechat-arch/issues">
- <img src="https://img.shields.io/github/issues/countstarlight/deepin-wine-wechat-arch.svg" alt="GitHub Issues">
+ <a href="https://github.com/vufa/deepin-wine-wechat-arch/issues">
+ <img src="https://img.shields.io/github/issues/vufa/deepin-wine-wechat-arch?logo=github&style=flat-square" alt="GitHub Issues">
</a>
</p>
-Deepin打包的微信(WeChat)容器移植到Archlinux,不依赖`deepin-wine`,包含定制的注册表配置,微信安装包替换为官方最新
+Deepin 打包的微信容器(`com.qq.weixin.deepin`)移植到 Archlinux,包含定制的运行脚本,微信安装包替换为官方最新
-<!-- TOC -->
+:warning: `deepin-wine-wechat` 从 `v3.5.0.46-2` 开始,默认使用 AUR 仓库 [deepin-wine6-stable](https://aur.archlinux.org/packages/deepin-wine6-stable/),不再依赖 `wine`,可以进行一些清理操作来保持系统整洁,具体参照: [从 `wine`/`deepin-wine 2.x` 迁移](#从-winedeepin-wine-2x-迁移)
- [安装](#安装)
- - [从 AUR 安装](#从-aur-安装)
- - [从 GitHub Release 安装](#从-github-release-安装)
- - [从源码安装](#从源码安装)
-- [常见问题](#常见问题)
+ - [从 AUR 安装](#从-aur-安装)
+ - [用安装包安装](#用安装包安装)
+ - [本地打包安装](#本地打包安装)
+- [设置](#设置)
+- [兼容性记录](#兼容性记录)
+- [切换到 `deepin-wine`](#切换到-deepin-wine)
+ - [自动切换(推荐)](#自动切换推荐)
+ - [从 `wine`/`deepin-wine 2.x` 迁移](#从-winedeepin-wine-2x-迁移)
+- [卸载](#卸载)
+- [常见问题及解决](#常见问题及解决)
+ - [中文字体显示为方框/显示模糊](#中文字体显示为方框显示模糊)
+ - [小程序中字体显示为方框](#小程序中字体显示为方框)
+ - [不能截图](#不能截图)
+ - [高分辨率屏幕支持](#高分辨率屏幕支持)
+ - [GNOME 桌面上的托盘图标](#gnome-桌面上的托盘图标)
+ - [消除阴影边框](#消除阴影边框)
+ - [唤出已运行的 WeChat 窗口](#唤出已运行的-wechat-窗口)
+ - [方法1](#方法1)
+ - [方法2](#方法2)
- [感谢](#感谢)
- [更新日志](#更新日志)
-<!-- /TOC -->
-
## 安装
-`deepin-wine-wechat`依赖`Multilib`仓库中的`wine`,`wine_gecko`和`wine-mono`,Archlinux默认没有开启`Multilib`仓库,需要编辑`/etc/pacman.conf`,取消对应行前面的注释([Archlinux wiki](https://wiki.archlinux.org/index.php/Official_repositories#multilib)):
+`deepin-wine-wechat`依赖`Multilib`仓库中的一些 32 位库,Archlinux 默认没有开启`Multilib`仓库,需要编辑`/etc/pacman.conf`,取消对应行前面的注释并更新本地数据库([Archlinux wiki](https://wiki.archlinux.org/index.php/Official_repositories#multilib)):
```diff
# If you want to run 32 bit applications on your x86_64 system,
@@ -50,51 +62,326 @@ Deepin打包的微信(WeChat)容器移植到Archlinux,不依赖`deepin-wine`
+Include = /etc/pacman.d/mirrorlist
```
+保存后执行
+
+```shell
+sudo pacman -Sy
+```
+
+:warning: **注意:由于新版微信可能需要 `wine` 还没有实现的一些 win api,这会导致一些功能不可用,安装前先根据[兼容性记录](#兼容性记录)选择一个合适的版本**
+
+:bulb: 以下三种安装方式效果相同,选择一种即可
+
### 从 AUR 安装
-已添加到AUR [deepin-wine-wechat](https://aur.archlinux.org/packages/deepin-wine-wechat/),可使用 `yay` 或 `yaourt` 安装:
+已添加到 AUR [deepin-wine-wechat](https://aur.archlinux.org/packages/deepin-wine-wechat/),可使用 `yay` 或 `yaourt` 安装:
```shell
yay -S deepin-wine-wechat
```
-### 从 GitHub Release 安装
+### 用安装包安装
-> 由 [Travis CI](https://travis-ci.org/countstarlight/deepin-wine-wechat-arch) 在 Docker 容器 [mikkeloscar/arch-travis](https://hub.docker.com/r/mikkeloscar/arch-travis) 中自动构建的 ArchLinux 安装包
+> 由 [GitHub Action](https://github.com/vufa/deepin-wine-wechat-arch/actions) 在 Docker 容器 [countstarlight/makepkg](https://hub.docker.com/r/countstarlight/makepkg) 中自动构建的 ArchLinux 安装包
-在[GitHub Release](https://github.com/countstarlight/deepin-wine-wechat-arch/releases)页面下载 `.pkg.tar.xz`后缀的安装包,使用`pacman`安装:
+在 [GitHub Release](https://github.com/vufa/deepin-wine-wechat-arch/releases) 页面下载后缀为 `.pkg.tar.xz` 或 `.pkg.tar.zst` 的安装包,使用`pacman`安装:
```bash
sudo pacman -U #下载的包名
```
-### 从源码安装
+`.md5` 文件用于校验包完整性:
+
+```bash
+md5sum -c *.md5
+```
+
+### 本地打包安装
```shell
- git clone https://github.com/countstarlight/deepin-wine-wechat-arch.git
+ git clone https://github.com/vufa/deepin-wine-wechat-arch.git
cd deepin-wine-wechat-arch
-
+
makepkg -si
```
-* 运行应用菜单中创建的WeChat,开始安装
-* 安装完可直接启动
+用上述三种安装方式之一安装完成后,运行应用菜单中创建的 WeChat 快捷方式,首次运行会用 WeChat 的安装包进行安装
+
+:warning: **注意:安装微信时不建议修改安装路径,如果修改默认路径,要对应修改 `deepin-wine-wechat` 的启动脚本(`/opt/apps/com.qq.weixin.deepin/files/run.sh`):**
+
+```bash
+EXEC_PATH="c:/Program Files/Tencent/WeChat/WeChat.exe"
+```
+
+改为修改后的安装路径,否则只有安装后第一次能够运行
+
+:warning: **注意:登录后请在`设置`里关闭微信的`自动更新`,微信启动时会检查更新并加载自动更新程序,由于默认屏蔽了微信的自动更新程序,会导致找不到更新程序而不能启动**
+
+## 设置
+
+dpi,系统版本,目录映射等可以在 `winecfg` 进行设置,打开 `winecfg` 的命令为:
+
+```bash
+/opt/apps/com.qq.weixin.deepin/files/run.sh winecfg
+```
+
+## 兼容性记录
+
+:warning: **注意:所有版本的摄像头均不可用**
+
+| 微信版本 | wine | 兼容性 | 备注 | deepin-wine | 兼容性 | 备注 |
+| :-----------------: | :-------: | :--------: | :----------------------------------------------------------: | :---------: | :----: | :----------------------------------------------------------: |
+| 3.9.0.28-2~ | \ | \ | \ | 6.0.0.42-1 | 部分 | 截图不可用,内置浏览器出现问题([#225](https://github.com/vufa/deepin-wine-wechat-arch/issues/225)) |
+| 3.8.0.41~3.8.1.26 | \ | \ | \ | 6.0.0.39-1 | 部分 | 截图不可用,内置浏览器出现问题([#225](https://github.com/vufa/deepin-wine-wechat-arch/issues/225)) |
+| 3.7.0.30~3.7.6.44 | \ | \ | \ | 6.0.0.24-1 | 部分 | 截图和表情包不可用,内置浏览器出现问题([#225](https://github.com/vufa/deepin-wine-wechat-arch/issues/225)) |
+| 3.5.0.46~3.7.0.30 | \ | \ | \ | 6.0.0.24-1 | 部分 | 小程序和公众号可用,截图([#192](https://github.com/vufa/deepin-wine-wechat-arch/issues/192))和表情包不可用([#177](https://github.com/vufa/deepin-wine-wechat-arch/issues/188)) |
+| 3.3.0.93~3.5.0.46 | \ | \ | \ | 5.0.16-1 | 支持 | |
+| 3.2.1.141~3.2.1.154 | 6.6 | | 截图功能不可用:[#87](https://github.com/vufa/deepin-wine-wechat-arch/issues/87) | 5.0.16-1 | 支持 | |
+| 3.2.1.127 | 6.5 | 部分 | 群聊闪退&截图功能不可用:[#87](https://github.com/vufa/deepin-wine-wechat-arch/issues/87) | 5.0.16-1 | 支持 | |
+| 3.1.0.41~3.1.0.72 | 5.22~6.0 | 部分 | 截图功能不可用:[#73](https://github.com/vufa/deepin-wine-wechat-arch/issues/73) | 5.0.16-1 | 支持 | |
+| 3.0.0.57 | 5.22 | **不支持** | 微信安装程序不能启动:[#92](https://github.com/vufa/deepin-wine-wechat-arch/issues/92) | 5.0.16-1 | 支持 | |
+| 3.0.0.57 | 5.19 | 支持 | | 2.18_24-3 | 支持 | |
+| 2.8.0.106~2.9.5.56 | 4.19~5.13 | 部分 | 发送图片有问题: [#42](https://github.com/vufa/deepin-wine-wechat-arch/issues/42) | 2.18_22-3 | 部分 | 发送图片有问题: [#42](https://github.com/vufa/deepin-wine-wechat-arch/issues/42) |
+| 2.7.1.82~2.7.1.88 | 4.19+ | 支持 | | | | |
+| 2.7.1.82~2.7.1.88 | 4.17~4.18 | 部分 | 不能使用中文输入法 | 2.18_18-2 | 不支持 | 闪退 |
+| 2.6.8.65 | 4.16 | 支持 | | 2.18_18-2 | 支持 | |
+
+## 切换到 `deepin-wine`
+
+:warning: `deepin-wine-wechat` 从 `v3.5.0.46-2` 开始,默认使用 AUR 仓库 [deepin-wine6-stable](https://aur.archlinux.org/packages/deepin-wine6-stable/),无需再进行任何切换操作,对于之前的版本,可以查看[旧版 README](https://github.com/vufa/deepin-wine-wechat-arch/blob/120d2dedd5dd9d018a14e8ff832f34fe2fcc57a3/README.md)。
+
+### 自动切换(推荐)
+
+对于之前的版本,可以查看[旧版 README](https://github.com/vufa/deepin-wine-wechat-arch/blob/120d2dedd5dd9d018a14e8ff832f34fe2fcc57a3/README.md)。
+
+### 从 `wine`/`deepin-wine 2.x` 迁移
+
+更新到 `deepin-wine-wechat v3.5.0.46-2` 及之后的版本后,依赖变更为 `deepin-wine6-stable`,
+
+如果此时没有其他应用在使用 `wine`, `deepin-wine 2.x` 和 `deepin-wine5`,就可以放心的卸载 `wine`, `deepin-wine 2.x` 和 `deepin-wine5` 及其依赖:
+
+```bash
+# 卸载 deepin-wine 2.x (如果有)
+sudo pacman -S lib32-freetype2 #用原版替换lib32-freetype2-infinality-ultimate
+sudo pacman -Rns deepin-wine xsettingsd # 卸载 deepin-wine 2.x
+
+# 卸载 deepin-wine5 (如果有)
+sudo pacman -Rns deepin-wine5
+
+# 卸载 wine (如果有)
+sudo pacman -Rns wine wine-mono wine-gecko
+```
+
+同时,由于 deepin 的打包中不再包含 `deepin-wine-helper`,现改为使用 AUR 仓库[deepin-wine-helper](https://aur.archlinux.org/packages/deepin-wine-helper),可以删除之前的 `deepin-wine-helper`:
+
+```bash
+rm -rf $HOME/.deepinwine/deepin-wine-helper
+```
+
+## 卸载
+
+无论用何种方式安装,卸载都是:
+
+```bash
+sudo pacman -Rns deepin-wine-wechat
+```
+
+卸载的同时会删除用户目录下的整个 `WINEPREFIX` 环境,路径为:`~/.deepinwine/Deepin-WeChat`
+
+微信在本地保存的数据不会被删除,如保存在用户文档下的数据(默认:`~/Documents/WeChat Files`)
-## 常见问题
+## 常见问题及解决
-- [ ] 1.不能视频通话
-- [ ] 2.不能截图
-- [x] 3.在 2k/4k 屏幕下字体和图标都非常小, 参见[issue1](https://github.com/countstarlight/deepin-wine-tim-arch/issues/1)
-- [x] 4.使用全局截图快捷键和解决Gnome上窗口化问题,参见[issue2](https://github.com/countstarlight/deepin-wine-tim-arch/issues/2)
+### 中文字体显示为方框/显示模糊
+
+`deepin-wine-wechat` 的字体文件夹在:`$HOME/.deepinwine/Deepin-WeChat/drive_c/windows/Fonts`
+
+经测试将 `微软雅黑` 伪装成 `宋体(simsun)` 的显示效果最好,具体可以参照 [bbs.deepin.org](https://bbs.deepin.org/zh/post/213530?offset=0&postId=1269543),将 `fake_simsun.ttc` 放到字体文件夹
+
+### 小程序中字体显示为方框
+
+> 参照 [deepin-wine-wechat-arch#186](https://github.com/vufa/deepin-wine-wechat-arch/issues/186)
+
+可以安装 `deepin-wine-wechat` 的可选依赖 [noto-fonts-sc](https://aur.archlinux.org/packages/noto-fonts-sc/)(只包含 `noto-fonts-cjk` 中的简体中文字体):
+
+```bash
+yay -S noto-fonts-sc
+```
+
+或安装 `noto-fonts-cjk` 并参照[ArchWiki](<https://wiki.archlinux.org/title/Localization_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Simplified_Chinese_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#.E4.BF.AE.E6.AD.A3.E7.AE.80.E4.BD.93.E4.B8.AD.E6.96.87.E6.98.BE.E7.A4.BA.E4.B8.BA.E5.BC.82.E4.BD.93.EF.BC.88.E6.97.A5.E6.96.87.EF.BC.89.E5.AD.97.E5.BD.A2>)进行配置
+
+### 不能截图
+
+对于之前的版本,可以查看[旧版 README](https://github.com/vufa/deepin-wine-wechat-arch/blob/120d2dedd5dd9d018a14e8ff832f34fe2fcc57a3/README.md)。
+
+### 高分辨率屏幕支持
+
+参照[设置](#设置)打开 `winecfg` ,在选项卡 `Graphics` 中修改 dpi,如 修改为`192`
+
+:bulb: 这一修改会在更新或重装后被重置,如果要在更新后保留 dpi 设置,可以添加环境变量
+
+> 根据 [deepin-wine-wechat-arch#173](https://github.com/vufa/deepin-wine-wechat-arch/issues/173),由[abcfy2](https://github.com/abcfy2)提供的方法
+
+编辑 `/etc/environment`,添加:
+
+```
+DEEPIN_WINE_SCALE=1.25
+```
+
+`1.25` 为缩放比例,计算方法和其他注意事项参照 [deepin-wine-wechat-arch#173(comment)](https://github.com/vufa/deepin-wine-wechat-arch/issues/173#issuecomment-989944258)
+
+### GNOME 桌面上的托盘图标
+
+安装 GNOME 插件: [AppIndicator and KStatusNotifierItem Support](https://extensions.gnome.org/extension/615/appindicator-support/)
+
+### 消除阴影边框
+
+对于之前的版本,可以查看[旧版 README](https://github.com/vufa/deepin-wine-wechat-arch/blob/120d2dedd5dd9d018a14e8ff832f34fe2fcc57a3/README.md)。
+
+### 唤出已运行的 WeChat 窗口
+
+#### 方法1
+
+运行命令:
+
+```bash
+/opt/apps/com.qq.weixin.deepin/files/run.sh -w
+```
+
+可以参考 [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) 将该命令存入脚本并添加到全局快捷键中,方便使用
+
+#### 方法2
+
+> 由 [thep0y](https://github.com/thep0y) 提供
+
+点击图标时如果已有正在运行的实例会导致错误的 kill,原因是`/opt/deepinwine/tools/kill.sh`中:
+
+```shell
+get_tray_window()
+{
+ # get_tray_window 是一个基于 python2 写的脚本,
+ # python2 已是被扔进历史垃圾堆的产物,这个垃圾在
+ # debian 10 中是关键组件,但在 Archlinux 中却
+ # 没有必要再安装这个垃圾。
+ $SHELL_DIR/get_tray_window | grep window_id: | awk -F: '{print $2}'
+}
+```
+
+我们需要安装一个依赖:
+
+```bash
+sudo pacman -S dbus-python
+```
+
+再将脚本`/opt/deepinwine/tools/get_tray_window`内容修改成如下代码:
+
+```python
+#!/usr/bin/env python
+
+def get_tray_window():
+ try:
+ import dbus
+ except ImportError:
+ return False
+
+ bus = dbus.SessionBus()
+ traymanager = bus.get_object("com.deepin.dde.TrayManager", "/com/deepin/dde/TrayManager")
+
+ windows = traymanager.Get("com.deepin.dde.TrayManager","TrayIcons")
+ str="window_id:"
+ for i in range(len(windows)):
+ str += '{:#x} '.format(windows[i])
+
+ print(str)
+
+if __name__ == "__main__":
+ get_tray_window()
+```
+
+保存退出后,点击图标就不会再退出原实例,而是会唤出原实例窗口了。
## 感谢
-* [Wuhan Deepin Technology Co.,Ltd.](http://www.deepin.org/)
+- [Wuhan Deepin Technology Co.,Ltd.](http://www.deepin.org/)
## 更新日志
-* 2019-06-02 WeChat-2.6.8.52
-* 2019-05-29 WeChat-2.6.8.51
-* 2019-04-03 WeChat-2.6.7.57
-* 2019-01-03 WeChat-2.6.2 \ No newline at end of file
+<details open>
+<summary>2023</summary>
+
+- 2023-02-23 WeChat-3.9.0.28
+- 2023-01-16 WeChat-3.8.1.26
+
+</details>
+
+<details>
+<summary>2022</summary>
+
+- 2022-11-30 WeChat-3.8.0.41
+- 2022-09-06 WeChat-3.7.6.44
+- 2022-08-20 WeChat-3.7.6.29
+- 2022-08-20 WeChat-3.7.6.24
+- 2022-08-17 WeChat-3.7.5.31
+- 2022-07-21 WeChat-3.7.5.23
+- 2022-06-09 WeChat-3.7.0.30
+- 2022-06-02 WeChat-3.7.0.29
+- 2022-03-20 WeChat-3.6.0.18 3.4.0.38deepin6
+- 2022-02-03 WeChat-3.5.0.46 3.4.0.38deepin4
+- 2022-01-27 WeChat-3.5.0.46
+- 2022-01-03 WeChat-3.4.5.45
+
+</details>
+
+<details>
+<summary>2021</summary>
+
+- 2021-12-11 WeChat-3.4.5.27
+- 2021-12-04 WeChat-3.4.0.54
+- 2021-11-12 WeChat-3.4.0.38 3.2.1.154deepin14
+- 2021-10-21 WeChat-3.4.0.38
+- 2021-08-29 WeChat-3.3.5.50
+- 2021-08-25 WeChat-3.3.5.42 3.2.1.154deepin13
+- 2021-08-13 WeChat-3.3.5.42
+- 2021-08-08 WeChat-3.3.5.34
+- 2021-07-05 WeChat-3.3.0.115
+- 2021-06-21 WeChat-3.3.0.93
+- 2021-05-07 WeChat-3.2.1.154 3.2.1.154deepin8
+- 2021-04-23 WeChat-3.2.1.154
+- 2021-04-19 WeChat-3.2.1.151
+- 2021-04-18 WeChat-3.2.1.141
+- 2021-04-02 WeChat-3.2.1.127
+- 2021-01-29 WeChat-3.1.0.72
+
+</details>
+<details>
+<summary>2020</summary>
+
+- 2020-12-29 WeChat-3.1.0.41
+- 2020-11-26 WeChat-3.0.0.57 2.9.5.41deepin7
+- 2020-10-16 WeChat-3.0.0.57
+- 2020-07-20 WeChat-2.9.5.56
+- 2020-07-02 WeChat-2.9.5.41
+- 2020-05-10 WeChat-2.9.0.123
+- 2020-04-24 WeChat-2.9.0.114
+- 2020-04-20 WeChat-2.9.0.112
+- 2020-03-08 WeChat-2.8.0.133
+- 2020-02-10 WeChat-2.8.0.121
+- 2020-01-20 WeChat-2.8.0.116
+- 2020-01-10 WeChat-2.8.0.112
+- 2020-01-04 WeChat-2.8.0.106
+
+</details>
+<details>
+<summary>2019</summary>
+
+- 2019-11-07 WeChat-2.7.1.88
+- 2019-10-23 WeChat-2.7.1.85
+- 2019-10-19 WeChat-2.7.1.82
+- 2019-07-25 WeChat-2.6.8.65
+- 2019-06-02 WeChat-2.6.8.52
+- 2019-05-29 WeChat-2.6.8.51
+- 2019-04-03 WeChat-2.6.7.57
+- 2019-01-03 WeChat-2.6.2
+
+</details>
diff --git a/deepin-wine-wechat.install b/deepin-wine-wechat.install
index 5b8b1f2b7c1e..bfe8c04e4597 100644
--- a/deepin-wine-wechat.install
+++ b/deepin-wine-wechat.install
@@ -1,5 +1,19 @@
+info() {
+ echo -e "\033[0;34m============================提示/INFO==============================="
+ echo -e "* 常见问题及解决(Troubleshoot):"
+ echo -e " https://github.com/vufa/deepin-wine-wechat-arch"
+ echo -e "* 反馈问题(Report issue):"
+ echo -e " https://github.com/vufa/deepin-wine-wechat-arch/issues"
+ echo -e "* 安装包下载(Installation package download):"
+ echo -e " https://github.com/vufa/deepin-wine-wechat-arch/releases"
+ echo -e "====================================================================\033[0m"
+}
+post_install() {
+ info
+}
post_upgrade() {
find /home -maxdepth 2 -name ".deepinwine" -exec rm -f \{\}/Deepin-WeChat/reinstalled \;
+ info
}
pre_remove() {
echo "deleting the WeChat bottle..."
diff --git a/gen.sh b/gen.sh
index 7b840fbf21f9..93de289c39be 100755
--- a/gen.sh
+++ b/gen.sh
@@ -1,43 +1,47 @@
#!/bin/sh
-GenPatch()
-{
- diff -ruN reg_tmp/ reg_tmp_fixed/ > reg.patch
+PACKAGE_NAME="deepin-wine-wechat"
+PACKAGE_SUFFIX=(".pkg.tar.xz" ".pkg.tar.zst")
+
+GenPatch() {
+ diff -ruN reg_tmp/ reg_tmp_fixed/ >reg.patch
}
-Extract()
-{
- rm -rf reg_tmp_fixed && \
- mkdir reg_tmp_fixed && \
- tar xvjf reg_files.tar.bz2 -C reg_tmp_fixed
+Extract() {
+ rm -rf reg_tmp_fixed &&
+ mkdir reg_tmp_fixed &&
+ tar xvjf reg_files.tar.bz2 -C reg_tmp_fixed
}
-GenSrcInfo()
-{
- makepkg --printsrcinfo > .SRCINFO
+GenSrcInfo() {
+ makepkg --printsrcinfo >.SRCINFO
}
-Clean()
-{
+Clean() {
git clean -xfd
}
-Tar()
-{
- cd reg_tmp && \
- tar -cvjSf reg_files.tar.bz2 * && \
- mv reg_files.tar.bz2 ../ && \
- cd ../
+Tar() {
+ cd reg_tmp &&
+ tar -cvjSf reg_files.tar.bz2 * &&
+ mv reg_files.tar.bz2 ../ &&
+ cd ../
+}
+
+MD5() {
+ for i in "${PACKAGE_SUFFIX[@]}"; do
+ find . -type f -name "${PACKAGE_NAME}*$i" -execdir sh -c 'md5sum "$1" > "$1.md5"' _ {} \;
+ done
}
-HelpApp()
-{
+HelpApp() {
echo " Extra Commands:"
echo " -p/--patch Generate patch files between reg_tmp/ and reg_tmp_fixed/"
echo " -e/--extract Extract reg files from reg_files.tar.bz2 to dir reg_tmp_fixed/"
echo " -g/--gen Generate AUR package info to .SRCINFO"
echo " -c/--clean Clean files which not track by git"
- echo " -t/--tar Package reg files and modify the md5 value in PKGBUILD"
+ echo " -t/--tar Package reg files"
+ echo " -m/--md5 Generate the md5 file of each package"
echo " -h/--help Show program help info"
}
@@ -47,28 +51,31 @@ if [ -z $1 ]; then
exit 0
fi
case $1 in
- "-p" | "--patch")
- GenPatch
+"-p" | "--patch")
+ GenPatch
;;
- "-e" | "--extract")
- Extract
+"-e" | "--extract")
+ Extract
+ ;;
+"-g" | "--gen")
+ GenSrcInfo
;;
- "-g" | "--gen")
- GenSrcInfo
+"-c" | "--clean")
+ Clean
;;
- "-c" | "--clean")
- Clean
+"-t" | "--tar")
+ Tar
;;
- "-t" | "--tar")
- Tar
+"-m" | "--md5")
+ MD5
;;
- "-h" | "--help")
- HelpApp
+"-h" | "--help")
+ HelpApp
;;
- *)
- echo -e "\033[31mgen: unrecognized option '$1' \033[0m"
- echo "Use -h|--help to get help"
- exit 1
+*)
+ echo -e "\033[31mgen: unrecognized option '$1' \033[0m"
+ echo "Use -h|--help to get help"
+ exit 1
;;
esac
exit 0
diff --git a/reg.patch b/reg.patch
deleted file mode 100644
index aa8fe6d20a41..000000000000
--- a/reg.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff -ruN reg_tmp/system.reg reg_tmp_fixed/system.reg
---- reg_tmp/system.reg 2018-04-03 13:53:26.000000000 +0800
-+++ reg_tmp_fixed/system.reg 2019-04-03 21:34:07.000000000 +0800
-@@ -30955,15 +30955,16 @@
- [Software\\Microsoft\\Windows\\CurrentVersion\\Winlogon] 1486457887
- #time=1d281204c9b71e0
-
--[Software\\Microsoft\\Windows NT\\CurrentVersion] 1507795882
--#time=1d34331b1382cd2
--"CSDVersion"="Service Pack 3"
--"CurrentBuildNumber"="2600"
-+[Software\\Microsoft\\Windows NT\\CurrentVersion] 1553355758
-+#time=1d4e18f0af44402
-+"CSDVersion"=""
-+"CurrentBuild"="17134"
-+"CurrentBuildNumber"="17134"
- "CurrentType"="Uniprocessor Free"
--"CurrentVersion"="5.1"
-+"CurrentVersion"="10.0"
- "InstallDate"=dword:4be5019a
- "ProductId"="12345-oem-0000001-54321"
--"ProductName"="Microsoft Windows XP"
-+"ProductName"="Microsoft Windows 10"
- "RegisteredOrganization"=""
- "RegisteredOwner"=""
- "SystemRoot"="C:\\windows"
-diff -ruN reg_tmp/update.policy reg_tmp_fixed/update.policy
---- reg_tmp/update.policy 2018-04-03 13:53:26.000000000 +0800
-+++ reg_tmp_fixed/update.policy 2018-02-23 20:31:32.000000000 +0800
-@@ -8,15 +8,14 @@
- ;; Ingore - Ingore file when copy.
-
- ;; Ingore update.policy itself.
--;; "^update.policy$" = "Ingore"
-+"^update.policy$" = "Ingore"
- "^.update-timestamp$" = "Ingore"
-
- ;; System registry files.
- "^(system|userdef|user).reg$" = "Registry"
-
- ;; Addtional assist files.
--"^drive_c/deepin" = "Keep"
--"^drive_c/deepin/EnvInit.sh" = "Keep"
-+"^drive_c/Deepin" = "Keep"
-
- ;; Microsoft Office files.
- "^drive_c/Windows/(?:control\.ini|hh\.dat|mapiuid\.ini|Reg Save Log\.txt)$" = "Override"
-diff -ruN reg_tmp/user.reg reg_tmp_fixed/user.reg
---- reg_tmp/user.reg 2018-04-03 13:53:26.000000000 +0800
-+++ reg_tmp_fixed/user.reg 2019-04-03 21:35:35.000000000 +0800
-@@ -815,6 +815,7 @@
- "androidassist"=""
- "mlang"="native,builtin"
- "msls31"="native,builtin"
-+"ntoskrnl.exe"=""
- "riched20"="native,builtin"
- "txplatform.exe"=""
- "txupd.exe"=""
diff --git a/run.sh b/run.sh
index 2cc75f7a1bf4..e3028e17abd2 100755
--- a/run.sh
+++ b/run.sh
@@ -5,116 +5,137 @@
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
-WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat"
-APPDIR="/opt/deepinwine/apps/Deepin-WeChat"
-APPVER="2.6.2.31deepin0"
+# Vufa <countstarlight@gmail.com>
+
+BOTTLENAME="Deepin-WeChat"
+APPVER="3.4.0.38deepin6"
+WINEPREFIX="$HOME/.deepinwine/$BOTTLENAME"
+WECHAT_FONTS="$WINEPREFIX/drive_c/windows/Fonts"
+WECHAT_VER="3.9.0.28"
+EXEC_PATH="c:/Program Files/Tencent/WeChat/WeChat.exe"
+EXEC_FILE="$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/WeChat.exe"
+START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
WECHAT_INSTALLER="WeChatSetup"
-APPTAR="files.7z"
-PACKAGENAME="com.wechat"
-WINE_CMD="wine"
-
-HelpApp()
-{
- echo " Extra Commands:"
- echo " -r/--reset Reset app to fix errors"
- echo " -e/--remove Remove deployed app files"
- echo " -h/--help Show program help info"
-}
-CallApp()
-{
- if [ ! -f "$WINEPREFIX/reinstalled" ]
- then
- touch $WINEPREFIX/reinstalled
- env WINEDLLOVERRIDES="winemenubuilder.exe=d" WINEPREFIX="$WINEPREFIX" $WINE_CMD $APPDIR/$WECHAT_INSTALLER.exe
- else
- #Support use native file dialog
- export ATTACH_FILE_DIALOG=1
+WECHAT_INSTALLER_PATH="c:/Program Files/Tencent/$WECHAT_INSTALLER-$WECHAT_VER.exe"
+export MIME_TYPE=""
+export DEB_PACKAGE_NAME="com.qq.weixin.deepin"
+export APPRUN_CMD="deepin-wine6-stable"
+DISABLE_ATTACH_FILE_DIALOG=""
+EXPORT_ENVS=""
- env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Tencent\\WeChat\\WeChat.exe" &
- fi
-}
-ExtractApp()
-{
- mkdir -p "$1"
- 7z x "$APPDIR/$APPTAR" -o"$1"
- mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
- sed -i "s#@current_user@#$USER#" $1/*.reg
-}
-DeployApp()
-{
- ExtractApp "$WINEPREFIX"
- echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
-}
-RemoveApp()
-{
- rm -rf "$WINEPREFIX"
+export SPECIFY_SHELL_DIR=$(dirname $START_SHELL_PATH)
+
+ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files"
+
+export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
+
+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"
}
-ResetApp()
-{
- echo "Reset $PACKAGENAME....."
- read -p "* Are you sure?(Y/N)" ANSWER
- if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" -o -z "$ANSWER" ]; then
- EvacuateApp
- DeployApp
- CallApp
- fi
+
+OpenWinecfg() {
+ msg 0 "Launching winecfg with $APPRUN_CMD in $WINEPREFIX ..."
+ env WINEPREFIX=$WINEPREFIX $APPRUN_CMD winecfg
}
-UpdateApp()
-{
- if [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
- return
- fi
- if [ -d "${WINEPREFIX}.tmpdir" ]; then
- rm -rf "${WINEPREFIX}.tmpdir"
- fi
- ExtractApp "${WINEPREFIX}.tmpdir"
- /opt/deepinwine/tools/updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
- rm -rf "${WINEPREFIX}.tmpdir"
- echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
+
+DeployApp() {
+ # backup fonts
+ if [ -d "$WECHAT_FONTS" ]; then
+ msg 0 "Backing up fonts ..."
+ mkdir -p $HOME/.deepinwine/.wechat_tmp
+ cp $WECHAT_FONTS/* $HOME/.deepinwine/.wechat_tmp/
+ fi
+
+ # deploy bottle
+ msg 0 "Deploying $WINEPREFIX ..."
+ rm -rf "$WINEPREFIX"
+ # run installer
+ msg 0 "Launching $WECHAT_INSTALLER_PATH ..."
+ env WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$WECHAT_INSTALLER_PATH" "$@"
+
+ # restore fonts
+ 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
}
-RunApp()
-{
- if [ -d "$WINEPREFIX" ]; then
- UpdateApp
- else
- DeployApp
- fi
- CallApp
+
+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
}
-CreateBottle()
-{
- if [ -d "$WINEPREFIX" ]; then
- UpdateApp
+Run() {
+ if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ]; then
+ export ATTACH_FILE_DIALOG=1
+ fi
+
+ if [ -n "$EXPORT_ENVS" ]; then
+ export $EXPORT_ENVS
+ fi
+
+ if [ -n "$EXEC_PATH" ]; then
+ if [ ! -f "$WINEPREFIX/reinstalled" ] || [ ! -f "$EXEC_FILE" ]; then
+ DeployApp
+ exit 0
+ fi
+
+ if [ -z "${EXEC_PATH##*.lnk*}" ]; then
+ # copy mmmojo.dll and mmmojo_64.dll
+ msg 0 "Copying mmmojo.dll and mmmojo_64.dll to $WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
+ cp -f "$WINEPREFIX/drive_c/Program Files/Tencent/mmmojo.dll" "$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
+ cp -f "$WINEPREFIX/drive_c/Program Files/Tencent/mmmojo_64.dll" "$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
+
+ msg 0 "Launching $EXEC_PATH lnk file ..."
+ $START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
+ else
+ # copy mmmojo.dll and mmmojo_64.dll
+ msg 0 "Copying mmmojo.dll and mmmojo_64.dll to $WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
+ cp -f "$WINEPREFIX/drive_c/Program Files/Tencent/mmmojo.dll" "$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
+ cp -f "$WINEPREFIX/drive_c/Program Files/Tencent/mmmojo_64.dll" "$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
+
+ msg 0 "Launching $EXEC_PATH ..."
+ $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
+ fi
else
- DeployApp
+ $START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
fi
}
+HelpApp() {
+ echo " Extra Commands:"
+ echo " winecfg Open winecfg"
+ echo " -w/--wake Wake up background program"
+ echo " -h/--help Show program help info"
+}
+
if [ -z $1 ]; then
- RunApp
- exit 0
+ Run "$@"
+ exit 0
fi
case $1 in
- "-r" | "--reset")
- ResetApp
- ;;
- "-c" | "--create")
- CreateBottle
- ;;
- "-e" | "--remove")
- RemoveApp
- ;;
- "-u" | "--uri")
- RunApp $2
- ;;
- "-h" | "--help")
- HelpApp
- ;;
- *)
- echo "Invalid option: $1"
- echo "Use -h|--help to get help"
- exit 1
- ;;
+"winecfg")
+ OpenWinecfg
+ ;;
+"-w" | "--wake")
+ WakeApp
+ ;;
+"-h" | "--help")
+ HelpApp
+ ;;
+*)
+ Run "$@"
+ ;;
esac
exit 0