game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
UMULauncher Class Reference

Service for launching games via UMU (umu-run). More...

#include <umu_launcher.h>

Classes

class  Impl

Public Types

using ProgressCallback = std::function<void(int percent, const std::string& status)>

Public Member Functions

 UMULauncher ()
 UMULauncher (const UMULauncher &)=delete
 ~UMULauncher ()
std::string buildLaunchCommand (const UMULaunchConfig &config) const
 Build the full launch command for umu-run.
void buildLaunchComponents (const UMULaunchConfig &config, std::map< std::string, std::string > &envVars, std::vector< std::string > &command) const
 Build launch command as separate components.
bool createPrefix (const std::string &prefixPath, const std::string &protonPath="")
 Create a new Wine prefix via umu-run.
bool downloadGEProton (const ProgressCallback &progressCallback=nullptr)
 Download latest GE-Proton for UMU.
bool downloadUMUProton (const ProgressCallback &progressCallback=nullptr)
 Download latest UMU-Proton.
std::vector< UMUProtonVersion > getAvailableProtonVersions () const
 Get available Proton versions for UMU.
std::string getDefaultPrefixPath (const std::string &gameId) const
 Get the default Wine prefix path for a GAMEID.
UMUInstallStatus getInstallStatus () const
 Get detailed installation status.
std::string getUMURunPath () const
 Get path to umu-run binary.
bool hasProtonUpdates () const
 Check if Proton updates are available.
bool isAvailable () const
 Check if umu-run is available on the system.
UMUGameInfo lookupGame (const std::string &gameId) const
 Look up a game in the umu database.
UMULauncher & operator= (const UMULauncher &)=delete
bool prefixExists (const std::string &prefixPath) const
 Check if a Wine prefix exists.
void refreshProtonVersions ()
 Refresh the list of available Proton versions.
bool runWinetricks (const std::string &prefixPath, const std::vector< std::string > &verbs, const std::string &protonPath="", const ProgressCallback &progressCallback=nullptr)
 Run winetricks verbs in a prefix via umu.
std::vector< UMUGameInfo > searchGames (const std::string &query, std::optional< UMUStore > store=std::nullopt) const
 Search for games in the umu database.
std::string suggestGameId (const std::string &gameName, UMUStore store=UMUStore::None) const
 Get suggested GAMEID for a game name.

Static Public Member Functions

static UMUStore storeFromString (const std::string &str)
 Parse store identifier from string.
static std::string storeToString (UMUStore store)
 Get store identifier string from enum.

Detailed Description

Service for launching games via UMU (umu-run).

Provides integration with the UMU Unified Linux Wine Game Launcher, allowing non-Steam games to run with Steam's Proton in the Steam Runtime container with automatic protonfixes application.

Definition at line 175 of file umu_launcher.h.

Member Typedef Documentation

◆ ProgressCallback

using UMULauncher::ProgressCallback = std::function<void(int percent, const std::string& status)>

Definition at line 178 of file umu_launcher.h.

Constructor & Destructor Documentation

◆ UMULauncher() [1/2]

UMULauncher::UMULauncher ( )

Definition at line 456 of file umu_launcher.cpp.

Referenced by UMULauncher(), and operator=().

◆ ~UMULauncher()

UMULauncher::~UMULauncher ( )
default

◆ UMULauncher() [2/2]

UMULauncher::UMULauncher ( const UMULauncher & )
delete

References UMULauncher().

Member Function Documentation

◆ buildLaunchCommand()

std::string UMULauncher::buildLaunchCommand ( const UMULaunchConfig & config) const

Build the full launch command for umu-run.

Parameters
configLaunch configuration
Returns
Complete command string ready for execution

Returns a command string that can be passed to system() or a process manager. Environment variables are prepended, then umu-run with args.

Definition at line 493 of file umu_launcher.cpp.

References UMULaunchConfig::arguments, Custom, UMULaunchConfig::customProtonPath, UMULaunchConfig::customStore, Default, UMULaunchConfig::enableProtonLog, UMULaunchConfig::enableUMULog, UMULaunchConfig::environmentVariables, Logger::error(), ShellUtils::escapeArg(), UMULaunchConfig::executable, UMULaunchConfig::gameId, GEProton, ShellUtils::isValidEnvName(), None, UMULaunchConfig::protonPathMode, UMULaunchConfig::protonVerb, UMULaunchConfig::store, storeToString(), SystemProton, Logger::warn(), and UMULaunchConfig::winePrefix.

◆ buildLaunchComponents()

void UMULauncher::buildLaunchComponents ( const UMULaunchConfig & config,
std::map< std::string, std::string > & envVars,
std::vector< std::string > & command ) const

Build launch command as separate components.

Parameters
configLaunch configuration
[out]envVarsEnvironment variables to set
[out]commandThe umu-run command with arguments

Useful when you need to set environment variables separately (e.g., with execve or QProcess).

Definition at line 603 of file umu_launcher.cpp.

References UMULaunchConfig::arguments, Custom, UMULaunchConfig::customProtonPath, UMULaunchConfig::customStore, UMULaunchConfig::enableProtonLog, UMULaunchConfig::enableUMULog, UMULaunchConfig::environmentVariables, UMULaunchConfig::executable, UMULaunchConfig::gameId, GEProton, ShellUtils::isValidEnvName(), None, UMULaunchConfig::protonPathMode, UMULaunchConfig::protonVerb, UMULaunchConfig::store, storeToString(), SystemProton, Logger::warn(), and UMULaunchConfig::winePrefix.

◆ createPrefix()

