mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-29 23:25:59 +00:00
Fixed: Try to put executable permissions before to launch an executable under UNIX
This commit is contained in:
parent
017ce70a94
commit
bd829e72c6
4 changed files with 26 additions and 0 deletions
|
@ -172,6 +172,11 @@ void CClientConfigDialog::onClickPlay()
|
||||||
clientFullPath += "ryzom_client";
|
clientFullPath += "ryzom_client";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN32
|
||||||
|
// fix executable permissions under UNIX
|
||||||
|
QFile::setPermissions(clientFullPath, QFile::permissions(clientFullPath) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther);
|
||||||
|
#endif
|
||||||
|
|
||||||
started = QProcess::startDetached(clientFullPath, arguments);
|
started = QProcess::startDetached(clientFullPath, arguments);
|
||||||
|
|
||||||
onClickOK();
|
onClickOK();
|
||||||
|
|
|
@ -271,6 +271,11 @@ int main(int argc, char *argv[])
|
||||||
if (restartInstaller)
|
if (restartInstaller)
|
||||||
{
|
{
|
||||||
#ifndef _DEBUG
|
#ifndef _DEBUG
|
||||||
|
#ifndef Q_OS_WIN32
|
||||||
|
// fix executable permissions under UNIX
|
||||||
|
QFile::setPermissions(config.getInstallerInstalledFilePath(), QFile::permissions(config.getInstallerInstalledFilePath()) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (QProcess::startDetached(config.getInstallerInstalledFilePath())) return 0;
|
if (QProcess::startDetached(config.getInstallerInstalledFilePath())) return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,10 @@ void CMainWindow::onPlayClicked()
|
||||||
arguments << profile.id;
|
arguments << profile.id;
|
||||||
arguments << profile.arguments.split(' ');
|
arguments << profile.arguments.split(' ');
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN32
|
||||||
|
QFile::setPermissions(executable, QFile::permissions(executable) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther);
|
||||||
|
#endif
|
||||||
|
|
||||||
// launch the game with all arguments and from server root directory (to use right data)
|
// launch the game with all arguments and from server root directory (to use right data)
|
||||||
bool started = QProcess::startDetached(executable, arguments, server.getDirectory());
|
bool started = QProcess::startDetached(executable, arguments, server.getDirectory());
|
||||||
|
|
||||||
|
@ -164,6 +168,10 @@ void CMainWindow::onConfigureClicked()
|
||||||
arguments << "-p";
|
arguments << "-p";
|
||||||
arguments << profile.id;
|
arguments << profile.id;
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN32
|
||||||
|
QFile::setPermissions(executable, QFile::permissions(executable) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool started = QProcess::startDetached(executable, arguments);
|
bool started = QProcess::startDetached(executable, arguments);
|
||||||
|
|
||||||
CConfigFile::getInstance()->setDefaultProfileIndex(profileIndex);
|
CConfigFile::getInstance()->setDefaultProfileIndex(profileIndex);
|
||||||
|
|
|
@ -408,6 +408,14 @@ QString appendShortcutExtension(const QString &shortcut)
|
||||||
|
|
||||||
QString getVersionFromExecutable(const QString &path)
|
QString getVersionFromExecutable(const QString &path)
|
||||||
{
|
{
|
||||||
|
// check if file exists
|
||||||
|
if (!QFile::exists(path)) return "";
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN32
|
||||||
|
// fix executable permissions under UNIX
|
||||||
|
QFile::setPermissions(path, QFile::permissions(path) | QFile::ExeGroup | QFile::ExeUser | QFile::ExeOther);
|
||||||
|
#endif
|
||||||
|
|
||||||
// launch executable with --version argument
|
// launch executable with --version argument
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.setProcessChannelMode(QProcess::MergedChannels);
|
process.setProcessChannelMode(QProcess::MergedChannels);
|
||||||
|
|
Loading…
Reference in a new issue