From 04dbf51d489f0da4caa7e6d2464734ea81bd2371 Mon Sep 17 00:00:00 2001 From: shenmo Date: Sat, 14 Jun 2025 08:20:10 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E5=BC=B9?= =?UTF-8?q?=E5=87=BAACE=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, 4 insertions(+), 6 deletions(-) diff --git a/src/widgets/common/downloaditem.cpp b/src/widgets/common/downloaditem.cpp index e4aad7a..160edd8 100644 --- a/src/widgets/common/downloaditem.cpp +++ b/src/widgets/common/downloaditem.cpp @@ -177,13 +177,12 @@ void DownloadItem::slotAsyncInstall(int t) case 0: { QStringList args; - args << "/usr/local/bin/ssinstall" - << "/tmp/spark-store/" + ui->label_filename->text().toUtf8(); + args << "/tmp/spark-store/" + ui->label_filename->text().toUtf8(); if (!installExtraArg.isEmpty()) { args << installExtraArg; } args << "--delete-after-install"; - installer.start("pkexec", args); + installer.start("/usr/local/bin/ssinstall", args); } break; case 1: diff --git a/tool/ssinstall b/tool/ssinstall index dee4ff2..e06c1a6 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -128,9 +128,8 @@ function parse_args() { # 验证当前用户 function validate_user() { if [ "$(id -u)" != "0" ]; then - echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}" - echo "OMG-IT-GOES-WRONG" - exit 1 + pkexec DISPLAY=$DISPLAY "$0" "$@" + exit $? fi }