diff --git a/launcher/include/profilemanager.h b/launcher/include/profilemanager.h
index 787a167..2ec9bb1 100644
--- a/launcher/include/profilemanager.h
+++ b/launcher/include/profilemanager.h
@@ -41,6 +41,7 @@ public:
Q_INVOKABLE bool canDelete(Profile *account) const;
static QString getDefaultGamePath(const QString &uuid);
+ static QString getDefaultWinePrefixPath(const QString &uuid);
private:
void insertProfile(Profile *profile);
diff --git a/launcher/profileconfig.kcfg b/launcher/profileconfig.kcfg
index a16b9e9..d76ab32 100644
--- a/launcher/profileconfig.kcfg
+++ b/launcher/profileconfig.kcfg
@@ -22,6 +22,7 @@ SPDX-License-Identifier: CC0-1.0
+ ProfileManager::getDefaultWinePrefixPath(mParamuuid)
diff --git a/launcher/src/launchercore.cpp b/launcher/src/launchercore.cpp
index 31b50c6..048529e 100755
--- a/launcher/src/launchercore.cpp
+++ b/launcher/src/launchercore.cpp
@@ -218,6 +218,10 @@ QString LauncherCore::getGameArgs(const Profile &profile, const LoginAuth &auth)
QDir().mkpath(profile.account()->getConfigDir().absolutePath());
}
+ if (!QDir().exists(profile.winePrefixPath())) {
+ QDir().mkpath(profile.winePrefixPath());
+ }
+
if (!auth.lobbyhost.isEmpty()) {
gameArgs.push_back({QStringLiteral("DEV.GMServerHost"), auth.frontierHost});
for (int i = 1; i < 9; i++) {
diff --git a/launcher/src/profilemanager.cpp b/launcher/src/profilemanager.cpp
index ea43bc4..91b5f0f 100644
--- a/launcher/src/profilemanager.cpp
+++ b/launcher/src/profilemanager.cpp
@@ -97,6 +97,13 @@ QString ProfileManager::getDefaultGamePath(const QString &uuid)
#endif
}
+QString ProfileManager::getDefaultWinePrefixPath(const QString &uuid)
+{
+ const QDir appData = QStandardPaths::standardLocations(QStandardPaths::StandardLocation::AppDataLocation)[0];
+ const QDir prefixDir = appData.absoluteFilePath(QStringLiteral("prefix"));
+ return prefixDir.absoluteFilePath(uuid);
+}
+
void ProfileManager::load()
{
auto config = KSharedConfig::openStateConfig();