From 7a4fbabcda54297a51d4ceb61d785b759f6bb736 Mon Sep 17 00:00:00 2001 From: shenmo Date: Sat, 14 Jun 2025 08:36:16 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!344=20:?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E5=BC=B9=E5=87=BAACE?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/common/downloaditem.cpp | 5 +++-- tool/ssinstall | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/widgets/common/downloaditem.cpp b/src/widgets/common/downloaditem.cpp index 7f1e3ae..45cdc54 100644 --- a/src/widgets/common/downloaditem.cpp +++ b/src/widgets/common/downloaditem.cpp @@ -177,12 +177,13 @@ void DownloadItem::slotAsyncInstall(int t) case 0: { QStringList args; - args << "/tmp/spark-store/" + ui->label_filename->text().toUtf8(); + args << "/usr/local/bin/ssinstall" + << "/tmp/spark-store/" + ui->label_filename->text().toUtf8(); if (!installExtraArg.isEmpty()) { args << installExtraArg; } args << "--delete-after-install"; - installer.start("/usr/local/bin/ssinstall", args); + installer.start("pkexec", args); } break; case 1: diff --git a/tool/ssinstall b/tool/ssinstall index e06c1a6..dee4ff2 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -128,8 +128,9 @@ function parse_args() { # 验证当前用户 function validate_user() { if [ "$(id -u)" != "0" ]; then - pkexec DISPLAY=$DISPLAY "$0" "$@" - exit $? + echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}" + echo "OMG-IT-GOES-WRONG" + exit 1 fi }