|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Service for downloading and managing compatibility tools. More...
#include <runner_download_service.h>
Classes | |
| struct | Impl |
Public Types | |
| using | ProgressCallback = std::function<void(const DownloadProgress&)> |
| using | ReleaseCallback = std::function<void(const std::vector<RunnerRelease>&)> |
Public Member Functions | |
| RunnerDownloadService () | |
| ~RunnerDownloadService () | |
| void | cancelDownload (RunnerType type) |
| Cancel an ongoing download. | |
| int | cleanupOldVersions (RunnerType type, int keepCount=3) |
| Clean up old versions, keeping newest N. | |
| void | clearCache () |
| Clear the releases cache. | |
| bool | downloadRunner (const RunnerRelease &release, const ProgressCallback &progressCallback=nullptr) |
| Download and install a runner. | |
| std::future< bool > | downloadRunnerAsync (const RunnerRelease &release, const ProgressCallback &progressCallback=nullptr) |
| Download and install a runner asynchronously. | |
| std::vector< RunnerRelease > | getAvailableReleases (RunnerType type, bool includePrerelease=false, int maxResults=20) |
| Get available releases for a runner type. | |
| void | getAvailableReleasesAsync (RunnerType type, const ReleaseCallback &callback, bool includePrerelease=false) |
| Get available releases asynchronously. | |
| std::vector< InstalledRunner > | getInstalledRunners () const |
| Get all installed runners. | |
| std::vector< InstalledRunner > | getInstalledRunners (RunnerType type) const |
| Get installed runners of a specific type. | |
| std::optional< RunnerRelease > | getLatestRelease (RunnerType type, bool includePrerelease=false) |
| Get the latest release for a runner type. | |
| bool | isDownloading (RunnerType type) const |
| Check if a download is in progress. | |
| bool | isInstalled (RunnerType type, const std::string &version) const |
| Check if a specific version is installed. | |
| void | refreshInstalled () |
| Refresh installed runners list. | |
| void | setInstallPath (RunnerType type, const std::filesystem::path &path) |
| Set custom installation directory. | |
| bool | uninstallRunner (RunnerType type, const std::string &version) |
| Uninstall a runner version. | |
Static Public Member Functions | |
| static std::filesystem::path | getDefaultInstallPath (RunnerType type) |
| Get default installation directory for a runner type. | |
Service for downloading and managing compatibility tools.
Provides a unified interface for downloading, installing, and managing various Windows compatibility layers like Proton-GE and Wine-GE.
Definition at line 183 of file runner_download_service.h.
| using RunnerDownloadService::ProgressCallback = std::function<void(const DownloadProgress&)> |
Definition at line 186 of file runner_download_service.h.
| using RunnerDownloadService::ReleaseCallback = std::function<void(const std::vector<RunnerRelease>&)> |
Definition at line 187 of file runner_download_service.h.
| RunnerDownloadService::RunnerDownloadService | ( | ) |
Definition at line 459 of file runner_download_service.cpp.
| RunnerDownloadService::~RunnerDownloadService | ( | ) |
Definition at line 479 of file runner_download_service.cpp.
| void RunnerDownloadService::cancelDownload | ( | RunnerType | type | ) |
Cancel an ongoing download.
| type | Runner type to cancel |
Definition at line 1355 of file runner_download_service.cpp.
References Logger::info(), and runnerTypeName().
| int RunnerDownloadService::cleanupOldVersions | ( | RunnerType | type, |
| int | keepCount = 3 ) |
Clean up old versions, keeping newest N.
| type | Runner type |
| keepCount | Number of versions to keep |
Definition at line 1594 of file runner_download_service.cpp.
References getInstalledRunners(), and uninstallRunner().
| void RunnerDownloadService::clearCache | ( | ) |
Clear the releases cache.
Definition at line 1615 of file runner_download_service.cpp.
| bool RunnerDownloadService::downloadRunner | ( | const RunnerRelease & | release, |
| const ProgressCallback & | progressCallback = nullptr ) |
Download and install a runner.
| release | Release to install |
| progressCallback | Progress updates |
Definition at line 1153 of file runner_download_service.cpp.
References RunnerDownloadService::Impl::activeDownloads, DownloadProgress::bytesTotal, DownloadProgress::Cancelled, RunnerRelease::checksum, RunnerRelease::checksumType, DownloadProgress::Completed, DownloadProgress::currentFile, DownloadProgress::Downloading, RunnerRelease::downloadUrl, Logger::error(), DownloadProgress::errorMessage, DownloadProgress::Failed, Logger::info(), ProtonCache::invalidate(), RunnerDownloadService::Impl::mutex, DownloadProgress::percentComplete, runnerTypeName(), RunnerRelease::size, DownloadProgress::state, RunnerRelease::type, DownloadProgress::Verifying, RunnerRelease::version, and Logger::warn().
Referenced by downloadRunnerAsync().
| std::future< bool > RunnerDownloadService::downloadRunnerAsync | ( | const RunnerRelease & | release, |
| const ProgressCallback & | progressCallback = nullptr ) |
Download and install a runner asynchronously.
| release | Release to install |
| progressCallback | Progress updates |
Definition at line 1348 of file runner_download_service.cpp.
References downloadRunner().
| std::vector< RunnerRelease > RunnerDownloadService::getAvailableReleases | ( | RunnerType | type, |
| bool | includePrerelease = false, | ||
| int | maxResults = 20 ) |
Get available releases for a runner type.
| type | Type of runner |
| includePrerelease | Include pre-release versions |
| maxResults | Maximum number of releases to return |
Definition at line 820 of file runner_download_service.cpp.
References Archived, RunnerDownloadService::Impl::CACHE_VALIDITY_SEC, Logger::error(), Logger::info(), RunnerRelease::isArchived, ManualOnly, runnerStatus(), and runnerTypeName().
Referenced by getAvailableReleasesAsync(), and getLatestRelease().
| void RunnerDownloadService::getAvailableReleasesAsync | ( | RunnerType | type, |
| const ReleaseCallback & | callback, | ||
| bool | includePrerelease = false ) |
Get available releases asynchronously.
| type | Type of runner |
| callback | Callback with releases when complete |
| includePrerelease | Include pre-release versions |
Definition at line 882 of file runner_download_service.cpp.
References getAvailableReleases().
|
static |
Get default installation directory for a runner type.
| type | Runner type |
Definition at line 1380 of file runner_download_service.cpp.
References DXVK, Logger::error(), Luxtorpeda, ProtonGE, ProtonTKG, UMU, VKD3DProton, and WineGE.
| std::vector< InstalledRunner > RunnerDownloadService::getInstalledRunners | ( | ) | const |
Get all installed runners.
Definition at line 1431 of file runner_download_service.cpp.
References DXVK, getInstalledRunners(), Luxtorpeda, ProtonGE, ProtonTKG, UMU, VKD3DProton, and WineGE.
Referenced by cleanupOldVersions(), getInstalledRunners(), and isInstalled().
| std::vector< InstalledRunner > RunnerDownloadService::getInstalledRunners | ( | RunnerType | type | ) | const |
Get installed runners of a specific type.
| type | Runner type to filter by |
Definition at line 1447 of file runner_download_service.cpp.
References DXVK, Logger::error(), InstalledRunner::installDate, InstalledRunner::name, InstalledRunner::path, ProtonGE, ProtonTKG, InstalledRunner::sizeBytes, InstalledRunner::type, InstalledRunner::version, VKD3DProton, and WineGE.
| std::optional< RunnerRelease > RunnerDownloadService::getLatestRelease | ( | RunnerType | type, |
| bool | includePrerelease = false ) |
Get the latest release for a runner type.
| type | Type of runner |
| includePrerelease | Include pre-release versions |
Definition at line 897 of file runner_download_service.cpp.
References getAvailableReleases().
| bool RunnerDownloadService::isDownloading | ( | RunnerType | type | ) | const |
Check if a download is in progress.
| type | Runner type to check |
Definition at line 1370 of file runner_download_service.cpp.
| bool RunnerDownloadService::isInstalled | ( | RunnerType | type, |
| const std::string & | version ) const |
Check if a specific version is installed.
| type | Runner type |
| version | Version string |
Definition at line 1532 of file runner_download_service.cpp.
References getInstalledRunners().
| void RunnerDownloadService::refreshInstalled | ( | ) |
Refresh installed runners list.
Definition at line 1622 of file runner_download_service.cpp.
| void RunnerDownloadService::setInstallPath | ( | RunnerType | type, |
| const std::filesystem::path & | path ) |
Set custom installation directory.
| type | Runner type |
| path | Custom path |
Definition at line 1424 of file runner_download_service.cpp.
| bool RunnerDownloadService::uninstallRunner | ( | RunnerType | type, |
| const std::string & | version ) |
Uninstall a runner version.
| type | Runner type |
| version | Version to uninstall |
Definition at line 1539 of file runner_download_service.cpp.
References Logger::error(), Logger::info(), ProtonCache::invalidate(), and runnerTypeName().
Referenced by cleanupOldVersions().