net-proxy/shadowsocks-rust: add openrc init scripts
[gentoo-zh.git] / net-im / deepin-wine-wecom / files / deepin-wine-wecom-4.1.10.6007-run.sh
blobe3bf4a2e71cffbc9cc5f9749100adcf4d37f53cc
1 #!/bin/bash
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"; }
10 ACTIVEX_NAME=""
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"
15 export MIME_TYPE=""
16 export MIME_EXEC=""
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=""
23 EXPORT_ENVS=""
24 EXEC_NAME="WXWork.exe"
25 INSTALL_SETUP=""
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
41 else
42 export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
45 export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"
47 _SetRegistryValue()
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
57 export $EXPORT_ENVS
60 # 打包安装程序的情况
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
74 echo "安装失败退出"
75 exit
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}"
84 else
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}"
89 else
90 $START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"