diff options
author | Codist | 2020-11-26 00:50:58 +0800 |
---|---|---|
committer | Codist | 2020-11-26 00:50:58 +0800 |
commit | 6cd54d3b09030519f984cc65a97242d98dae61c5 (patch) | |
tree | 0d2b8659132db9ce5fb1c8f20d78f09ff0cf947b | |
parent | edd35c34c276b46e111f6bb8e18073c5dc824cba (diff) | |
download | aur-6cd54d3b09030519f984cc65a97242d98dae61c5.tar.gz |
Upgrade deepin base package to 2.9.5.41deepin7 and add deepin-wine5 support.
Signed-off-by: Codist <countstarlight@gmail.com>
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | .travis.yml | 5 | ||||
-rw-r--r-- | PKGBUILD | 53 | ||||
-rw-r--r-- | README.md | 115 | ||||
-rw-r--r-- | reg.patch | 26 | ||||
-rwxr-xr-x | run.sh | 197 |
7 files changed, 127 insertions, 284 deletions
@@ -1,7 +1,7 @@ pkgbase = deepin-wine-wechat - pkgdesc = Tencent WeChat (com.wechat) on Deepin Wine For Archlinux + pkgdesc = Tencent WeChat on Deepin Wine(com.qq.weixin.deepin) For Archlinux pkgver = 3.0.0.57 - pkgrel = 1 + pkgrel = 2 url = https://weixin.qq.com/ install = deepin-wine-wechat.install arch = x86_64 @@ -11,7 +11,6 @@ pkgbase = deepin-wine-wechat depends = wine-mono depends = wine-gecko depends = xorg-xwininfo - depends = wqy-microhei depends = lib32-alsa-lib depends = lib32-alsa-plugins depends = lib32-libpulse @@ -19,15 +18,13 @@ pkgbase = deepin-wine-wechat depends = lib32-mpg123 depends = lib32-libldap conflicts = deepin-wechat - source = http://packages.deepin.com/deepin/pool/non-free/d/deepin.com.wechat/deepin.com.wechat_2.6.8.65deepin0_i386.deb + source = https://cdn-package-store6.deepin.com/appstore/pool/appstore/c/com.qq.weixin.deepin/com.qq.weixin.deepin_2.9.5.41deepin7_i386.deb source = WeChatSetup-3.0.0.57.exe::https://dldir1.qq.com/weixin/Windows/WeChatSetup.exe source = run.sh - source = reg.patch source = shadow.exe - md5sums = fe31cf4f0f6186fc1c99adc1512f5305 + md5sums = 42794ec8f1e61407e670f1382a0d72db md5sums = 2b103d675a045a2ef68c23c6c7339471 - md5sums = f6027f842f18f23137a33f0d97f38715 - md5sums = f264f961704f2aa1d480971b0e58617a + md5sums = 8df0ec751f3d426203be7bc32d3007e6 md5sums = d83f1c3845f28abd81cbfd215089d3d8 pkgname = deepin-wine-wechat diff --git a/.gitignore b/.gitignore index b15f2a37d299..a3282fe3e1ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/deepin.com.wechat* +/com.qq.weixin.deepin* /deepin-wine-wechat-*.pkg* /pkg/ /src/ diff --git a/.travis.yml b/.travis.yml index 7fd012909315..19d22064d628 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,8 @@ archlinux: - p7zip - wine - wine-mono - - wine_gecko + - wine-gecko - xorg-xwininfo - - xdotool - - wqy-microhei - - adobe-source-han-sans-cn-fonts - lib32-alsa-lib - lib32-alsa-plugins - lib32-libpulse @@ -3,56 +3,53 @@ pkgname=deepin-wine-wechat pkgver=3.0.0.57 wechat_installer=WeChatSetup -deepinwechatver=2.6.8.65deepin0 -pkgrel=1 -pkgdesc="Tencent WeChat (com.wechat) on Deepin Wine For Archlinux" +deepinwechatver=2.9.5.41deepin7 +debpkgname="com.qq.weixin.deepin" +pkgrel=2 +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' 'wine' 'wine-mono' 'wine-gecko' 'xorg-xwininfo' 'lib32-alsa-lib' 'lib32-alsa-plugins' 'lib32-libpulse' 'lib32-openal' 'lib32-mpg123' 'lib32-libldap') conflicts=('deepin-wechat') install="deepin-wine-wechat.install" -_mirror="http://packages.deepin.com/deepin" -source=("$_mirror/pool/non-free/d/deepin.com.wechat/deepin.com.wechat_${deepinwechatver}_i386.deb" +_mirror="https://cdn-package-store6.deepin.com" +source=("$_mirror/appstore/pool/appstore/c/${debpkgname}/${debpkgname}_${deepinwechatver}_i386.deb" "${wechat_installer}-${pkgver}.exe::https://dldir1.qq.com/weixin/Windows/${wechat_installer}.exe" "run.sh" - "reg.patch" "shadow.exe") -md5sums=('fe31cf4f0f6186fc1c99adc1512f5305' +md5sums=('42794ec8f1e61407e670f1382a0d72db' '2b103d675a045a2ef68c23c6c7339471' - 'f6027f842f18f23137a33f0d97f38715' - 'f264f961704f2aa1d480971b0e58617a' + '8df0ec751f3d426203be7bc32d3007e6' 'd83f1c3845f28abd81cbfd215089d3d8') build() { msg "Extracting DPKG package ..." mkdir -p "${srcdir}/dpkgdir" tar -xvf data.tar.xz -C "${srcdir}/dpkgdir" - sed "s/\(Categories.*$\)/\1Network;/" -i "${srcdir}/dpkgdir/usr/share/applications/deepin.com.wechat.desktop" - sed "13s/WeChat.exe/wechat.exe/" -i "${srcdir}/dpkgdir/usr/share/applications/deepin.com.wechat.desktop" + 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" msg "Extracting Deepin Wine WeChat archive ..." - 7z x -aoa "${srcdir}/dpkgdir/opt/deepinwine/apps/Deepin-WeChat/files.7z" -o"${srcdir}/deepinwechatdir" + 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" - find -L "${srcdir}/deepinwechatdir/dosdevices" -maxdepth 1 -type l -delete - msg "Patching reg files ..." - patch -p1 -d "${srcdir}/deepinwechatdir/" < "${srcdir}/reg.patch" - msg "Adding shadow.exe..." - cp "${srcdir}/shadow.exe" "${srcdir}/deepinwechatdir/drive_c/" - 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/" + #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 -m644 "${srcdir}/reg.patch" "${pkgdir}/opt/deepinwine/apps/Deepin-WeChat/" - install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/deepinwine/apps/Deepin-WeChat/" - install -m644 "${srcdir}/${wechat_installer}-${pkgver}.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" + 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/" } diff --git a/README.md b/README.md index 14a5f9a718fa..e2ef60fb7361 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ </a> </p> -Deepin打包的微信(WeChat)容器移植到Archlinux,不依赖`deepin-wine`,包含定制的注册表配置,微信安装包替换为官方最新 +Deepin打包的微信容器(`com.qq.weixin.deepin`)移植到Archlinux,不依赖`deepin-wine`,包含定制的运行脚本,微信安装包替换为官方最新 <!-- TOC --> @@ -30,11 +30,7 @@ Deepin打包的微信(WeChat)容器移植到Archlinux,不依赖`deepin-wine` - [兼容性记录](#兼容性记录) - [切换到 `deepin-wine`](#切换到-deepin-wine) - [自动切换(推荐)](#自动切换推荐) - - [手动切换](#手动切换) - - [1. 安装 `deepin-wine`](#1-安装-deepin-wine) - - [2. 对于非 GNOME 桌面(KDE, XFCE等)](#2-对于非-gnome-桌面kde-xfce等) - - [3. 删除已安装的微信目录](#3-删除已安装的微信目录) - - [4. 修复 `deepin-wine` 字体渲染发虚](#4-修复-deepin-wine-字体渲染发虚) + - [从 `deepin-wine 2.x` 迁移到 `deepin-wine 5.x`](#从-deepin-wine-2x-迁移到-deepin-wine-5x) - [常见问题及解决](#常见问题及解决) - [不能截图](#不能截图) - [高分辨率屏幕支持](#高分辨率屏幕支持) @@ -102,10 +98,10 @@ md5sum -c *.md5 用上述三种安装方式之一安装完成后,运行应用菜单中创建的 WeChat 快捷方式,首次运行会用 WeChat 的安装包进行安装 -**注意:安装微信时不需要修改安装路径,如果修改默认路径,要对应修改 `deepin-wine-wechat` 的启动脚本(`/opt/deepinwine/apps/Deepin-WeChat/run.sh`):** +**注意:安装微信时不需要修改安装路径,如果修改默认路径,要对应修改 `deepin-wine-wechat` 的启动脚本(`/opt/apps/com.qq.weixin.deepin/files/run.sh`):** ```bash -env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Tencent\\WeChat\\WeChat.exe" & +EXEC_PATH="c:/Program Files/Tencent/WeChat/WeChat.exe" ``` 改为修改后的安装路径,否则只有安装后第一次能够运行 @@ -115,6 +111,7 @@ env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Ten | 微信 | wine | 兼容性 | 备注 | deepin-wine | 兼容性 | 备注 | | :-------: | :-----: | :----: | :----------------------------------------------------------: | :---------: | :----: | :----------------------------------------------------------: | +| 3.0.0.57 | 5.22 | 支持 | | 5.0.16-1 | 支持 | | | 3.0.0.57 | 5.19 | 支持 | | 2.18_24-3 | 支持 | | | 2.9.5.56 | 5.13 | 部分 | 发送图片有问题: [#42](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/42) | 2.18_24-3 | 部分 | 发送图片有问题: [#42](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/42) | | 2.9.5.41 | 5.11 | 部分 | 发送图片有问题: [#42](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/42) | 2.18_22-3 | 部分 | 发送图片有问题: [#42](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/42) | @@ -142,74 +139,40 @@ env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Ten ### 自动切换(推荐) ```bash -/opt/deepinwine/apps/Deepin-WeChat/run.sh -d +/opt/apps/com.qq.weixin.deepin/files/run.sh -d ``` 这会安装需要的依赖,移除已安装的微信目录并回退对注册表文件的修改 -切换回 `wine`: +> 从 `v3.0.0.57-2` 开始,该命令会切换到 AUR 仓库:[deepin-wine5](https://aur.archlinux.org/packages/deepin-wine5) -```bash -rm ~/.deepinwine/Deepin-WeChat/deepin -``` - -如果要卸载自动安装的依赖: - -```bash -sudo pacman -Rns deepin-wine xsettingsd lib32-freetype2-infinality-ultimate -``` - -### 手动切换 -#### 1. 安装 `deepin-wine` +如果想切换回 `wine`: ```bash -yay -S deepin-wine +rm ~/.deepinwine/Deepin-WeChat/deepin ``` -#### 2. 对于非 GNOME 桌面(KDE, XFCE等) - -> 根据 [deepin-wine-wechat-arch#36](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/36#issuecomment-612001200),由[Face-Smile](https://github.com/Face-Smile)提供的方法 - -需要安装 `xsettingsd`: +如果要卸载自动安装的依赖: ```bash -sudo pacman -S xsettingsd -``` - -修改 `/opt/deepinwine/apps/Deepin-WeChat/run.sh`: - -```diff --WINE_CMD="wine" -+WINE_CMD="deepin-wine" - - RunApp() - { -+ if [[ -z "$(ps -e | grep -o xsettingsd)" ]] -+ then -+ /usr/bin/xsettingsd & -+ fi - if [ -d "$WINEPREFIX" ]; then - UpdateApp - else +sudo pacman -Rns deepin-wine5 ``` -**注意:对 `/opt/deepinwine/apps/Deepin-WeChat/run.sh` 的修改会在 `deepin-wine-wechat` 更新或重装时被覆盖,可以单独拷贝一份作为启动脚本** +### 从 `deepin-wine 2.x` 迁移到 `deepin-wine 5.x` -#### 3. 删除已安装的微信目录 +若之前使用的是 `deepin-wine 2.x`,更新到 `deepin-wine-wechat v3.0.0.57-2` 后会自动切换回 `wine`,运行命令: ```bash -rm -rf ~/.deepinwine/Deepin-WeChat +/opt/apps/com.qq.weixin.deepin/files/run.sh -d ``` -#### 4. 修复 `deepin-wine` 字体渲染发虚 +就会自动安装并切换到 `deepin-wine5` -kde桌面参考:[deepin-wine-wechat-arch#36](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/36) - -deepin 桌面: +若此时没有其他应用在使用旧版 `deepin-wine`,就可以放心的卸载旧版 `deepin-wine` 及其依赖: ```bash -yay -S lib32-freetype2-infinality-ultimate +sudo pacman -Rns deepin-wine xsettingsd lib32-freetype2-infinality-ultimate ``` **注意:切换到 `deepin-wine` 后,对 `wine` 的修改,如更改dpi,都改为对 `deepin-wine` 的修改** @@ -233,7 +196,7 @@ env WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" winecfg 对于 `deepin-wine` : ```bash -env WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" deepin-wine winecfg +env WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" deepin-wine5 winecfg ``` ### GNOME 桌面上的悬浮窗口问题 @@ -244,46 +207,7 @@ env WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" deepin-wine winecfg ### 消除阴影边框 -微信窗口不在最上方时,在其他窗口上会显示一个阴影边框 - -参照[切换到 `deepin-wine`](#切换到-deepin-wine) 解决,或者使用[shadow.exe](shadow.exe),在微信启动时运行,自动消除这个阴影边框 - -> 根据[“用山寨方法解决wine运行微信残留阴影窗口的问题”](https://blog.kangkang.org/index.php/archives/397),对原程序稍做修改编译出的 [shadow.exe](shadow.exe),源码文件为 [shadow.cpp](shadow.cpp) - -你也可以自行编译这个程序: - -```bash -# 安装windows交叉编译工具链 -yay -S mingw-w64-gcc - -# 编译 -i686-w64-mingw32-g++ -municode -m32 -static -s shadow.cpp -o shadow -``` - -对于 `v2.8.0.133-2` 及之前的版本,不自带这个程序,可以自行将[shadow.exe](shadow.exe)放置到 `~/.deepinwine/Deepin-WeChat/drive_c/shadow.exe` - -并参照[run.sh](run.sh)在 `/opt/deepinwine/apps/Deepin-WeChat/run.sh` 中加入如下几行: - -```diff -CallApp() -{ - if [ ! -f "$WINEPREFIX/reinstalled" ] - then - touch $WINEPREFIX/reinstalled -- env WINEDLLOVERRIDES="winemenubuilder.exe=d" WINEPREFIX="$WINEPREFIX" $WINE_CMD $APPDIR/$WECHAT_INSTALLER-$WECHAT_VER.exe -+ env WINEDLLOVERRIDES="winemenubuilder.exe=d" WINEPREFIX="$WINEPREFIX" $WINE_CMD $APPDIR/$WECHAT_INSTALLER-$WECHAT_VER.exe & - else - #Support use native file dialog - export ATTACH_FILE_DIALOG=1 - - env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Tencent\\WeChat\\WeChat.exe" & - fi -+ # run 'shadow.exe' if process not exist -+ if [[ -z "$(ps -e | grep -o 'shadow.exe')" ]]; then -+ env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\shadow.exe" & -+ fi -} -``` +微信窗口不在最上方时,在其他窗口上会显示一个阴影边框,参照[切换到 `deepin-wine`](#切换到-deepin-wine) 解决 ## 感谢 @@ -294,6 +218,7 @@ CallApp() <details open> <summary>2020</summary> +* 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 diff --git a/reg.patch b/reg.patch deleted file mode 100644 index 9be5d9ab8c59..000000000000 --- a/reg.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ruN reg_tmp/system.reg reg_tmp_fixed/system.reg ---- reg_tmp/system.reg 2019-08-27 15:06:17.000000000 +0800 -+++ reg_tmp_fixed/system.reg 2020-03-10 11:14:33.397830695 +0800 -@@ -30982,15 +30982,16 @@ - [Software\\Microsoft\\Windows\\CurrentVersion\\Winlogon] 1486457887 - #time=1d281204c9b71e0 - --[Software\\Microsoft\\Windows NT\\CurrentVersion] 1566803037 --#time=1d55bdc6e529798 --"CSDVersion"="Service Pack 3" --"CurrentBuildNumber"="2600" -+[Software\\Microsoft\\Windows NT\\CurrentVersion] 1571657811 -+#time=1d58803d4d74e20 -+"CSDVersion"="Service Pack 1" -+"CurrentBuild"="7601" -+"CurrentBuildNumber"="7601" - "CurrentType"="Uniprocessor Free" --"CurrentVersion"="5.1" -+"CurrentVersion"="6.1" - "InstallDate"=dword:4be5019a - "ProductId"="12345-oem-0000001-54321" --"ProductName"="Microsoft Windows XP" -+"ProductName"="Microsoft Windows 7" - "RegisteredOrganization"="" - "RegisteredOwner"="" - "SystemRoot"="C:\\windows" @@ -7,102 +7,48 @@ # Codist <countstarlight@gmail.com> -WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" -APPDIR="/opt/deepinwine/apps/Deepin-WeChat" -APPVER="2.6.8.65deepin0" -WECHAT_INSTALLER="WeChatSetup" -WECHAT_VER="3.0.0.57" -APPTAR="files.7z" -PACKAGENAME="com.wechat" -WINE_CMD="wine" +version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; } -HelpApp() +extract_archive() { - echo " Extra Commands:" - echo " -r/--reset Reset app to fix errors" - echo " -e/--remove Remove deployed app files" - echo " -d/--deepin Switch to 'deepin-wine'" - echo " -h/--help Show program help info" + archive=$1 + version_file=$2 + dest_dir=$3 + if [ -f "$archive" ] && [ -n "$dest_dir" ] && [ "$dest_dir" != "." ];then + archive_version=`cat $version_file` + if [ -d "$dest_dir" ];then + if [ -f "$dest_dir/VERSION" ];then + dest_version=`cat $dest_dir/VERSION` + if version_gt "$archive_version" "$dest_version" || [ -z "$dest_version" ];then + 7z x "$archive" -o/"$dest_dir" -aoa + echo "$archive_version" > "$dest_dir/VERSION" + fi + fi + else + mkdir -p $dest_dir + 7z x "$archive" -o/"$dest_dir" -aoa + echo "$archive_version" > "$dest_dir/VERSION" + fi + fi } -CallApp() -{ - if [ ! -f "$WINEPREFIX/reinstalled" ] - then - touch $WINEPREFIX/reinstalled - # stop the previous version of 'shadow.exe' - pkill -f "shadow.exe" - env WINEDLLOVERRIDES="winemenubuilder.exe=d" WINEPREFIX="$WINEPREFIX" $WINE_CMD $APPDIR/$WECHAT_INSTALLER-$WECHAT_VER.exe & - else - #Support use native file dialog - export ATTACH_FILE_DIALOG=1 - env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Tencent\\WeChat\\WeChat.exe" & - fi +BOTTLENAME="Deepin-WeChat" +APPVER="2.9.5.41deepin7" +WINEPREFIX="$HOME/.deepinwine/$BOTTLENAME" +WECHAT_VER="3.0.0.57" +EXEC_PATH="c:/Program Files/Tencent/WeChat/WeChat.exe" +START_SHELL_PATH="$HOME/.deepinwine/deepin-wine-helper/run_v3.sh" +WECHAT_INSTALLER="WeChatSetup" +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="wine" +export PATCH_LOADER_ENV="" +export FILEDLG_PLUGIN="/opt/apps/$DEB_PACKAGE_NAME/files/gtkGetFileNameDlg" - if [ "$WINE_CMD" = "wine" ]; then - # run 'shadow.exe' if process not exist - if [[ -z "$(ps -e | grep -o 'shadow.exe')" ]]; then - env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\shadow.exe" & - fi - 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" -} -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 -} -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" -} -RunApp() -{ - if [ -d "$WINEPREFIX" ]; then - UpdateApp - else - DeployApp - fi - CallApp -} +export SPECIFY_SHELL_DIR=`dirname $START_SHELL_PATH` -CreateBottle() -{ - if [ -d "$WINEPREFIX" ]; then - UpdateApp - else - DeployApp - fi -} +ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files" msg() { @@ -113,7 +59,7 @@ msg() SwitchToDeepinWine() { PACKAGE_MANAGER="yay" - DEEPIN_WINE_DEPENDS="deepin-wine" + DEEPIN_WINE_DEPENDS="deepin-wine5" if ! [ -x "$(command -v yay)" ]; then if ! [ -x "$(command -v yaourt)" ]; then msg 1 "Need to install 'yay' or 'yaourt' first." >&2 @@ -122,56 +68,63 @@ SwitchToDeepinWine() $PACKAGE_MANAGER="yaourt" fi fi - if [[ -z "$(ps -e | grep -o gsd-xsettings)" ]]; then - DEEPIN_WINE_DEPENDS="${DEEPIN_WINE_DEPENDS} xsettingsd" - fi - if [ "$XDG_CURRENT_DESKTOP" = "Deepin" ]; then - DEEPIN_WINE_DEPENDS="${DEEPIN_WINE_DEPENDS} lib32-freetype2-infinality-ultimate" - fi msg 0 "Installing dependencies: ${DEEPIN_WINE_DEPENDS} ..." $PACKAGE_MANAGER -S ${DEEPIN_WINE_DEPENDS} --needed msg 0 "Redeploying app ..." - if [ -d "$WINEPREFIX" ]; then - RemoveApp - fi - DeployApp - msg 0 "Reversing the patch ..." - patch -p1 -R -d ${WINEPREFIX} < $APPDIR/reg.patch - msg 0 "Creating flag file '$WINEPREFIX/deepin' ..." + $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" -r touch -f $WINEPREFIX/deepin + echo "5" > $WINEPREFIX/deepin msg 0 "Done." } -# Init +Run() +{ + extract_archive "$ARCHIVE_FILE_DIR/helper_archive.7z" "$ARCHIVE_FILE_DIR/helper_archive.md5sum" "$SPECIFY_SHELL_DIR" + + if [ -n "$PATCH_LOADER_ENV" ] && [ -n "$EXEC_PATH" ];then + export $PATCH_LOADER_ENV + fi + + if [ -n "$EXEC_PATH" ];then + if [ ! -f "$WINEPREFIX/reinstalled" ];then + touch $WINEPREFIX/reinstalled + env WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$WECHAT_INSTALLER_PATH" "$@" + else + $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@" + fi + else + $START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@" + fi +} + +HelpApp() +{ + echo " Extra Commands:" + echo " -d/--deepin Switch to 'deepin-wine'" + echo " -h/--help Show program help info" +} + if [ -f "$WINEPREFIX/deepin" ]; then - WINE_CMD="deepin-wine" - if [[ -z "$(ps -e | grep -o gsd-xsettings)" ]] && [[ -z "$(ps -e | grep -o xsettingsd)" ]]; then - if [[ ! -f "$HOME/.xsettingsd" ]] && [[ ! -f "$HOME/.config/xsettingsd/xsettingsd.conf" ]] && [[ ! -f "/etc/xsettingsd/xsettingsd.conf" ]]; then - mkdir -p "$HOME/.config/xsettingsd" && touch "$HOME/.config/xsettingsd/xsettingsd.conf" - fi - /usr/bin/xsettingsd & + if [ "$(cat $WINEPREFIX/deepin)" = "5" ]; then + export APPRUN_CMD="deepin-wine5" + else + rm $WINEPREFIX/deepin + export APPRUN_CMD="wine" fi +else + export APPRUN_CMD="wine" fi if [ -z $1 ]; then - RunApp + Run "$@" exit 0 fi case $1 in - "-r" | "--reset") - ResetApp - ;; - "-c" | "--create") - CreateBottle - ;; - "-e" | "--remove") - RemoveApp - ;; "-d" | "--deepin") SwitchToDeepinWine ;; "-u" | "--uri") - RunApp $2 + Run "$@" ;; "-h" | "--help") HelpApp |