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 }