mirror of
https://gitee.com/amber-ce/amber-ce-bookworm.git
synced 2025-12-14 11:02:05 +08:00
uninstaller
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
Package: cn.flamescion.bookworm-compatibility-mode
|
Package: cn.flamescion.bookworm-compatibility-mode
|
||||||
Version: 12.3.3
|
Version: 12.3.4
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: bubblewrap,flatpak
|
Depends: bubblewrap,flatpak,zenity
|
||||||
Maintainer: shenmo <shenmo@spark-app.store>
|
Maintainer: shenmo <shenmo@spark-app.store>
|
||||||
Architecture: arm64
|
Architecture: arm64
|
||||||
Description: bwrap wrapper for install and running debs inside a bookworm container
|
Description: bwrap wrapper for install and running debs inside a bookworm container
|
||||||
|
|||||||
@@ -4,4 +4,5 @@ export PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
|
|||||||
if [ "$PACKAGE_NAME" = "cn.flamescion.bookworm-compatibility-mode" ];then
|
if [ "$PACKAGE_NAME" = "cn.flamescion.bookworm-compatibility-mode" ];then
|
||||||
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run /usr/bin/bookworm-run
|
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run /usr/bin/bookworm-run
|
||||||
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper /usr/bin/ace-uninstall-helper
|
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper /usr/bin/ace-uninstall-helper
|
||||||
|
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui /usr/bin/ace-uninstall-helper-gui
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
|||||||
if [ "$PACKAGE_NAME" = "cn.flamescion.bookworm-compatibility-mode" ];then
|
if [ "$PACKAGE_NAME" = "cn.flamescion.bookworm-compatibility-mode" ];then
|
||||||
unlink /usr/bin/bookworm-run
|
unlink /usr/bin/bookworm-run
|
||||||
unlink /usr/bin/ace-uninstall-helper
|
unlink /usr/bin/ace-uninstall-helper
|
||||||
|
unlink /usr/bin/ace-uninstall-helper-gui
|
||||||
fi
|
fi
|
||||||
echo "清理卸载残留"
|
echo "清理卸载残留"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
|
Name=ACE Software Uninstaller
|
||||||
|
Name[zh_CN]=ACE软件卸载器
|
||||||
|
Comment=用于卸载ACE容器的应用
|
||||||
|
Type=Application
|
||||||
|
Exec=/home/shenmo-ikun/Desktop/bookworm-compatibility-mode/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui
|
||||||
|
Icon=ACE-uninstaller
|
||||||
|
Categories=AudioVideo
|
||||||
|
|
||||||
|
# Generated from the DesktopGenerater component of the z-Tools toolkit
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Categories=utils
|
Categories=utils
|
||||||
Exec=/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run %U
|
Exec=bookworm-run %U
|
||||||
Icon=cn.flamescion.bookworm-compatibility-mode
|
Icon=cn.flamescion.bookworm-compatibility-mode
|
||||||
Name=Bookworm CM
|
Name=Amber CE
|
||||||
Name[zh_CN]=书虫兼容模式
|
Name[zh_CN]=ACE兼容环境
|
||||||
|
Keywords=BCM,ACE,ace,mode
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
Type=Application
|
Type=Application
|
||||||
Terminal=true
|
Terminal=true
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 118 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 118 KiB |
@@ -1,7 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$UID" != "0" ];then
|
||||||
|
echo "Need to be run as root."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
# 清除先前的变量值
|
# 清除先前的变量值
|
||||||
unset ABSOLUTE_PATH IN_CONTAINER_PATH PKGNAME_GUESS DPKG_LIST_FILE ACE_ENV_PATH
|
unset ABSOLUTE_PATH IN_CONTAINER_PATH PKGNAME_GUESS DPKG_LIST_FILE ACE_ENV_PATH
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ "$UID" != "0" ];then
|
||||||
|
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $0
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
# 定义应用列表文件路径
|
||||||
|
ACE_dir="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env"
|
||||||
|
|
||||||
|
# 读取所有.desktop文件,并构造应用列表
|
||||||
|
app_list=()
|
||||||
|
for file in "$ACE_dir"/usr/share/applications/*.desktop; do
|
||||||
|
if [ ! -e "$file" ];then ##可能是软链接,对主机来说无用
|
||||||
|
file=$ACE_dir$(readlink $file)
|
||||||
|
fi
|
||||||
|
# 读取应用名称和简介
|
||||||
|
name_orig=$(grep -m 1 '^Name=' "$file" | cut -d '=' -f 2)
|
||||||
|
name_i18n=$(grep -m 1 "^Name\[${LANGUAGE}\]\=" "$file" | cut -d '=' -f 2)
|
||||||
|
if [ -z "$name_i18n" ] ;then
|
||||||
|
name=$name_orig
|
||||||
|
else
|
||||||
|
name=$name_i18n
|
||||||
|
fi
|
||||||
|
comment=$(grep -m 1 '^Comment=' "$file" | cut -d '=' -f 2)
|
||||||
|
# 如果没有简介,则显示"N/A"
|
||||||
|
[[ -z "$comment" ]] && comment="N/A"
|
||||||
|
# 添加到应用列表数组
|
||||||
|
app_list+=("false" "$name" "$comment" "$file")
|
||||||
|
done
|
||||||
|
|
||||||
|
# 使用 Zenity 显示应用列表,并获取用户选择
|
||||||
|
selected_apps=$(zenity --list --title "应用列表" --column "是否卸载" --column "应用名称" --column "应用介绍" --column "desktop文件位置" --checklist "${app_list[@]}" --print-column=4 --hide-column=4 --separator=" " --width=800 --height=400)
|
||||||
|
|
||||||
|
|
||||||
|
# 检查用户是否做出了选择
|
||||||
|
if [ -n "$selected_apps" ]; then
|
||||||
|
# 卸载选中的应用
|
||||||
|
for app_desktop_path in $selected_apps; do
|
||||||
|
ace-uninstall-helper "$app_desktop_path"
|
||||||
|
ret=$?
|
||||||
|
if [ "$ret" != "0" ];then
|
||||||
|
zenity --error --width 768 --text "$app_desktop_path 卸载失败,中止操作\n请手动执行\nsudo ace-uninstall-helper $app_desktop_path \n查看报错!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
zenity --info --text "选定应用已卸载"
|
||||||
|
else
|
||||||
|
zenity --info --text "未选择任何应用"
|
||||||
|
fi
|
||||||
|
|
||||||
Reference in New Issue
Block a user