blob: 163ecb17924a98032aaa94ee6a656d1b140e04d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
post_install() {
PACK_NAME="com.qq.weixin.mejituu" #软件包名
BOTTLE_NAME="Mejituu-WeChat" #容器名
ACTIVEX_NAME=""
function zenity() {
local user=$(logname 2>/dev/null || echo $SUDO_USER)
local uid=$(id -u "$user")
su "$user" -c "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus zenity $*"
}
isInstallDesktop="no"
if [ -d "/host/opt/apps/cn.flamescion.bookworm-compatibility-mode" ] || [ -f "/host/etc/default/grub" ]
then
echo "检测到ACE兼容环境"
isInstallDesktop=`zenity --entry --title="微信(懵仙兔兔) 安装工具" --text="检测到ACE兼容环境,是否需要强制安装desktop到用户目录(默认:no,安装请输入:yes)\n注:一般适用于Arch Linux和Fedora,除非你遇到不能正常安装desktop\n\t或者你需要使用微信(懵仙兔兔) 监视器就需要安装!!!\n不需要请默认!!!" --entry-text "no" --width=400`
timeZone=$(cat /etc/timezone)
if [ "${timeZone}" != "Asia/Shanghai" ]
then
isReviseTimeZone=`zenity --entry --title="微信(懵仙兔兔) 安装工具" --text="检测到ACE兼容环境中的时区不是中国时区,是否需要修改为中国时区(默认:yes,不需要请输入:no)\n不需要请默认!!!" --entry-text "yes" --width=400`
if [ "${isReviseTimeZone}" = "yes" ]
then
ln -snf "/usr/share/zoneinfo/Asia/Shanghai" "/etc/localtime" && echo "Asia/Shanghai" >| "/etc/timezone"
fi
fi
if [ "${isInstallDesktop}" = "yes" ]
then
zenity --info --title="微信(懵仙兔兔) 安装工具" --text="因你选择需要强制安装desktop到用户目录,请彻底安装完成后在系统内(不是ACE里)执行下列操作才能显示\nupdate-desktop-database ~/.local/share/applications\n或者重启" --width=400 &
fi
fi
if [ ! -d "/usr/lib/p7zip" ] && [ -d "/usr/lib/7zip" ]
then
echo "检测到p7zip过度到7zip"
if [ ! -d "/opt/p7zip-legacy" ]
then
zenity --warning --title="微信(懵仙兔兔) 安装工具" --text="警告!!!\n检测到软件包 p7zip 过度到 7zip\n将会导致解压异常以至于运行异常!!!\n请回退 p7zip p7zip-full 软件包版本!!!" --width=400 &
fi
fi
for username in $(getent passwd | cut -d: -f1); do
homedir=$(getent passwd "$username" | cut -d: -f6)
if [ -d "${homedir}/.deepinwine/${BOTTLE_NAME}" ]; then
rm -rf "${homedir}/.deepinwine/${BOTTLE_NAME}"
fi
if [ "${isInstallDesktop}" = "yes" ]
then
cat "/opt/apps/com.qq.weixin.mejituu/entries/applications/com.qq.weixin.mejituu.desktop" | sed "s#^Exec=\(.*\)#Exec=bookworm-run \1#" >| "/home/${username}/.local/share/applications/com.qq.weixin.mejituu.desktop"
chown ${username}:${username} "/home/${username}/.local/share/applications/com.qq.weixin.mejituu.desktop"
cat "/opt/apps/com.qq.weixin.mejituu/entries/applications/com.qq.weixin.mejituu-fix.desktop" | sed "s#^Exec=\(.*\)#Exec=bookworm-run \1#" >| "/home/${username}/.local/share/applications/com.qq.weixin.mejituu-fix.desktop"
chown ${username}:${username} "/home/${username}/.local/share/applications/com.qq.weixin.mejituu-fix.desktop"
cat "/opt/apps/com.qq.weixin.mejituu/entries/applications/com.qq.weixin.mejituu-monitor.desktop" | sed "s#^Exec=\"\(.*\)#Exec=\"/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env\1#" >| "/home/${username}/.local/share/applications/com.qq.weixin.mejituu-monitor.desktop"
chown ${username}:${username} "/home/${username}/.local/share/applications/com.qq.weixin.mejituu-monitor.desktop"
fi
done
if [ -n "${ACTIVEX_NAME}" ]
then
if [ ! -d "/usr/lib/mozilla/plugins" ]
then
mkdir -p "/usr/lib/mozilla/plugins"
fi
cp "/usr/share/pipelight/libpipelight.so" "/usr/lib/mozilla/plugins/libpipelight-${ACTIVEX_NAME}.so"
fi
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database
fi
# Make sure the script returns 0
true
}
post_upgrade() {
post_install
}
post_remove() {
BOTTLE_NAME="Mejituu-WeChat" #在引号中填写容器名
PACK_NAME="com.qq.weixin.mejituu" #在引号中填写软件包名
ACTIVEX_NAME="" #activex相关,若未使用,可不设置
### 以下为功能段,若只用于打包则以下内容可不看,只填写上方即可
if [ "$1" = "remove" ] || [ "$1" = "purge" ]
then
echo "清理卸载残留"
if [ -n "${ACTIVEX_NAME}" ]
then
rm "/usr/lib/mozilla/plugins/libpipelight-${ACTIVEX_NAME}.so"
fi
if [ -z "${BOTTLE_NAME}" ]
then
echo "W: 没有指定容器,跳过清理容器。请手动前往 ~/.deepinwine/ 下删除"
fi
if [ -e "/opt/deepinwine/tools/spark_kill.sh" ]
then
/opt/deepinwine/tools/spark_kill.sh "${BOTTLE_NAME}"
###这里注意,如果没写BOTTLE_NAME,会把QQ杀了
fi
for username in $(ls /home)
do
echo "/home/${username}"
if [ -d "/home/${username}/.deepinwine/${BOTTLE_NAME}" ]
then
rm -rf "/home/${username}/.deepinwine/${BOTTLE_NAME}"
fi
rm -f "/home/${username}/.local/share/applications/com.qq.weixin.mejituu.desktop" "/home/${username}/.local/share/applications/com.qq.weixin.mejituu-fix.desktop" "/home/${username}/.local/share/applications/com.qq.weixin.mejituu-monitor.desktop"
done
else
for username in $(ls /home)
do
echo "/home/${username}"
if [ -d "/home/${username}/.deepinwine/${BOTTLE_NAME}/drive_c/users/${username}/AppData/Roaming/Tencent/WeChat/XPlugin/Plugins/RadiumWMPF" ]
then
rm -rf "/home/${username}/.deepinwine/${BOTTLE_NAME}/drive_c/users/${username}/AppData/Roaming/Tencent/WeChat/XPlugin/Plugins/RadiumWMPF"
fi
rm -f "/home/${username}/.local/share/applications/com.qq.weixin.mejituu.desktop" "/home/${username}/.local/share/applications/com.qq.weixin.mejituu-fix.desktop" "/home/${username}/.local/share/applications/com.qq.weixin.mejituu-monitor.desktop"
done
fi
}
|