mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 11:47:46 +00:00
Launch Dalamud injector natively on Windows
This also prevents tools like winecfg or system info unnecessarily running in gamescope, if enabled.
This commit is contained in:
parent
b01f96005f
commit
34e3464411
2 changed files with 28 additions and 8 deletions
|
@ -203,8 +203,7 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au
|
||||||
|
|
||||||
auto list = dalamudProcess->processEnvironment().toStringList();
|
auto list = dalamudProcess->processEnvironment().toStringList();
|
||||||
|
|
||||||
// TODO: what if we aren't on wine?
|
launchExecutable(profile, dalamudProcess, {dataDir + "/Dalamud/" + "Dalamud.Injector.exe", output, argsEncoded});
|
||||||
dalamudProcess->start(profile.winePath, {dataDir + "/Dalamud/" + "Dalamud.Injector.exe", output, argsEncoded});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,19 +225,19 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au
|
||||||
gameClosed();
|
gameClosed();
|
||||||
});
|
});
|
||||||
|
|
||||||
launchExecutable(profile, gameProcess, arguments);
|
launchGameExecutable(profile, gameProcess, arguments);
|
||||||
|
|
||||||
successfulLaunch();
|
successfulLaunch();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherCore::launchExecutable(const ProfileSettings& profile, const QStringList args) {
|
void LauncherCore::launchExecutable(const ProfileSettings& profile, const QStringList args) {
|
||||||
auto process = new QProcess(this);
|
auto process = new QProcess(this);
|
||||||
|
process->setProcessEnvironment(QProcessEnvironment::systemEnvironment());
|
||||||
launchExecutable(profile, process, args);
|
launchExecutable(profile, process, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args) {
|
void LauncherCore::launchGameExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args) {
|
||||||
QList<QString> arguments;
|
QList<QString> arguments;
|
||||||
auto env = process->processEnvironment();
|
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
if(profile.useGamescope) {
|
if(profile.useGamescope) {
|
||||||
|
@ -262,7 +261,18 @@ void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* pr
|
||||||
|
|
||||||
if(profile.useGamemode)
|
if(profile.useGamemode)
|
||||||
arguments.push_back("gamemoderun");
|
arguments.push_back("gamemoderun");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
arguments.append(args);
|
||||||
|
|
||||||
|
launchExecutable(profile, process, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args) {
|
||||||
|
QList<QString> arguments;
|
||||||
|
auto env = process->processEnvironment();
|
||||||
|
|
||||||
|
#if defined(Q_OS_LINUX)
|
||||||
if(profile.useEsync) {
|
if(profile.useEsync) {
|
||||||
env.insert("WINEESYNC", QString::number(1));
|
env.insert("WINEESYNC", QString::number(1));
|
||||||
env.insert("WINEFSYNC", QString::number(1));
|
env.insert("WINEFSYNC", QString::number(1));
|
||||||
|
@ -273,9 +283,6 @@ void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* pr
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
|
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
|
||||||
env.insert("WINEPREFIX", profile.winePrefixPath);
|
env.insert("WINEPREFIX", profile.winePrefixPath);
|
||||||
|
|
||||||
if(profile.enableDXVKhud)
|
|
||||||
env.insert("DXVK_HUD", "full");
|
|
||||||
|
|
||||||
arguments.push_back(profile.winePath);
|
arguments.push_back(profile.winePath);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -287,6 +294,8 @@ void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* pr
|
||||||
process->setWorkingDirectory(profile.gamePath + "/game/");
|
process->setWorkingDirectory(profile.gamePath + "/game/");
|
||||||
process->setProcessEnvironment(env);
|
process->setProcessEnvironment(env);
|
||||||
|
|
||||||
|
qDebug() << "launching " << executable << " with args" << arguments;
|
||||||
|
|
||||||
process->start(executable, arguments);
|
process->start(executable, arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,19 @@ public:
|
||||||
int deleteProfile(QString name);
|
int deleteProfile(QString name);
|
||||||
|
|
||||||
void launchGame(const ProfileSettings& settings, LoginAuth auth);
|
void launchGame(const ProfileSettings& settings, LoginAuth auth);
|
||||||
|
|
||||||
void launchExecutable(const ProfileSettings& settings, QStringList args);
|
void launchExecutable(const ProfileSettings& settings, QStringList args);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Used for processes that should be wrapped in gamescope, etc.
|
||||||
|
*/
|
||||||
|
void launchGameExecutable(const ProfileSettings& settings, QProcess* process, QStringList args);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This just wraps it in wine if needed.
|
||||||
|
*/
|
||||||
void launchExecutable(const ProfileSettings& settings, QProcess* process, QStringList args);
|
void launchExecutable(const ProfileSettings& settings, QProcess* process, QStringList args);
|
||||||
|
|
||||||
void buildRequest(QNetworkRequest& request);
|
void buildRequest(QNetworkRequest& request);
|
||||||
void setSSL(QNetworkRequest& request);
|
void setSSL(QNetworkRequest& request);
|
||||||
QString readVersion(QString path);
|
QString readVersion(QString path);
|
||||||
|
|
Loading…
Add table
Reference in a new issue