加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
run.sh 4.41 KB
一键复制 编辑 原始数据 按行查看 历史
SamuelW. 提交于 2023-02-10 19:53 . Upgrade WeChat to '3.9.0.28'
#!/bin/sh
# Copyright (C) 2016 Deepin, Inc.
#
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
# Vufa <countstarlight@gmail.com>
BOTTLENAME="Deepin-WeChat"
APPVER="3.4.0.38deepin6"
WINEPREFIX="$HOME/.deepinwine/$BOTTLENAME"
WECHAT_FONTS="$WINEPREFIX/drive_c/windows/Fonts"
WECHAT_VER="3.9.0.28"
EXEC_PATH="c:/Program Files/Tencent/WeChat/WeChat.exe"
EXEC_FILE="$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/WeChat.exe"
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.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="deepin-wine6-stable"
DISABLE_ATTACH_FILE_DIALOG=""
EXPORT_ENVS=""
export SPECIFY_SHELL_DIR=$(dirname $START_SHELL_PATH)
ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files"
export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
export LD_LIBRARY_PATH=/opt/apps/$DEB_PACKAGE_NAME/files/lib32
export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"
msg() {
ECHO_LEVEL=("\033[1;32m==> " "\033[1;31m==> ERROR: ")
echo -e "${ECHO_LEVEL[$1]}\033[1;37m$2\033[0m"
}
OpenWinecfg() {
msg 0 "Launching winecfg with $APPRUN_CMD in $WINEPREFIX ..."
env WINEPREFIX=$WINEPREFIX $APPRUN_CMD winecfg
}
DeployApp() {
# backup fonts
if [ -d "$WECHAT_FONTS" ]; then
msg 0 "Backing up fonts ..."
mkdir -p $HOME/.deepinwine/.wechat_tmp
cp $WECHAT_FONTS/* $HOME/.deepinwine/.wechat_tmp/
fi
# deploy bottle
msg 0 "Deploying $WINEPREFIX ..."
rm -rf "$WINEPREFIX"
# run installer
msg 0 "Launching $WECHAT_INSTALLER_PATH ..."
env WINEDLLOVERRIDES="winemenubuilder.exe=d" $START_SHELL_PATH $BOTTLENAME $APPVER "$WECHAT_INSTALLER_PATH" "$@"
# restore fonts
if [ -d "$HOME/.deepinwine/.wechat_tmp" ]; then
msg 0 "Restoring fonts ..."
cp -n $HOME/.deepinwine/.wechat_tmp/* $WECHAT_FONTS/
rm -rf "$HOME/.deepinwine/.wechat_tmp"
fi
touch $WINEPREFIX/reinstalled
msg 0 "Creating $WINEPREFIX/PACKAGE_VERSION ..."
cat /opt/apps/$DEB_PACKAGE_NAME/files/files.md5sum >$WINEPREFIX/PACKAGE_VERSION
}
WakeApp() {
env WINEPREDLL="$ARCHIVE_FILE_DIR/dlls" \
WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64 \
WINEPREFIX=$WINEPREFIX $APPRUN_CMD /opt/deepinwine/tools/sendkeys.exe w
}
Run() {
if [ -z "$DISABLE_ATTACH_FILE_DIALOG" ]; then
export ATTACH_FILE_DIALOG=1
fi
if [ -n "$EXPORT_ENVS" ]; then
export $EXPORT_ENVS
fi
if [ -n "$EXEC_PATH" ]; then
if [ ! -f "$WINEPREFIX/reinstalled" ] || [ ! -f "$EXEC_FILE" ]; then
DeployApp
exit 0
fi
if [ -z "${EXEC_PATH##*.lnk*}" ]; then
# copy mmmojo.dll and mmmojo_64.dll
msg 0 "Copying mmmojo.dll and mmmojo_64.dll to $WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
cp -f "$WINEPREFIX/drive_c/Program Files/Tencent/mmmojo.dll" "$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
cp -f "$WINEPREFIX/drive_c/Program Files/Tencent/mmmojo_64.dll" "$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
msg 0 "Launching $EXEC_PATH lnk file ..."
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
else
# copy mmmojo.dll and mmmojo_64.dll
msg 0 "Copying mmmojo.dll and mmmojo_64.dll to $WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
cp -f "$WINEPREFIX/drive_c/Program Files/Tencent/mmmojo.dll" "$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
cp -f "$WINEPREFIX/drive_c/Program Files/Tencent/mmmojo_64.dll" "$WINEPREFIX/drive_c/Program Files/Tencent/WeChat/[$WECHAT_VER]/"
msg 0 "Launching $EXEC_PATH ..."
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
fi
else
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
fi
}
HelpApp() {
echo " Extra Commands:"
echo " winecfg Open winecfg"
echo " -w/--wake Wake up background program"
echo " -h/--help Show program help info"
}
if [ -z $1 ]; then
Run "$@"
exit 0
fi
case $1 in
"winecfg")
OpenWinecfg
;;
"-w" | "--wake")
WakeApp
;;
"-h" | "--help")
HelpApp
;;
*)
Run "$@"
;;
esac
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化