mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 12:52:04 +08:00
chore:调用更新时分开开发者和普通用户的调用方式
This commit is contained in:
@@ -526,18 +526,28 @@ void MainWindow::notify(QObject *receiver, QEvent *event)
|
||||
void MainWindow::on_pushButton_14_clicked()
|
||||
{
|
||||
QString appPath;
|
||||
appPath = QCoreApplication::applicationDirPath() ;
|
||||
QDir dir(appPath);
|
||||
dir.cdUp();
|
||||
appPath = dir.absolutePath()+"/spark-update-tool/spark-update-tool";
|
||||
qDebug() << "Spark Update Tool Path: " << appPath;
|
||||
if(appPath.isEmpty())
|
||||
{
|
||||
qWarning() << "Spark Update Tool not found!";
|
||||
return;
|
||||
}
|
||||
QProcess *process = new QProcess(this);
|
||||
QStringList arguments;
|
||||
arguments << appPath <<"--silent";
|
||||
process->start(appPath, {"--silent"});
|
||||
#ifdef QT_DEBUG
|
||||
appPath = QCoreApplication::applicationDirPath() ;
|
||||
QDir dir(appPath);
|
||||
dir.cdUp();
|
||||
appPath = dir.absolutePath()+"/spark-update-tool/spark-update-tool";
|
||||
qDebug() << "Spark Update Tool Path: " << appPath;
|
||||
if(appPath.isEmpty())
|
||||
{
|
||||
qWarning() << "Spark Update Tool not found!";
|
||||
return;
|
||||
}
|
||||
QProcess *process = new QProcess(this);
|
||||
QStringList arguments;
|
||||
arguments << appPath <<"--silent";
|
||||
process->start(appPath, {"--silent"});
|
||||
#else
|
||||
appPath = QStandardPaths::findExecutable("spark-update-tool");
|
||||
QString program = "pkexec";
|
||||
QStringList arguments;
|
||||
arguments << appPath << "--silent";
|
||||
process->start(program, arguments);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user