|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Service for managing Wine prefix dependencies. More...
#include <wine_dependency_manager.h>
Classes | |
| struct | Impl |
Public Types | |
| using | ProgressCallback = std::function<void(const DependencyInstallProgress&)> |
Public Member Functions | |
| WineDependencyManager () | |
| ~WineDependencyManager () | |
| void | cancelOperation () |
| Cancel ongoing operation. | |
| void | clearCache () |
| Clear winetricks cache. | |
| std::vector< WineDependency > | getAllDependencies () const |
| Get all available dependencies. | |
| std::filesystem::path | getCacheDirectory () const |
| Get winetricks cache directory. | |
| std::vector< WineDependency > | getDependenciesByCategory (DependencyCategory category) const |
| Get dependencies by category. | |
| std::optional< WineDependency > | getDependencyInfo (const std::string &verbId) const |
| Get dependency info by ID. | |
| std::vector< DLLOverride > | getDLLOverrides (const std::filesystem::path &prefixPath) const |
| Get DLL overrides for a prefix. | |
| std::vector< std::string > | getMissingDependencies (const std::filesystem::path &prefixPath, const std::vector< std::string > &requiredVerbs) const |
| Get missing dependencies for a game. | |
| std::vector< std::string > | getRecommendedDependencies () const |
| Get recommended dependencies for common game requirements. | |
| int | installDependencies (const std::filesystem::path &prefixPath, const std::vector< std::string > &verbIds, const ProgressCallback &progressCallback=nullptr) |
| Install multiple dependencies. | |
| bool | installDependency (const std::filesystem::path &prefixPath, const std::string &verbId, const ProgressCallback &progressCallback=nullptr) |
| Install a single dependency. | |
| std::future< bool > | installDependencyAsync (const std::filesystem::path &prefixPath, const std::string &verbId, const ProgressCallback &progressCallback=nullptr) |
| Install a dependency asynchronously. | |
| bool | installDirectXPreset (const std::filesystem::path &prefixPath, const ProgressCallback &progressCallback=nullptr) |
| Install DirectX dependencies. | |
| bool | installDotNet (const std::filesystem::path &prefixPath, const std::string &version="48", const ProgressCallback &progressCallback=nullptr) |
| Install .NET Framework. | |
| bool | installForSteamGame (uint32_t steamAppId, const std::vector< std::string > &verbIds, const ProgressCallback &progressCallback=nullptr) |
| Install dependencies for a Steam/Proton game. | |
| bool | installGamingPreset (const std::filesystem::path &prefixPath, const ProgressCallback &progressCallback=nullptr) |
| Install common gaming dependencies. | |
| bool | isDependencyInstalled (const std::filesystem::path &prefixPath, const std::string &verbId) const |
| Check if a specific dependency is installed. | |
| bool | removeDLLOverride (const std::filesystem::path &prefixPath, const std::string &dllName) |
| Remove a DLL override. | |
| PrefixDependencyStatus | scanPrefix (const std::filesystem::path &prefixPath) const |
| Scan a prefix for installed dependencies. | |
| std::vector< WineDependency > | searchDependencies (const std::string &query) const |
| Search for dependencies. | |
| bool | setDLLOverride (const std::filesystem::path &prefixPath, const std::string &dllName, const std::string &mode) |
| Set a DLL override. | |
| void | setGuiMode (bool enabled) |
| Enable/disable GUI mode for winetricks. | |
| void | setWinePath (const std::filesystem::path &winePath) |
| Set custom Wine binary path. | |
| void | setWinetricksPath (const std::filesystem::path &path) |
| Set winetricks path. | |
| bool | updateWinetricks () |
| Update winetricks to latest version. | |
Static Public Member Functions | |
| static std::string | getProtontricksVersion () |
| Get protontricks version. | |
| static std::string | getWinetricksVersion () |
| Get winetricks version. | |
| static bool | isProtontricksAvailable () |
| Check if protontricks is available. | |
| static bool | isWinetricksAvailable () |
| Check if winetricks is available. | |
Service for managing Wine prefix dependencies.
Provides methods for installing and managing Windows components in Wine prefixes using winetricks or protontricks.
Definition at line 162 of file wine_dependency_manager.h.
| using WineDependencyManager::ProgressCallback = std::function<void(const DependencyInstallProgress&)> |
Definition at line 165 of file wine_dependency_manager.h.
| WineDependencyManager::WineDependencyManager | ( | ) |
Definition at line 188 of file wine_dependency_manager.cpp.
| WineDependencyManager::~WineDependencyManager | ( | ) |
Definition at line 193 of file wine_dependency_manager.cpp.
| void WineDependencyManager::cancelOperation | ( | ) |
Cancel ongoing operation.
Definition at line 694 of file wine_dependency_manager.cpp.
| void WineDependencyManager::clearCache | ( | ) |
Clear winetricks cache.
Definition at line 713 of file wine_dependency_manager.cpp.
References getCacheDirectory().
| std::vector< WineDependency > WineDependencyManager::getAllDependencies | ( | ) | const |
Get all available dependencies.
Definition at line 250 of file wine_dependency_manager.cpp.
| std::filesystem::path WineDependencyManager::getCacheDirectory | ( | ) | const |
Get winetricks cache directory.
Definition at line 723 of file wine_dependency_manager.cpp.
Referenced by clearCache().
| std::vector< WineDependency > WineDependencyManager::getDependenciesByCategory | ( | DependencyCategory | category | ) | const |
Get dependencies by category.
| category | Category to filter by |
Definition at line 257 of file wine_dependency_manager.cpp.
| std::optional< WineDependency > WineDependencyManager::getDependencyInfo | ( | const std::string & | verbId | ) | const |
Get dependency info by ID.
| verbId | Winetricks verb ID |
Definition at line 272 of file wine_dependency_manager.cpp.
| std::vector< DLLOverride > WineDependencyManager::getDLLOverrides | ( | const std::filesystem::path & | prefixPath | ) | const |
Get DLL overrides for a prefix.
| prefixPath | Path to Wine prefix |
Definition at line 561 of file wine_dependency_manager.cpp.
References DLLOverride::dllName.
| std::vector< std::string > WineDependencyManager::getMissingDependencies | ( | const std::filesystem::path & | prefixPath, |
| const std::vector< std::string > & | requiredVerbs ) const |
Get missing dependencies for a game.
| prefixPath | Path to Wine prefix |
| requiredVerbs | List of required verb IDs |
Definition at line 419 of file wine_dependency_manager.cpp.
References isDependencyInstalled().
|
static |
Get protontricks version.
Definition at line 237 of file wine_dependency_manager.cpp.
References isProtontricksAvailable().
| std::vector< std::string > WineDependencyManager::getRecommendedDependencies | ( | ) | const |
Get recommended dependencies for common game requirements.
Definition at line 327 of file wine_dependency_manager.cpp.
Referenced by scanPrefix().
|
static |
Get winetricks version.
Definition at line 228 of file wine_dependency_manager.cpp.
References isWinetricksAvailable().
| int WineDependencyManager::installDependencies | ( | const std::filesystem::path & | prefixPath, |
| const std::vector< std::string > & | verbIds, | ||
| const ProgressCallback & | progressCallback = nullptr ) |
Install multiple dependencies.
| prefixPath | Path to Wine prefix |
| verbIds | List of verb IDs to install |
| progressCallback | Progress updates |
Definition at line 486 of file wine_dependency_manager.cpp.
References DependencyInstallProgress::Cancelled, DependencyInstallProgress::Completed, DependencyInstallProgress::currentVerb, DependencyInstallProgress::percentComplete, DependencyInstallProgress::state, DependencyInstallProgress::verbsCompleted, and DependencyInstallProgress::verbsTotal.
Referenced by installDirectXPreset(), and installGamingPreset().
| bool WineDependencyManager::installDependency | ( | const std::filesystem::path & | prefixPath, |
| const std::string & | verbId, | ||
| const ProgressCallback & | progressCallback = nullptr ) |
Install a single dependency.
| prefixPath | Path to Wine prefix |
| verbId | Winetricks verb ID |
| progressCallback | Progress updates |
Definition at line 437 of file wine_dependency_manager.cpp.
References DependencyInstallProgress::errorMessage, DependencyInstallProgress::Failed, isWinetricksAvailable(), and DependencyInstallProgress::state.
Referenced by installDependencyAsync(), and installDotNet().
| std::future< bool > WineDependencyManager::installDependencyAsync | ( | const std::filesystem::path & | prefixPath, |
| const std::string & | verbId, | ||
| const ProgressCallback & | progressCallback = nullptr ) |
Install a dependency asynchronously.
Definition at line 459 of file wine_dependency_manager.cpp.
References installDependency().
| bool WineDependencyManager::installDirectXPreset | ( | const std::filesystem::path & | prefixPath, |
| const ProgressCallback & | progressCallback = nullptr ) |
Install DirectX dependencies.
| prefixPath | Path to Wine prefix |
| progressCallback | Progress updates |
Definition at line 656 of file wine_dependency_manager.cpp.
References installDependencies().
| bool WineDependencyManager::installDotNet | ( | const std::filesystem::path & | prefixPath, |
| const std::string & | version = "48", | ||
| const ProgressCallback & | progressCallback = nullptr ) |
Install .NET Framework.
| prefixPath | Path to Wine prefix |
| version | .NET version (e.g., "48" for 4.8) |
| progressCallback | Progress updates |
Definition at line 665 of file wine_dependency_manager.cpp.
References installDependency().
| bool WineDependencyManager::installForSteamGame | ( | uint32_t | steamAppId, |
| const std::vector< std::string > & | verbIds, | ||
| const ProgressCallback & | progressCallback = nullptr ) |
Install dependencies for a Steam/Proton game.
| steamAppId | Steam app ID |
| verbIds | List of verb IDs to install |
| progressCallback | Progress updates |
Definition at line 535 of file wine_dependency_manager.cpp.
References DependencyInstallProgress::errorMessage, DependencyInstallProgress::Failed, isProtontricksAvailable(), and DependencyInstallProgress::state.
| bool WineDependencyManager::installGamingPreset | ( | const std::filesystem::path & | prefixPath, |
| const ProgressCallback & | progressCallback = nullptr ) |
Install common gaming dependencies.
| prefixPath | Path to Wine prefix |
| progressCallback | Progress updates |
Installs: vcrun2019, dxvk, corefonts
Definition at line 648 of file wine_dependency_manager.cpp.
References installDependencies().
| bool WineDependencyManager::isDependencyInstalled | ( | const std::filesystem::path & | prefixPath, |
| const std::string & | verbId ) const |
Check if a specific dependency is installed.
| prefixPath | Path to Wine prefix |
| verbId | Winetricks verb ID |
Definition at line 388 of file wine_dependency_manager.cpp.
Referenced by getMissingDependencies().
|
static |
Check if protontricks is available.
Definition at line 223 of file wine_dependency_manager.cpp.
Referenced by getProtontricksVersion(), installForSteamGame(), and core::StoreIntegrationController::isProtontricksAvailable().
|
static |
Check if winetricks is available.
Definition at line 218 of file wine_dependency_manager.cpp.
Referenced by getWinetricksVersion(), installDependency(), core::StoreIntegrationController::isWinetricksAvailable(), setDLLOverride(), and updateWinetricks().
| bool WineDependencyManager::removeDLLOverride | ( | const std::filesystem::path & | prefixPath, |
| const std::string & | dllName ) |
Remove a DLL override.
| prefixPath | Path to Wine prefix |
| dllName | DLL name |
Definition at line 630 of file wine_dependency_manager.cpp.
References ShellUtils::escapeArg().
| PrefixDependencyStatus WineDependencyManager::scanPrefix | ( | const std::filesystem::path & | prefixPath | ) | const |
Scan a prefix for installed dependencies.
| prefixPath | Path to Wine prefix |
Definition at line 344 of file wine_dependency_manager.cpp.
References PrefixDependencyStatus::architecture, getRecommendedDependencies(), PrefixDependencyStatus::installedVerbs, PrefixDependencyStatus::lastScanned, PrefixDependencyStatus::missingRecommended, and PrefixDependencyStatus::prefixPath.
| std::vector< WineDependency > WineDependencyManager::searchDependencies | ( | const std::string & | query | ) | const |
Search for dependencies.
| query | Search query |
Definition at line 294 of file wine_dependency_manager.cpp.
| bool WineDependencyManager::setDLLOverride | ( | const std::filesystem::path & | prefixPath, |
| const std::string & | dllName, | ||
| const std::string & | mode ) |
Set a DLL override.
| prefixPath | Path to Wine prefix |
| dllName | DLL name (without .dll extension) |
| mode | Override mode |
Definition at line 608 of file wine_dependency_manager.cpp.
References ShellUtils::escapeArg(), and isWinetricksAvailable().
| void WineDependencyManager::setGuiMode | ( | bool | enabled | ) |
Enable/disable GUI mode for winetricks.
| enabled | Whether to show winetricks GUI |
Definition at line 689 of file wine_dependency_manager.cpp.
| void WineDependencyManager::setWinePath | ( | const std::filesystem::path & | winePath | ) |
Set custom Wine binary path.
| winePath | Path to Wine binary |
Definition at line 677 of file wine_dependency_manager.cpp.
| void WineDependencyManager::setWinetricksPath | ( | const std::filesystem::path & | path | ) |
Set winetricks path.
| path | Path to winetricks script |
Definition at line 683 of file wine_dependency_manager.cpp.
| bool WineDependencyManager::updateWinetricks | ( | ) |
Update winetricks to latest version.
Definition at line 703 of file wine_dependency_manager.cpp.
References isWinetricksAvailable().