unsintaller support

This commit is contained in:
shenmo 2025-03-13 13:27:41 +08:00
parent 832b53dfc9
commit b114db583b
2 changed files with 15 additions and 1 deletions
src/pages
tool/store-helper

@ -562,7 +562,7 @@ void AppIntoPage::on_pushButton_3_clicked()
ui->pushButton_3->setEnabled(false);
QProcess uninstall;
uninstall.start("pkexec", QStringList() << "apt" << "autopurge" << "-y" << info["Pkgname"].toString().toLower());
uninstall.start("pkexec", QStringList() << "/opt/durapps/spark-store/bin/store-helper/uninstaller" << info["Pkgname"].toString().toLower());
uninstall.waitForFinished(-1);
uninstall.close();

14
tool/store-helper/uninstaller Executable file

@ -0,0 +1,14 @@
#!/bin/bash
dpkg -l | grep "^ii $1 " > /dev/null
RET="$?"
if [[ "$RET" == "0" ]] ;then
apt autopurge $1 -y
else
if command -v bookworm-run > /dev/null;then
echo "Try ACE Bookworm"
bookworm-run apt autopurge $1 -y
fi
fi
exit "$RET"