deep-wine-runner/deb/DEBIAN/postinst

102 lines
5.3 KiB
Plaintext
Raw Normal View History

2022-08-11 21:54:20 +08:00
#!/bin/sh
2022-09-24 21:22:29 +08:00
# 使用系统默认的 sh 运行
#################################################################################################################
2023-04-24 21:52:51 +08:00
# 作者gfdgd xi
2022-12-18 13:04:24 +08:00
# 版本3.0.0
2022-10-02 22:08:12 +08:00
# 更新时间2022年10月02日
2022-09-24 21:22:29 +08:00
# 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序
# 基于 sh
#################################################################################################################
2022-11-06 12:49:34 +08:00
# 非强制性的必应组件,所以成功不成功都行
2023-04-15 18:39:30 +08:00
# 程序版本号
2023-09-30 13:04:32 +08:00
version=3.4.1
2022-11-06 12:49:34 +08:00
echo 安装组件
2024-02-02 12:41:31 +08:00
#python3 -m pip install --upgrade pyqt5 --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
2024-02-02 11:49:30 +08:00
#python3 -m pip install --upgrade PyQtWebEngine --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
2023-08-08 21:07:16 +08:00
python3 -m pip install --upgrade pynput --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple --break-system-packages > /dev/null 2>&1 | true
python3 -m pip install --upgrade xpinyin --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple --break-system-packages > /dev/null 2>&1 | true
# 用于解决老版本 pip 没 --break-system-packages 参数的问题
python3 -m pip install --upgrade pynput --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
python3 -m pip install --upgrade xpinyin --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
2024-01-31 20:54:58 +08:00
# 修改 box86/64 国内源错误数据
if [[ -f /etc/apt/sources.list.d/box64.list ]]; then
sed -i 's/http:\/\/seafile.jyx2048.com:2345/http:\/\/gfdgdxi.v5.idcfengye.com/g' /etc/apt/sources.list.d/box64.list
fi
if [[ -f /etc/apt/sources.list.d/box86.list ]]; then
sed -i 's/http:\/\/seafile.jyx2048.com:2345/http:\/\/gfdgdxi.v5.idcfengye.com/g' /etc/apt/sources.list.d/box86.list
fi
2022-11-06 12:49:34 +08:00
echo 执行完成
2022-11-22 22:40:24 +08:00
echo 移除旧组件
if [ -d /opt/apps/deepin-wine-runner/arm-package ]; then
rm -rf /opt/apps/deepin-wine-runner/arm-package
fi
if [ -d /opt/apps/deepin-wine-runner/dlls-arm ]; then
rm -rf /opt/apps/deepin-wine-runner/dlls-arm
fi
if [ -d /opt/apps/deepin-wine-runner/exa ]; then
rm -rf /opt/apps/deepin-wine-runner/exa
fi
if [ -d /opt/apps/deepin-wine-runner/dxvk ]; then
rm -rf /opt/apps/deepin-wine-runner/dxvk
fi
echo 移除完成
2022-08-11 21:54:20 +08:00
# 如果为非 X86 PC可以删除掉一些无用组件主要是用不了
2024-01-31 22:20:43 +08:00
if [[ `arch` != "x86_64" ]]; then
2022-08-11 21:54:20 +08:00
echo 非X86架构删除对非X86架构无用的组件
# 删除虚拟机功能
2023-04-15 18:39:30 +08:00
#rm -rf /opt/apps/deepin-wine-runner/StartVM.sh
#rm -rf /opt/apps/deepin-wine-runner/RunVM.sh
#rm -rf /opt/apps/deepin-wine-runner/VM
#rm -rf /usr/share/applications/spark-deepin-wine-runner-control-vm.desktop
#rm -rf /usr/share/applications/spark-deepin-wine-runner-start-vm.desktop
2022-08-11 21:54:20 +08:00
# 删除安装 wine 功能
rm -rf "/opt/apps/deepin-wine-runner/wine install"
2022-09-13 21:27:17 +08:00
# 这个注释掉的理论可用,不移除
#rm -rf "/opt/apps/deepin-wine-runner/wine"
2022-08-11 21:54:20 +08:00
rm -rf /usr/bin/deepin-wine-runner-wine-installer
rm -rf /usr/bin/deepin-wine-runner-wine-install-deepin23
rm -rf /usr/bin/deepin-wine-runner-wine-install
rm -rf /usr/bin/deepin-wine-runner-winehq-install
rm -rf /opt/apps/deepin-wine-runner/InstallWineOnDeepin23.py
rm -rf /opt/apps/deepin-wine-runner/sparkstore.list
rm -rf /opt/apps/deepin-wine-runner/AllInstall.py
rm -rf /opt/apps/deepin-wine-runner/InstallNewWineHQ.sh
fi
2023-04-15 18:39:30 +08:00
# 处理 VM 工具
vmPath=/opt/apps/deepin-wine-runner/VM/VirtualMachine-`dpkg --print-architecture`
echo 当前架构为:`dpkg --print-architecture`
2023-04-15 18:39:30 +08:00
if [ -f $vmPath ]; then
echo 虚拟机工具有该架构的预编译文件
# 移除辅助文件
rm -f /opt/apps/deepin-wine-runner/VM/VirtualMachine
# 移动
mv $vmPath /opt/apps/deepin-wine-runner/VM/VirtualMachine
rm -f /opt/apps/deepin-wine-runner/VM/VirtualMachine-*
else
echo 虚拟机工具无该架构的预编译文件
rm -f /opt/apps/deepin-wine-runner/VM/VirtualMachine-*
fi
echo 处理完成!
2023-08-11 11:22:06 +08:00
# 修复 3.3.0.1 Box86 源挂了的问题
if [ -f /etc/apt/sources.list.d/box86.list ]; then
bash -c "echo deb http://seafile.jyx2048.com:2345/spark-deepin-wine-runner/data/box86-debs/debian ./ > /etc/apt/sources.list.d/box86.list"
fi
# Gitlink 源挂了
2022-11-13 10:58:36 +08:00
# 到时候切换 gpg 源会方便很多
#if [ -r /etc/apt/sources.list.d/better-dde.list ]; then
# if [ -d /usr/share/deepin-installer ]; then
# # 用于修复 Deepin Community Live CD Install 版签名过期的问题
# wget -P /tmp/gfdgd-xi-sources https://code.gitlink.org.cn/gfdgd_xi/gfdgd-xi-apt-mirrors/raw/branch/master/gpg.asc
# rm -rfv /etc/apt/trusted.gpg.d/gfdgdxi-list.gpg | true
# cp -v /tmp/gfdgd-xi-sources/gpg.asc.gpg /etc/apt/trusted.gpg.d/gfdgdxi-list.gpg
# # 用于修复 2022.11.25 Better DDE 导致的 Deepin Community Live CD Install 版问题
# # 移除 Better DDE 源
# rm -rfv /etc/apt/sources.list.d/better-dde.list
# apt update > /dev/null 2>&1 | true
# fi
#fi
2022-08-11 21:54:20 +08:00
# 设置目录权限,让用户可读可写,方便后续删除组件
2024-01-31 22:52:00 +08:00
chmod 777 -R /opt/apps/deepin-wine-runner > /dev/null 2>&1 | true
2022-07-01 15:16:00 +08:00
# 向服务器返回安装数加1不显示内容且忽略错误
2023-04-15 18:39:30 +08:00
python3 /opt/apps/deepin-wine-runner/Download.py $version > /dev/null 2>&1 | true