diff --git a/src/gamecenter/gamecenterdaemon.cpp b/src/gamecenter/gamecenterdaemon.cpp index 3e5be3a..be1bb4a 100644 --- a/src/gamecenter/gamecenterdaemon.cpp +++ b/src/gamecenter/gamecenterdaemon.cpp @@ -1540,6 +1540,31 @@ QString GameCenterDaemon::launchMonitored(const QVariantMap &launchSpec, const Q auto *bootstrap = new QProcess(this); + { + QVariant rawEnv = launchSpec.value(QStringLiteral("envOverrides")); + if (rawEnv.canConvert()) { + rawEnv = rawEnv.value().variant(); + } + if (rawEnv.canConvert()) { + const QVariantMap bootstrapEnv = rawEnv.toMap(); + if (!bootstrapEnv.isEmpty()) { + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + for (auto it = bootstrapEnv.constBegin(); it != bootstrapEnv.constEnd(); ++it) { + const QString key = it.key(); + if (key.isEmpty() || key.contains(QLatin1Char('='))) { + continue; + } + QVariant value = it.value(); + if (value.canConvert()) { + value = value.value().variant(); + } + env.insert(key, value.toString()); + } + bootstrap->setProcessEnvironment(env); + } + } + } + connect(bootstrap, &QProcess::errorOccurred, this, [this, sessionId, gameId, provider, command](QProcess::ProcessError error) { if (error != QProcess::FailedToStart) { return;