diff options
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | PKGBUILD | 60 | ||||
-rw-r--r-- | README.md | 127 | ||||
-rw-r--r-- | deepin-wine-tim.install | 2 | ||||
-rw-r--r-- | reg.patch | 55 | ||||
-rwxr-xr-x | run.sh | 238 | ||||
-rw-r--r-- | share.7z | bin | 0 -> 1946 bytes |
8 files changed, 201 insertions, 303 deletions
@@ -1,8 +1,8 @@ pkgbase = deepin-wine-tim - pkgdesc = Tencent TIM (com.qq.office) on Deepin Wine For Archlinux - pkgver = 3.2.0.21856 + pkgdesc = Tencent TIM on Deepin Wine5(com.qq.office.deepin) For Archlinux + pkgver = 3.3.0.22020 pkgrel = 1 - url = http://tim.qq.com/ + url = https://tim.qq.com/ install = deepin-wine-tim.install arch = x86_64 license = custom @@ -21,14 +21,14 @@ pkgbase = deepin-wine-tim conflicts = wine-tim conflicts = deepin.com.qq.office conflicts = deepin-tim-for-arch - source = http://packages.deepin.com/deepin/pool/non-free/d/deepin.com.qq.office/deepin.com.qq.office_2.0.0deepin4_i386.deb - source = https://dldir1.qq.com/qqfile/qq/PCTIM/TIM3.2.0/TIM3.2.0.21856.exe + source = https://community-store-packages.deepin.com/appstore/pool/appstore/c/com.qq.im.deepin/com.qq.im.deepin_9.3.2deepin14_i386.deb + source = https://dldir1.qq.com/qqfile/qq/PCTIM/TIM3.3.0/TIM3.3.0.22020.exe source = run.sh - source = reg.patch - md5sums = d5c37cb4f960e13111ce24dbc0dd2d58 - md5sums = 534c33e25dfa6360f710e5df4f3da1dd - md5sums = dbb4a2773f41c3e7ed56fea650884560 - md5sums = d049e1171da0dc82c951b07cc534c39d + source = share.7z + md5sums = e12c4b26c791ca32cdc96e5441341148 + md5sums = 07fe0f065594b90673ab28d7388017d4 + md5sums = 3dcb24166e65ebbba4ba9a535402b34a + md5sums = 479ae2a04a9c5dcc08c67c7b1395a944 pkgname = deepin-wine-tim diff --git a/.gitignore b/.gitignore index 55b25a40739d..4709b27ddfa4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ TIM* -deepin.com.qq* +com.qq.* deepin-wine-tim-*.pkg* /pkg/ /src/ @@ -1,40 +1,44 @@ # Maintainer: Codist <countstarlight@gmail.com> pkgname=deepin-wine-tim -pkgver=3.2.0.21856 -deepintimver=2.0.0deepin4 +pkgver=3.3.0.22020 +debpkgver=9.3.2deepin14 +debpkgname="com.qq.im.deepin" +timpkgname="com.qq.office.deepin" pkgrel=1 -pkgdesc="Tencent TIM (com.qq.office) on Deepin Wine For Archlinux" +pkgdesc="Tencent TIM on Deepin Wine5(${timpkgname}) For Archlinux" arch=("x86_64") -url="http://tim.qq.com/" +url="https://tim.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-gnutls') conflicts=('wine-tim' 'deepin.com.qq.office' 'deepin-tim-for-arch') install="deepin-wine-tim.install" -_mirror="http://packages.deepin.com/deepin" -source=("$_mirror/pool/non-free/d/deepin.com.qq.office/deepin.com.qq.office_${deepintimver}_i386.deb" - "https://dldir1.qq.com/qqfile/qq/PCTIM/TIM3.2.0/TIM${pkgver}.exe" +_mirror="https://community-store-packages.deepin.com" +source=("$_mirror/appstore/pool/appstore/c/${debpkgname}/${debpkgname}_${debpkgver}_i386.deb" + "https://dldir1.qq.com/qqfile/qq/PCTIM/TIM3.3.0/TIM${pkgver}.exe" "run.sh" - "reg.patch") -md5sums=('d5c37cb4f960e13111ce24dbc0dd2d58' - '534c33e25dfa6360f710e5df4f3da1dd' - 'dbb4a2773f41c3e7ed56fea650884560' - 'd049e1171da0dc82c951b07cc534c39d') + "share.7z") +md5sums=('e12c4b26c791ca32cdc96e5441341148' + '07fe0f065594b90673ab28d7388017d4' + '3dcb24166e65ebbba4ba9a535402b34a' + '479ae2a04a9c5dcc08c67c7b1395a944') 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.qq.office.desktop" - sed "13s/TIM.exe/tim.exe/" -i "${srcdir}/dpkgdir/usr/share/applications/deepin.com.qq.office.desktop" - msg "Extracting Deepin Wine TIM archive ..." - 7z x -aoa "${srcdir}/dpkgdir/opt/deepinwine/apps/Deepin-TIM/files.7z" -o"${srcdir}/deepintimdir" - msg "Removing original outdated TIM directory ..." - rm -r "${srcdir}/deepintimdir/drive_c/Program Files/Tencent/TIM" - msg "Patching reg files ..." - patch -p1 -d "${srcdir}/deepintimdir/" < "${srcdir}/reg.patch" + #sed "s/\(Categories.*$\)/\1Network;/" -i "${srcdir}/dpkgdir/usr/share/applications/deepin.com.qq.office.desktop" + #sed "13s/TIM.exe/tim.exe/" -i "${srcdir}/dpkgdir/usr/share/applications/deepin.com.qq.office.desktop" + msg "Extracting Deepin Wine QQ archive ..." + 7z x -aoa "${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/files.7z" -o"${srcdir}/deepintimdir" + msg "Cleaning up the original package directory ..." + rm -r "${srcdir}/deepintimdir/drive_c/Program Files/Tencent/QQ" + #msg "Patching reg files ..." + #patch -p1 -d "${srcdir}/deepintimdir/" < "${srcdir}/reg.patch" msg "Creating font file link ..." ln -sf "/usr/share/fonts/wenquanyi/wqy-microhei/wqy-microhei.ttc" "${srcdir}/deepintimdir/drive_c/windows/Fonts/wqy-microhei.ttc" + msg "Copying latest TIM installer to ${srcdir}/deepintimdir/drive_c/Program Files/Tencent/ ..." + install -m644 "${srcdir}/TIM${pkgver}.exe" "${srcdir}/deepintimdir/drive_c/Program Files/Tencent/" msg "Repackaging app archive ..." 7z a -t7z -r "${srcdir}/files.7z" "${srcdir}/deepintimdir/*" } @@ -42,11 +46,13 @@ build() { package() { msg "Preparing icons ..." install -d "${pkgdir}/usr/share" - cp -a ${srcdir}/dpkgdir/usr/share/* "${pkgdir}/usr/share/" - msg "Copying TIM to /opt/deepinwine/apps/Deepin-TIM ..." - install -d "${pkgdir}/opt/deepinwine/apps/Deepin-TIM" - install -m644 "${srcdir}/files.7z" "${pkgdir}/opt/deepinwine/apps/Deepin-TIM/" - install -m644 "${srcdir}/reg.patch" "${pkgdir}/opt/deepinwine/apps/Deepin-TIM/" - install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/deepinwine/apps/Deepin-TIM/" - install -m644 "${srcdir}/TIM$pkgver.exe" "${pkgdir}/opt/deepinwine/apps/Deepin-TIM/" + 7z x -aoa "${srcdir}/share.7z" -o"${srcdir}/" + cp -a ${srcdir}/share/* "${pkgdir}/usr/share/" + msg "Copying deepin files ..." + install -d "${pkgdir}/opt/apps/${timpkgname}/files" + install -m644 "${srcdir}/files.7z" "${pkgdir}/opt/apps/${timpkgname}/files/" + cp ${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/helper_archive* "${pkgdir}/opt/apps/${timpkgname}/files/" + install -m755 "${srcdir}/dpkgdir/opt/apps/${debpkgname}/files/gtkGetFileNameDlg" "${pkgdir}/opt/apps/${timpkgname}/files/" + md5sum "${srcdir}/files.7z" | awk '{ print $1 }' > "${pkgdir}/opt/apps/${timpkgname}/files/files.md5sum" + install -m755 "${srcdir}/run.sh" "${pkgdir}/opt/apps/${timpkgname}/files/" } diff --git a/README.md b/README.md index efc5ca868af4..6ad88a9f1448 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ <img src="https://travis-ci.org/countstarlight/deepin-wine-tim-arch.svg?branch=master" alt="Build Status"> </a> <a href="https://office.qq.com/download.html"> - <img src="https://img.shields.io/badge/TIM-3.2.0.21856-blue.svg" alt="TIM Version"> + <img src="https://img.shields.io/badge/TIM-3.3.0.22020-blue.svg" alt="TIM Version"> </a> <a href="https://aur.archlinux.org/packages/deepin-wine-tim/"> <img src="https://img.shields.io/aur/version/deepin-wine-tim.svg" alt="AUR Version"> @@ -19,7 +19,7 @@ </a> </p> -Deepin 打包的 TIM 容器移植到 Archlinux,不依赖 `deepin-wine`,包含定制的注册表配置,TIM 安装包替换为官方最新 +Deepin 打包的 QQ 容器移植到 Archlinux,QQ 环境替换为 TIM,不依赖 `deepin-wine`,包含定制的注册表配置,TIM 安装包为官方最新 <!-- TOC --> @@ -27,14 +27,12 @@ Deepin 打包的 TIM 容器移植到 Archlinux,不依赖 `deepin-wine`,包 - [从AUR安装](#从aur安装) - [用安装包安装](#用安装包安装) - [本地打包安装](#本地打包安装) +- [设置](#设置) - [兼容性记录](#兼容性记录) - [切换到 `deepin-wine`](#切换到-deepin-wine) - [自动切换(推荐)](#自动切换推荐) - - [手动切换](#手动切换) - - [1. 安装 `deepin-wine`](#1-安装-deepin-wine) - - [2. 对于非 GNOME 桌面(KDE, XFCE等)](#2-对于非-gnome-桌面kde-xfce等) - - [3. 删除已安装的TIM目录](#3-删除已安装的tim目录) - - [4. 修复 `deepin-wine` 字体渲染发虚](#4-修复-deepin-wine-字体渲染发虚) + - [从 `deepin-wine 2.x` 迁移](#从-deepin-wine-2x-迁移) +- [卸载](#卸载) - [常见问题及解决](#常见问题及解决) - [不能记住密码](#不能记住密码) - [网络连接状态改变后不能重连](#网络连接状态改变后不能重连) @@ -69,7 +67,7 @@ Deepin 打包的 TIM 容器移植到 Archlinux,不依赖 `deepin-wine`,包 ### 从AUR安装 -已添加到 AUR [deepin-wine-tim](https://aur.archlinux.org/packages/deepin-wine-tim/),使用 `yay` 安装(如未安装 `yay`,请先 `pacman -S yay` 进行安装): +已添加到 AUR [deepin-wine-tim](https://aur.archlinux.org/packages/deepin-wine-tim/),使用 `yay` 安装: ```shell yay -S deepin-wine-tim @@ -77,7 +75,7 @@ yay -S deepin-wine-tim ### 用安装包安装 -> 由 [Travis CI](https://travis-ci.org/countstarlight/deepin-wine-tim-arch) 在 Docker 容器 [mikkeloscar/arch-travis](https://hub.docker.com/r/mikkeloscar/arch-travis) 中自动构建的 ArchLinux 安装包 +> 由 [Travis CI](https://travis-ci.org/countstarlight/deepin-wine-tim-arch) 在 Docker 容器 [countstarlight/arch-travis](https://hub.docker.com/r/countstarlight/arch-travis) 中自动构建的 ArchLinux 安装包 在 [GitHub Release](https://github.com/countstarlight/deepin-wine-tim-arch/releases) 页面下载后缀为 `.pkg.tar.xz` 或 `.pkg.tar.zst` 的安装包,使用`pacman`安装: @@ -103,20 +101,38 @@ md5sum -c *.md5 用上述三种安装方式之一安装完成后,运行应用菜单中创建的 TIM 快捷方式,首次运行会用 TIM 的安装包进行安装 -**注意:安装 TIM 时不需要修改安装路径,如果修改默认路径,要对应修改 `deepin-wine-tim` 的启动脚本(`/opt/deepinwine/apps/Deepin-TIM/run.sh`):** +**注意:安装 TIM 时不需要修改安装路径,如果修改默认路径,要对应修改 `deepin-wine-tim` 的启动脚本(`/opt/apps/com.qq.office.deepin/files/run.sh`):** ```bash -env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Tencent\\TIM\\Bin\\TIM.exe" & +EXEC_PATH="c:/Program Files/Tencent/TIM/Bin/TIM.exe" ``` 改为修改后的安装路径,否则只有安装后第一次能够运行 +**NOTE: 前几次运行时可能会提示 "qq安全组件异常",等一会再运行或重启一下系统** + +## 设置 + +> dpi,目录映射等可以在 `winecfg` 进行设置 + +如果使用默认的 `wine`,打开 `winecfg` 的命令为: + +```bash +env WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" winecfg +``` + +如果已经[切换到 `deepin-wine`](#切换到-deepin-wine),打开 `winecfg` 的命令为: + +```bash +env WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" deepin-wine5 winecfg +``` ## 兼容性记录 -| TIM | wine | 兼容性 | 备注 | deepin-wine | 兼容性 | 备注 | -| :---------: | :--: | :--------: | :------: | :---------: | :----: | :--: | -| 3.2.0.21856 | 5.18 | **不支持** | 无法启动 | 2.18_24-3 | 支持 | | -| 3.1.0.21789 | 5.16 | 支持 | | 2.18_24-3 | 支持 | | +| TIM | wine | 兼容性 | 备注 | deepin-wine | 兼容性 | 备注 | +| :---------: | :--: | :--------: | :--------------------------: | :---------: | :----: | :--: | +| 3.3.0.22020 | 6.1 | 部分 | 部分字体显示为方框且性能较差 | 5.0.16-1 | 支持 | | +| 3.2.0.21856 | 5.18 | **不支持** | 无法启动 | 2.18_24-3 | 支持 | | +| 3.1.0.21789 | 5.16 | 支持 | | 2.18_24-3 | 支持 | | ## 切换到 `deepin-wine` @@ -129,77 +145,56 @@ env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Ten ### 自动切换(推荐) ```bash -/opt/deepinwine/apps/Deepin-TIM/run.sh -d +/opt/apps/com.qq.office.deepin/files/run.sh -d ``` 这会安装需要的依赖,移除已安装的 TIM 目录并回退对注册表文件的修改 -切换回 `wine`: +> 从 `v3.3.0.22020-1` 开始,该命令会切换到 AUR 仓库:[deepin-wine5](https://aur.archlinux.org/packages/deepin-wine5) -```bash -rm ~/.deepinwine/Deepin-TIM/deepin -``` -如果要卸载自动安装的依赖: +如果想切换回 `wine`: ```bash -sudo pacman -Rns deepin-wine xsettingsd lib32-freetype2-infinality-ultimate +rm $HOME/.deepinwine/Deepin-TIM/deepin ``` -### 手动切换 - -#### 1. 安装 `deepin-wine` +如果要卸载自动安装的依赖: ```bash -yay -S deepin-wine +sudo pacman -Rns deepin-wine5 ``` -#### 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)提供的方法 +### 从 `deepin-wine 2.x` 迁移 -需要安装 `xsettingsd`: +若之前使用的是 `deepin-wine 2.x`,更新到 `deepin-wine-tim v3.3.0.22020-1` 及之后的版本会自动切换回 `wine`,运行命令: ```bash -sudo pacman -S xsettingsd +/opt/apps/com.qq.office.deepin/files/run.sh -d ``` -修改 `/opt/deepinwine/apps/Deepin-TIM/run.sh`: +就会自动安装并切换到 `deepin-wine5` -```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 -``` - -**注意:对 `/opt/deepinwine/apps/Deepin-TIM/run.sh` 的修改会在 `deepin-wine-tim` 更新或重装时被覆盖,可以单独拷贝一份作为启动脚本** - -#### 3. 删除已安装的TIM目录 +若此时没有其他应用在使用旧版 `deepin-wine`,就可以放心的卸载旧版 `deepin-wine` 及其依赖: ```bash -rm -rf ~/.deepinwine/Deepin-TIM +sudo pacman -S lib32-freetype2 #用原版替换lib32-freetype2-infinality-ultimate +sudo pacman -Rns deepin-wine xsettingsd ``` -#### 4. 修复 `deepin-wine` 字体渲染发虚 +**注意:切换到 `deepin-wine` 后,对 `wine` 的修改,如更改dpi,都改为对 `deepin-wine` 的修改** -kde桌面参考:[deepin-wine-wechat-arch#36](https://github.com/countstarlight/deepin-wine-wechat-arch/issues/36) +## 卸载 -deepin 桌面: +无论用何种方式安装,卸载都是: ```bash -yay -S lib32-freetype2-infinality-ultimate +sudo pacman -Rns deepin-wine-tim ``` -**注意:切换到 `deepin-wine` 后,对 `wine` 的修改,如更改dpi,都改为对 `deepin-wine` 的修改** +卸载的同时会删除用户目录下的整个 `WINEPREFIX` 环境,路径为:`~/.deepinwine/Deepin-TIM` + +TIM在本地保存的数据不会被删除,如保存在用户文档下的数据(默认:`~/Documents/Tencent Files`) ## 常见问题及解决 @@ -213,19 +208,7 @@ yay -S lib32-freetype2-infinality-ultimate ### 高分辨率屏幕支持 -在 `winecfg` 的Graphics选项卡中修改dpi,如 修改为`192` - -对于 `wine`: - -```bash -env WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" winecfg -``` - -对于 `deepin-wine` : - -```bash -env WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" deepin-wine winecfg -``` +参照[设置](#设置)打开 `winecfg` ,在选项卡 `Graphics` 中修改dpi,如 修改为`192` ### GNOME 桌面上的悬浮窗口问题 @@ -250,6 +233,12 @@ env WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" deepin-wine winecfg ## 更新日志 <details open> +<summary>2021</summary> + +* 2021-02-03 TIM-3.3.0.22020 com.qq.im.deepin_9.3.2deepin14 + +</details> +<details> <summary>2020</summary> * 2020-09-30 TIM-3.2.0.21856 diff --git a/deepin-wine-tim.install b/deepin-wine-tim.install index b25162c63398..955fd240d660 100644 --- a/deepin-wine-tim.install +++ b/deepin-wine-tim.install @@ -2,7 +2,7 @@ info() { echo -e "\033[0;34m============================提示/INFO===============================" echo -e "* 反馈问题(Report issue):" echo -e " https://github.com/countstarlight/deepin-wine-tim-arch/issues" - echo -e "* 切换到 'deepin-wine'(Switch to 'deepin-wine'):" + echo -e "* 切换到 'deepin-wine5'(Switch to 'deepin-wine5'):" echo -e " https://github.com/countstarlight/deepin-wine-tim-arch" echo -e "* 安装包下载(Installation package download):" echo -e " https://github.com/countstarlight/deepin-wine-tim-arch/releases" diff --git a/reg.patch b/reg.patch deleted file mode 100644 index 380cd1dbe90d..000000000000 --- a/reg.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff -ruN reg_tmp/system.reg reg_tmp_fixed/system.reg ---- reg_tmp/system.reg 2018-07-10 09:05:51.000000000 +0800 -+++ reg_tmp_fixed/system.reg 2020-09-30 10:49:52.685269410 +0800 -@@ -33235,7 +33235,7 @@ - #time=1d375560815cedc - "DisplayIcon"="C:\\Program Files\\Tencent\\TIM\\TIMUninst.ico" - "DisplayName"="TIM" --"DisplayVersion"="2.0.0.22317" -+"DisplayVersion"="3.2.0.21856" - "EstimatedSize"=dword:0002f7d0 - "HelpLink"="http://www.tencent.com" - "HelpTelephone"="(86) 755 86060836" -@@ -33259,15 +33259,16 @@ - [Software\\Microsoft\\Windows\\CurrentVersion\\Winlogon] 1488419467 - #time=1d292f775c45ac6 - --[Software\\Microsoft\\Windows NT\\CurrentVersion] 1508383851 --#time=1d3488aa9ba4da6 --"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" -@@ -34752,7 +34753,7 @@ - - [Software\\Tencent\\PlatForm_Type_List\\1] 1511754918 - #time=1d367338a03faee --"TypeName"="TIM2.0.0" -+"TypeName"="TIM3.2.0" - "TypePath"="c:\\Program Files\\Tencent\\TIM\\Bin\\TIM.exe" - - [Software\\Tencent\\QQ2009\\Component] 1488419637 -diff -ruN reg_tmp/user.reg reg_tmp_fixed/user.reg ---- reg_tmp/user.reg 2018-07-10 09:05:51.000000000 +0800 -+++ reg_tmp_fixed/user.reg 2020-09-30 10:47:13.175262388 +0800 -@@ -1024,6 +1024,7 @@ - "qdantidrv.sys"="" - "qqsetupex.exe"="" - "riched20"="native,builtin" -+"tencentdl.exe"="" - "txplatform.exe"="" - "txupd.exe"="" - "usp10"="native,builtin" @@ -7,178 +7,136 @@ # Codist <countstarlight@gmail.com> -WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" -APPDIR="/opt/deepinwine/apps/Deepin-TIM" -APPVER="3.2.0.21856" -APPTAR="files.7z" -PACKAGENAME="com.qq.tim" -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 - env WINEPREFIX="$WINEPREFIX" $WINE_CMD $APPDIR/TIM$APPVER.exe - else - #disable Tencent MiniBrowser - #_DeleteRegistry "HKCU\\Software\\Tencent\\MiniBrowser" - #Support use native file dialog - export ATTACH_FILE_DIALOG=1 +BOTTLENAME="Deepin-TIM" +APPVER="9.3.2deepin14" +WINEPREFIX="$HOME/.deepinwine/$BOTTLENAME" +TIM_VER="3.3.0.22020" +EXEC_PATH="c:/Program Files/Tencent/TIM/Bin/TIM.exe" +START_SHELL_PATH="$HOME/.deepinwine/deepin-wine-helper/run_v3.sh" +TIM_INSTALLER_PATH="c:/Program Files/Tencent/TIM$TIM_VER.exe" +export MIME_TYPE="" +export DEB_PACKAGE_NAME="com.qq.office.deepin" +#export APPRUN_CMD="wine" +export PATCH_LOADER_ENV="" +export FILEDLG_PLUGIN="/opt/apps/$DEB_PACKAGE_NAME/files/gtkGetFileNameDlg" - env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\Tencent\\TIM\\Bin\\TIM.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" -} -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() +export SPECIFY_SHELL_DIR=`dirname $START_SHELL_PATH` + +ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files" + +msg() { - if [ -d "$WINEPREFIX" ]; then - UpdateApp - else - DeployApp - fi - CallApp + ECHO_LEVEL=("\033[1;32m==> " "\033[1;31m==> ERROR: ") + echo -e "${ECHO_LEVEL[$1]}\033[1;37m$2\033[0m" } -CreateBottle() +SwitchToDeepinWine() { - if [ -d "$WINEPREFIX" ]; then - UpdateApp - else - DeployApp + PACKAGE_MANAGER="yay" + 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 + exit 1 + else + $PACKAGE_MANAGER="yaourt" + fi fi + for p in ${DEEPIN_WINE_DEPENDS}; do + if pacman -Qs $p > /dev/null ; then + msg 0 "$p is installed, skip ..." + else + msg 0 "Installing dependency: $p ..." + $PACKAGE_MANAGER -S $p + fi + done + msg 0 "Redeploying app ..." + extract_archive "$ARCHIVE_FILE_DIR/helper_archive.7z" "$ARCHIVE_FILE_DIR/helper_archive.md5sum" "$SPECIFY_SHELL_DIR" + $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" -r + #msg 0 "Reversing the patch ..." + #patch -p1 -R -d ${WINEPREFIX} < $ARCHIVE_FILE_DIR/reg.patch + echo "5" > $WINEPREFIX/deepin + rm -f $WINEPREFIX/reinstalled + msg 0 "Done." + exit 0 } -msg() +Run() { - ECHO_LEVEL=("\033[1;32m==> " "\033[1;31m==> ERROR: ") - echo -e "${ECHO_LEVEL[$1]}\033[1;37m$2\033[0m" + 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 LC_ALL=zh_CN.UTF-8 WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$TIM_INSTALLER_PATH" "$@" + else + env LC_ALL=zh_CN.UTF-8 $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@" + fi + else + env LC_ALL=zh_CN.UTF-8 $START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@" + fi } -SwitchToDeepinWine() +HelpApp() { - PACKAGE_MANAGER="yay" - DEEPIN_WINE_DEPENDS="deepin-wine" - if ! [ -x "$(command -v yay)" ]; then - if ! [ -x "$(command -v yaourt)" ]; then - msg 1 "Need to install 'yay' or 'yaourt' first." >&2 - exit 1 - else - $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 - for p in ${DEEPIN_WINE_DEPENDS}; do - if pacman -Qs $p > /dev/null ; then - msg 0 "$p is installed, skip ..." - else - msg 0 "Installing dependency: $p ..." - $PACKAGE_MANAGER -S $p - fi - done - 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' ..." - touch -f $WINEPREFIX/deepin - msg 0 "Done." - exit 0 + echo " Extra Commands:" + echo " -d/--deepin Switch to 'deepin-wine'" + echo " -h/--help Show program help info" } -# Init 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 & - fi + 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 - ;; "-h" | "--help") HelpApp ;; *) - echo "Invalid option: $1" - echo "Use -h|--help to get help" - exit 1 + Run "$@" ;; esac exit 0 diff --git a/share.7z b/share.7z Binary files differnew file mode 100644 index 000000000000..fdb4e02d4d6d --- /dev/null +++ b/share.7z |