bool UMULauncher::createPrefix ( const std::string & prefixPath,
const std::string & protonPath = "" )

Create a new Wine prefix via umu-run.

Parameters
prefixPathPath for new prefix
protonPathProton version to use
Returns
True if creation succeeded

Definition at line 887 of file umu_launcher.cpp.

References Logger::error(), ShellUtils::escapeArg(), and Logger::info().

◆ downloadGEProton()

bool UMULauncher::downloadGEProton ( const ProgressCallback & progressCallback = nullptr)

Download latest GE-Proton for UMU.

Parameters
progressCallbackProgress callback
Returns
True if download succeeded

Downloads to ~/.local/share/Steam/compatibilitytools.d/

Definition at line 749 of file umu_launcher.cpp.

References Logger::error(), and ShellUtils::escapeArg().

◆ downloadUMUProton()

bool UMULauncher::downloadUMUProton ( const ProgressCallback & progressCallback = nullptr)

Download latest UMU-Proton.

Parameters
progressCallbackProgress callback
Returns
True if download succeeded

Definition at line 780 of file umu_launcher.cpp.

References Logger::error(), and ShellUtils::escapeArg().

◆ getAvailableProtonVersions()

std::vector< UMUProtonVersion > UMULauncher::getAvailableProtonVersions ( ) const

Get available Proton versions for UMU.

Returns
Vector of available Proton versions

Definition at line 488 of file umu_launcher.cpp.

◆ getDefaultPrefixPath()

std::string UMULauncher::getDefaultPrefixPath ( const std::string & gameId) const

Get the default Wine prefix path for a GAMEID.

Parameters
gameIdGame ID
Returns
Default prefix path ($HOME/Games/umu/GAMEID)

Definition at line 872 of file umu_launcher.cpp.

◆ getInstallStatus()

UMUInstallStatus UMULauncher::getInstallStatus ( ) const

◆ getUMURunPath()

std::string UMULauncher::getUMURunPath ( ) const

Get path to umu-run binary.

Returns
Path to umu-run or empty if not found

Definition at line 478 of file umu_launcher.cpp.

◆ hasProtonUpdates()

bool UMULauncher::hasProtonUpdates ( ) const

Check if Proton updates are available.

Returns
True if newer versions exist

Definition at line 809 of file umu_launcher.cpp.

References Logger::warn().

◆ isAvailable()

bool UMULauncher::isAvailable ( ) const

Check if umu-run is available on the system.

Returns
True if umu-run is installed and accessible

Definition at line 460 of file umu_launcher.cpp.

◆ lookupGame()

UMUGameInfo UMULauncher::lookupGame ( const std::string & gameId) const

Look up a game in the umu database.

Parameters
gameIdGame ID to look up
Returns
UMUGameInfo with details (check .found)

Definition at line 696 of file umu_launcher.cpp.

References UMUGameInfo::found, UMUGameInfo::gameId, and UMUGameInfo::title.

◆ operator=()

UMULauncher & UMULauncher::operator= ( const UMULauncher & )
delete

References UMULauncher(), and None.

◆ prefixExists()

bool UMULauncher::prefixExists ( const std::string & prefixPath) const

Check if a Wine prefix exists.

Parameters
prefixPathPath to Wine prefix
Returns
True if prefix directory exists

Definition at line 882 of file umu_launcher.cpp.

◆ refreshProtonVersions()

void UMULauncher::refreshProtonVersions ( )

Refresh the list of available Proton versions.

Definition at line 483 of file umu_launcher.cpp.

◆ runWinetricks()

bool UMULauncher::runWinetricks ( const std::string & prefixPath,
const std::vector< std::string > & verbs,
const std::string & protonPath = "",
const ProgressCallback & progressCallback = nullptr )

Run winetricks verbs in a prefix via umu.

Parameters
prefixPathWine prefix path
verbsWinetricks verbs to install
protonPathProton version to use
progressCallbackProgress callback
Returns
True if all verbs installed successfully

Definition at line 912 of file umu_launcher.cpp.

References ShellUtils::escapeArg(), and Logger::info().

◆ searchGames()

std::vector< UMUGameInfo > UMULauncher::searchGames ( const std::string & query,
std::optional< UMUStore > store = std::nullopt ) const

Search for games in the umu database.

Parameters
querySearch query (game name)
storeOptional store filter
Returns
Vector of matching games

Definition at line 713 of file umu_launcher.cpp.

◆ storeFromString()

UMUStore UMULauncher::storeFromString ( const std::string & str)
static

Parse store identifier from string.

Parameters
strStore string
Returns
Store enum value

Definition at line 989 of file umu_launcher.cpp.

References Amazon, EA, EGS, GOG, Humble, Itch, None, Steam, and Ubisoft.

◆ storeToString()

std::string UMULauncher::storeToString ( UMUStore store)
static

Get store identifier string from enum.

Parameters
storeStore enum value
Returns
Store string (e.g., "egs", "gog")

Definition at line 962 of file umu_launcher.cpp.

References Amazon, Custom, EA, EGS, GOG, Humble, Itch, None, Steam, and Ubisoft.

Referenced by buildLaunchCommand(), buildLaunchComponents(), and UMULauncher::Impl::searchDatabase().

◆ suggestGameId()

std::string UMULauncher::suggestGameId ( const std::string & gameName,
UMUStore store = UMUStore::None ) const

Get suggested GAMEID for a game name.

Parameters
gameNameGame name to match
storeStore the game is from
Returns
Suggested GAMEID or empty if no match found

Definition at line 719 of file umu_launcher.cpp.


The documentation for this class was generated from the following files: