mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Set file permissions when downloading installer on Linux
This commit is contained in:
@@ -295,7 +295,7 @@ namespace BlackGui
|
|||||||
for (const CRemoteFile &rf : executables)
|
for (const CRemoteFile &rf : executables)
|
||||||
{
|
{
|
||||||
const QString executable = CFileUtils::appendFilePaths(dir.absolutePath(), rf.getBaseName());
|
const QString executable = CFileUtils::appendFilePaths(dir.absolutePath(), rf.getBaseName());
|
||||||
const QFile executableFile(executable);
|
QFile executableFile(executable);
|
||||||
if (!executableFile.exists()) { continue; }
|
if (!executableFile.exists()) { continue; }
|
||||||
|
|
||||||
QMessageBox::StandardButton reply = QMessageBox::question(this, "Start?", msg.arg(rf.getName()), QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::StandardButton reply = QMessageBox::question(this, "Start?", msg.arg(rf.getName()), QMessageBox::Yes | QMessageBox::No);
|
||||||
@@ -310,6 +310,12 @@ namespace BlackGui
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CBuildConfig::isRunningOnLinuxPlatform() && !executableFile.permissions().testFlag(QFile::ExeOwner))
|
||||||
|
{
|
||||||
|
executableFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner
|
||||||
|
| QFile::ReadGroup | QFile::ExeGroup | QFile::ReadOther | QFile::ExeOther);
|
||||||
|
}
|
||||||
|
|
||||||
const bool shutdown = ui->cb_Shutdown->isChecked();
|
const bool shutdown = ui->cb_Shutdown->isChecked();
|
||||||
const bool started = QProcess::startDetached(executable, {}, dir.absolutePath());
|
const bool started = QProcess::startDetached(executable, {}, dir.absolutePath());
|
||||||
if (started && shutdown && sGui)
|
if (started && shutdown && sGui)
|
||||||
|
|||||||
Reference in New Issue
Block a user