Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Windows & CI fixes #2

Merged
merged 9 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ jobs:
- name: Save Prefix
id: cache-prefix-save
uses: actions/cache/save@v4
if: steps.cache-prefix-restore.outputs.cache-hit != 'true'
with:
path: ${{ steps.strings.outputs.prefix-dir }}
key: ${{ steps.cache-prefix-restore.outputs.cache-primary-key }}
Expand Down Expand Up @@ -250,12 +251,13 @@ jobs:
Copy-Item -Path ${{ steps.strings.outputs.prefix-dir }}/bin/KirigamiDelegates.dll -Destination ${{ steps.strings.outputs.build-output-dir }}/bin/bin
Copy-Item -Path ${{ steps.strings.outputs.prefix-dir }}/bin/KirigamiPlatform.dll -Destination ${{ steps.strings.outputs.build-output-dir }}/bin/bin

Copy-Item -Path ${{ steps.strings.outputs.prefix-dir }}/lib/qml/* -Destination ${{ steps.strings.outputs.build-output-dir }}/qml/ -Recurse
Copy-Item -Force -Recurse -Path ${{ steps.strings.outputs.prefix-dir }}\lib\qml\* -Destination ${{ steps.strings.outputs.build-output-dir }}/bin/qml/

- name: Remove extra files
if: runner.os == 'Windows'
run: |
Remove-Item -Path ${{ steps.strings.outputs.build-output-dir }}/bin/bin/opengl32sw.dll
Remove-Item -Path ${{ steps.strings.outputs.build-output-dir }}/bin/Release -Force -Recurse

- name: Archive artifacts
uses: actions/upload-artifact@v4
Expand Down
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
4 changes: 2 additions & 2 deletions launcher/src/benchmarkinstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ void BenchmarkInstaller::installGame()

KZip archive(m_localInstallerPath);
if (!archive.open(QIODevice::ReadOnly)) {
qCritical(ASTRA_LOG) << "Failed to extract benchmark files";
Q_EMIT error(i18n("Failed to extract benchmark files."));
qCritical(ASTRA_LOG) << "Failed to extract benchmark files:" << archive.errorString();
Q_EMIT error(i18n("Failed to extract benchmark files:\n\n%1", archive.errorString()));
return;
}

Expand Down
3 changes: 2 additions & 1 deletion launcher/src/gamerunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ QString GameRunner::getGameArgs(const Profile &profile, const std::optional<Logi
}

// FIXME: this should belong somewhere else...
Utility::createPathIfNeeded(profile.winePrefixPath());
if (LauncherCore::needsCompatibilityTool())
Utility::createPathIfNeeded(profile.winePrefixPath());

if (auth) {
if (!auth->lobbyhost.isEmpty()) {
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
12 changes: 0 additions & 12 deletions launcher/src/profilemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,9 @@ void ProfileManager::deleteProfile(Profile *profile)

QString ProfileManager::getDefaultGamePath(const QString &uuid)
{
#if defined(Q_OS_WIN)
return QStringLiteral("C:\\Program Files (x86)\\SquareEnix\\FINAL FANTASY XIV - A Realm Reborn");
#endif

#if defined(Q_OS_MAC)
return QDir::homePath() +
QStringLiteral("/Library/Application Support/FINAL FANTASY XIV ONLINE/Bottles/published_Final_Fantasy/drive_c/Program "
"Files (x86)/SquareEnix/FINAL FANTASY XIV - A Realm Reborn");
#endif

#if defined(Q_OS_LINUX)
const QDir appData = QStandardPaths::standardLocations(QStandardPaths::StandardLocation::AppDataLocation)[0];
const QDir gameDir = appData.absoluteFilePath(QStringLiteral("game"));
return gameDir.absoluteFilePath(uuid);
#endif
}

QString ProfileManager::getDefaultWinePrefixPath(const QString &uuid)
Expand Down