Skip to content

Commit

Permalink
Don't install compatibility tool on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
redstrate committed May 18, 2024
1 parent 474bd19 commit f5f1434
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
3 changes: 2 additions & 1 deletion launcher/include/launchercore.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ class LauncherCore : public QObject
[[nodiscard]] bool isLoadingFinished() const;
[[nodiscard]] bool isSteam() const;
[[nodiscard]] bool isSteamDeck() const;
[[nodiscard]] bool isWindows() const;
[[nodiscard]] static bool isWindows();
[[nodiscard]] static bool needsCompatibilityTool();
[[nodiscard]] Q_INVOKABLE bool isPatching() const;

[[nodiscard]] QNetworkAccessManager *mgr();
Expand Down
25 changes: 14 additions & 11 deletions launcher/src/assetupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,23 @@ QCoro::Task<bool> AssetUpdater::update()
qInfo(ASTRA_LOG) << "Checking for compatibility tool updates...";

m_dataDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
const QDir compatibilityToolDir = m_dataDir.absoluteFilePath(QStringLiteral("tool"));
m_wineDir = compatibilityToolDir.absoluteFilePath(QStringLiteral("wine"));
m_dxvkDir = compatibilityToolDir.absoluteFilePath(QStringLiteral("dxvk"));

Utility::createPathIfNeeded(m_wineDir);
Utility::createPathIfNeeded(m_dxvkDir);
if (LauncherCore::needsCompatibilityTool()) {
const QDir compatibilityToolDir = m_dataDir.absoluteFilePath(QStringLiteral("tool"));
m_wineDir = compatibilityToolDir.absoluteFilePath(QStringLiteral("wine"));
m_dxvkDir = compatibilityToolDir.absoluteFilePath(QStringLiteral("dxvk"));

if (m_profile.wineType() == Profile::WineType::BuiltIn && !co_await checkRemoteCompatibilityToolVersion()) {
co_return false;
}
Utility::createPathIfNeeded(m_wineDir);
Utility::createPathIfNeeded(m_dxvkDir);

// TODO: should DXVK be tied to this setting...?
if (m_profile.wineType() == Profile::WineType::BuiltIn && !co_await checkRemoteDxvkVersion()) {
co_return false;
if (m_profile.wineType() == Profile::WineType::BuiltIn && !co_await checkRemoteCompatibilityToolVersion()) {
co_return false;
}

// TODO: should DXVK be tied to this setting...?
if (m_profile.wineType() == Profile::WineType::BuiltIn && !co_await checkRemoteDxvkVersion()) {
co_return false;
}
}

if (!m_profile.dalamudEnabled()) {
Expand Down
7 changes: 6 additions & 1 deletion launcher/src/launchercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ bool LauncherCore::isSteamDeck() const
}
}

bool LauncherCore::isWindows() const
bool LauncherCore::isWindows()
{
#if defined(Q_OS_WIN)
return true;
Expand All @@ -311,6 +311,11 @@ bool LauncherCore::isWindows() const
#endif
}

bool LauncherCore::needsCompatibilityTool()
{
return !isWindows();
}

bool LauncherCore::isPatching() const
{
return m_isPatching;
Expand Down

0 comments on commit f5f1434

Please sign in to comment.