Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dbus/launcher1compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void Launcher1Compat::uninstallPackageByScript(const QString & pkgDisplayName, c
// call `/usr/libexec/dde-appwiz-uninstaller.sh <packageDesktopFilePath>` and check the return code.
qDebug() << "Calling dde-appwiz-uninstaller.sh to uninstall" << pkgDisplayName << packageDesktopFilePath << "via script";
QProcess process;
process.start("/usr/libexec/dde-appwiz-uninstaller.sh", QStringList{packageDesktopFilePath});
process.start("pkexec", QStringList{"/usr/libexec/dde-appwiz-uninstaller.sh", packageDesktopFilePath});
process.waitForFinished();

QString standardOutput = process.readAllStandardOutput();
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
dde-application-wizard (0.1.14) unstable; urgency=medium

* chore: change polkit rule from packagekit to appwiz's script
(PMS: BUG-303279)

-- Wang Zichong <wangzichong@deepin.org> Thu, 15 Mar 2025 20:00:00 +0800

dde-application-wizard (0.1.13) unstable; urgency=medium

* fix: Uninstalling compatibility mode application failed
Expand Down
2 changes: 1 addition & 1 deletion polkit-1/rules.d/org.deepin.dde.application-wizard.rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.packagekit.package-remove") &&
if ((action.id == "org.deepin.dde.appwiz.uninstall") &&
subject.active == true && subject.local == true &&
subject.isInGroup("sudo")) {
return polkit.Result.YES;
Expand Down
9 changes: 8 additions & 1 deletion scripts/dde-appwiz-uninstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ if [ -z "$PACKAGE_NAME" ]; then
exit 1
fi

# Check if the user is root, if not, use pkexec
if [ "$EUID" -eq 0 ]; then
apt_command="apt purge -y"
else
apt_command="pkexec apt purge -y"
fi

# Use pkexec to uninstall the package
if pkexec apt purge -y "$PACKAGE_NAME"; then
if $apt_command "$PACKAGE_NAME"; then
echo "Package '$PACKAGE_NAME' has been successfully uninstalled."
else
echo "Error: Failed to uninstall the package '$PACKAGE_NAME'."
Expand Down