diff --git a/include/launchercore.h b/include/launchercore.h index 8555402..f986a2e 100755 --- a/include/launchercore.h +++ b/include/launchercore.h @@ -137,13 +137,15 @@ public: /* * This just wraps it in wine if needed. */ - void launchExecutable(const ProfileSettings& settings, QProcess* process, QStringList args, bool isGame); + void launchExecutable(const ProfileSettings& settings, QProcess* process, QStringList args, bool isGame, bool needsRegistrySetup); /* * Launches an external tool. Gamescope for example is intentionally excluded. */ void launchExternalTool(const ProfileSettings& settings, QStringList args); + void addRegistryKey(const ProfileSettings& settings, QString key, QString value, QString data); + void buildRequest(const ProfileSettings& settings, QNetworkRequest& request); void setSSL(QNetworkRequest& request); QString readVersion(QString path); diff --git a/src/launchercore.cpp b/src/launchercore.cpp index 1463a43..45f600b 100755 --- a/src/launchercore.cpp +++ b/src/launchercore.cpp @@ -170,7 +170,7 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au auto list = dalamudProcess->processEnvironment().toStringList(); - launchExecutable(profile, dalamudProcess, {dataDir + "/Dalamud/" + "Dalamud.Injector.exe", QString::number(exitCode), argsEncoded}, false); + launchExecutable(profile, dalamudProcess, {dataDir + "/Dalamud/" + "Dalamud.Injector.exe", QString::number(exitCode), argsEncoded}, false, true); connection->close(); socket->close(); @@ -189,13 +189,13 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au void LauncherCore::launchExecutable(const ProfileSettings& profile, const QStringList args) { auto process = new QProcess(this); process->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); - launchExecutable(profile, process, args, true); + launchExecutable(profile, process, args, true, true); } void LauncherCore::launchExternalTool(const ProfileSettings& profile, const QStringList args) { auto process = new QProcess(this); process->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); - launchExecutable(profile, process, args, false); + launchExecutable(profile, process, args, false, true); } void LauncherCore::launchGameExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args) { @@ -203,13 +203,25 @@ void LauncherCore::launchGameExecutable(const ProfileSettings& profile, QProcess arguments.append(args); - launchExecutable(profile, process, arguments, true); + launchExecutable(profile, process, arguments, true, true); } -void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args, bool isGame) { +void LauncherCore::launchExecutable(const ProfileSettings& profile, QProcess* process, const QStringList args, bool isGame, bool needsRegistrySetup) { QList arguments; auto env = process->processEnvironment(); + if(needsRegistrySetup) { +#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) + if(profile.license == GameLicense::macOS) { + addRegistryKey(profile, "HKEY_CURRENT_USER\\Software\\Wine", "HideWineExports", "0"); + } else { + addRegistryKey(profile, "HKEY_CURRENT_USER\\Software\\Wine", "HideWineExports", "1"); + } +#endif + } + + process->setProcessChannelMode(QProcess::ForwardedChannels); + #if defined(Q_OS_LINUX) if (isGame) { if (profile.useGamescope) { @@ -674,3 +686,10 @@ QString LauncherCore::getDefaultGamePath() { return QDir::homePath() + "/.wine/drive_c/Program Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn"; #endif } + +void LauncherCore::addRegistryKey(const ProfileSettings& settings, + QString key, QString value, QString data) { + auto process = new QProcess(this); + process->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); + launchExecutable(settings, process, {"reg", "add", key, "/v", value, "/d", data, "/f" }, false, false); +} diff --git a/src/launcherwindow.cpp b/src/launcherwindow.cpp index 2aebd88..944f825 100644 --- a/src/launcherwindow.cpp +++ b/src/launcherwindow.cpp @@ -111,7 +111,7 @@ LauncherWindow::LauncherWindow(LauncherCore& core, QWidget* parent) : QMainWindo wineCfg->setMenuRole(QAction::MenuRole::NoRole); wineCfg->setIcon(QIcon::fromTheme("configure")); connect(wineCfg, &QAction::triggered, [=] { - this->core.launchExternalTool(currentProfile(), {"winecfg.exe"}); + this->core.launchExternalTool(currentProfile(), {"regedit.exe"}); }); #endif