summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorspecter1192020-02-11 16:18:03 +0800
committerspecter1192020-02-11 16:18:03 +0800
commita42041e02e53762e2b5e7c1a89c9e77fa91f8814 (patch)
tree6ee8b2699861b3a1b661f4b0d3acea20b1b988eb
parent1774e0fab9770b671be15082825173f7923feab2 (diff)
downloadaur-a42041e02e53762e2b5e7c1a89c9e77fa91f8814.tar.gz
update 2.8.10.2010deepin0, just make it work
-rw-r--r--.SRCINFO10
-rw-r--r--.gitignore8
-rw-r--r--PKGBUILD16
-rwxr-xr-xrun.sh119
4 files changed, 128 insertions, 25 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3a0ff3171d37..5ecc8964afb4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,16 @@
pkgbase = deepin-wxwork
pkgdesc = Tencent Weixin Work Client on Deepin Wine
- pkgver = 2.4.16.1347deepin0
- pkgrel = 2
+ pkgver = 2.8.10.2010deepin0
+ pkgrel = 1
url = http://www.deepin.com/
arch = x86_64
license = custom
depends = p7zip
depends = wine
- source = https://mirrors.tuna.tsinghua.edu.cn/deepin/pool/non-free/d/deepin.com.weixin.work/deepin.com.weixin.work_2.4.16.1347deepin0_i386.deb
+ source = https://mirrors.tuna.tsinghua.edu.cn/deepin/pool/non-free/d/deepin.com.weixin.work/deepin.com.weixin.work_2.8.10.2010deepin0_i386.deb
source = run.sh
- md5sums = dc47977f4799a11ec0b8d437185f5404
- md5sums = abafc528b0bc36910ea50c12ee4b0c3f
+ md5sums = a82495943fe4b748cf2b740704f1ec45
+ md5sums = 54e20108bcca254aeea3b37ceb74b5b2
pkgname = deepin-wxwork
diff --git a/.gitignore b/.gitignore
index 3d2df910b696..f43931a931e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-*.tar.xz
-deepin.com.weixin.work_*_i386.deb
-pkg/
-src/
+/*.tar.*
+/deepin.com.weixin.work_*_i386.deb
+/pkg/
+/src/
diff --git a/PKGBUILD b/PKGBUILD
index 1179ef774093..211d011fc092 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=deepin-wxwork
-pkgver=2.4.16.1347deepin0
-pkgrel=3
+pkgver=2.8.10.2010deepin0
+pkgrel=1
pkgdesc="Tencent Weixin Work Client on Deepin Wine"
arch=("x86_64")
url="http://www.deepin.com/"
@@ -11,13 +11,13 @@ source=(
"$_mirror/pool/non-free/d/deepin.com.weixin.work/deepin.com.weixin.work_${pkgver}_i386.deb"
run.sh
)
-md5sums=('dc47977f4799a11ec0b8d437185f5404'
- 'abafc528b0bc36910ea50c12ee4b0c3f')
+md5sums=('a82495943fe4b748cf2b740704f1ec45'
+ 'df6b75140bf0d043eea0c7b5696d4704')
package() {
- install -Dm755 run.sh opt/deepinwine/apps/Deepin-WXWork/run.sh
- cd ${srcdir}
- tar -xvf data.tar.xz -C ${pkgdir}
- cd ${pkgdir}
+ cd $srcdir
+ tar -xvf data.tar.xz -C $pkgdir
+ cd $pkgdir
+ install -Dm755 $srcdir/run.sh $pkgdir/opt/deepinwine/apps/Deepin-WXWork/run.sh
chmod -x usr/share/applications/deepin.com.weixin.work.desktop
}
diff --git a/run.sh b/run.sh
index 6cbeb1e5e9e8..6fbe27a0544b 100755
--- a/run.sh
+++ b/run.sh
@@ -1,15 +1,118 @@
+#!/bin/sh
+
WINEPREFIX="$HOME/.deepinwine/Deepin-WXWork"
APPDIR="/opt/deepinwine/apps/Deepin-WXWork"
APPVER="2.4.16.1347deepin0-1"
APPTAR="files.7z"
PACKAGENAME="deepin.com.wxwork"
+WINE_CMD="wine"
-if [ ! -d "$WINEPREFIX" ]; then
- mkdir -p $WINEPREFIX
- 7z x "$APPDIR/$APPTAR" -o"$WINEPREFIX"
- mv "$WINEPREFIX/drive_c/users/"{@current_user@,$USER}
- sed -i "s#@current_user@#$USER#" $WINEPREFIX/*.reg
-fi
+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 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
+
+ env WINEPREFIX="$WINEPREFIX" WINEDEBUG=-msvcrt $WINE_CMD "c:\\Program Files\\WXWork\\WXWork.exe" &
-export WINEPREFIX
-LANG=zh_CN.UTF-8 wine "$WINEPREFIX/drive_c/Program Files/WXWork/WXWork.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()
+{
+ if [ -d "$WINEPREFIX" ]; then
+ UpdateApp
+ else
+ DeployApp
+ fi
+ CallApp
+}
+
+CreateBottle()
+{
+ if [ -d "$WINEPREFIX" ]; then
+ UpdateApp
+ else
+ DeployApp
+ fi
+}
+
+if [ -z $1 ]; then
+ RunApp
+ 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
+ ;;
+esac
+exit 0 \ No newline at end of file