3 # Copyright (C) 2016 Deepin, Inc.
5 # Author: Li LongYu <lilongyu@linuxdeepin.com>
6 # Peng Hao <penghao@linuxdeepin.com>
8 version_gt
() { test "$(echo "$@
" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
11 BOTTLENAME
="Deepin-WXWork"
12 APPVER
="4.1.6.6017deepin5"
13 EXEC_PATH
="c:/Program Files/WXWork/WXWork.exe"
14 START_SHELL_PATH
="/opt/deepinwine/tools/run_v4.sh"
17 export DEB_PACKAGE_NAME
="com.qq.weixin.work.deepin"
18 export APPRUN_CMD
="deepin-wine6-stable"
20 export LD_LIBRARY_PATH
=/opt
/apps
/com.qq.weixin.work.deepin
/lib
/
22 DISABLE_ATTACH_FILE_DIALOG
=""
24 EXEC_NAME
="WXWork.exe"
26 export BOX86_EMU_CMD
="/opt/deepin-box86/stable/box86"
27 export DEF_EMU_NAME
="exagear"
28 export SPECIFY_SHELL_DIR
=${START_SHELL_PATH%/*}
29 export WINESERVICESNODELAY
=""
30 export WINESERVICESDISABLE
="nsiproxy"
32 ARCHIVE_FILE_DIR
="/opt/apps/$DEB_PACKAGE_NAME/files"
34 if [ -z "$APPRUN_CMD" ];then
35 export APPRUN_CMD
="/opt/deepin-wine6-stable/bin/wine"
37 if [ -f "$APPRUN_CMD" ];then
38 wine_path
=$
(dirname $APPRUN_CMD)
39 wine_path
=$
(realpath
"$wine_path/../")
40 export WINEDLLPATH
=$wine_path/lib
:$wine_path/lib64
42 export WINEDLLPATH
=/opt
/$APPRUN_CMD/lib
:/opt
/$APPRUN_CMD/lib64
45 export WINEPREDLL
="$ARCHIVE_FILE_DIR/dlls"
49 env WINEPREFIX
="$BOTTLEPATH" $APPRUN_CMD reg ADD
"$1" /v
"$2" /t
"$3" /d
"$4" /f
52 if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ];then
53 export ATTACH_FILE_DIALOG
=1
56 if [ -n "$EXPORT_ENVS" ];then
61 if [[ -z "$EXEC_PATH" ]] && [[ -n "$INSTALL_SETUP" ]];then
62 $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" -c
63 BOTTLEPATH
="$HOME/.deepinwine/$BOTTLENAME"
64 EXEC_PATH
=$
(find "$BOTTLEPATH" -name $EXEC_NAME |
head -1)
65 if [ -z "$EXEC_PATH" ];then
66 _SetRegistryValue
"HKCU\\Software\\Wine\\DllOverrides" winemenubuilder.exe REG_SZ
67 WINEPREFIX
="$BOTTLEPATH" $APPRUN_CMD "$ARCHIVE_FILE_DIR/$INSTALL_SETUP"
68 EXEC_PATH
=$
(find "$BOTTLEPATH" -name $EXEC_NAME |
head -1)
70 cp "$ARCHIVE_FILE_DIR/setup.md5sum" "$BOTTLEPATH"
73 if [ -z "$EXEC_PATH" ];then
79 if [ -n "$EXEC_PATH" ];then
80 if [ -z "${EXEC_PATH##*.lnk*}" ];then
81 $START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
82 elif [ -z "${EXEC_PATH##*.bat}" ];then
83 $START_SHELL_PATH $BOTTLENAME $APPVER "cmd" -f /c
"$EXEC_PATH" "${@:2}"
85 $START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
87 elif [ -n "$ACTIVEX_NAME" ] && [ $# -gt 1 ];then
88 $START_SHELL_PATH $BOTTLENAME $APPVER "$1" -f "${@:2}"
90 $START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"