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