Unaffiliated

Home Documentation & Help
Steamworks Documentation
ISteamAppList Interface
Let you detect installed apps for the local Steam client.

This is useful for debugging tools to offer lists of apps to debug via Steam.

This is a restricted interface that can only be used by previously approved apps, please let us know via the Steamworks discussion board if you believe that you need access to this API.

Member Functions

Member functions for ISteamAppList are called through the global accessor function SteamAppList().

GetAppBuildId

int GetAppBuildId( AppId_t nAppID );
NameTypeDescription
nAppIDAppId_tThe app to get the build id for.

Returns the build id number of an installed app, this may change at any time based on backend updates to the game.

Returns: int
Returns the build id number. Returns 0 if the current app Id does not have permission to use this interface, if the app Id is invalid, or the client doesn't know about it.

GetAppInstallDir

int GetAppInstallDir( AppId_t nAppID, char *pchDirectory, int cchNameMax );
NameTypeDescription
nAppIDAppId_tThe app to get the install dir for.
pchDirectorychar *Returns the install directory.
cchNameMaxintThe length of the buffer allocated for pchDirectory.

Gets the install directory of an app.

If the app is installed then this provides the current install directory, otherwise it tells you where it would be installed with the default steam library location.

Returns: int
The length of the string returned. Returns -1 if the current app Id does not have permission to use this interface.

pchDirectory is set to an empty string if the call fails, otherwise it looks something like "C:\Program Files (x86)\Steam\steamapps\common\Half-Life".

If you call this with pchDirectory as NULL and cchNamemax set to 0 then it returns the length without copying the string.

GetAppName

int GetAppName( AppId_t nAppID, char *pchName, int cchNameMax );
NameTypeDescription
nAppIDAppId_tThe app to get the name dir for.
pchNamechar *Returns the app name by copying it into this string.
cchNameMaxintThe length of the buffer allocated for pchName.

Gets the name of a specified app.

The name is provided as a UTF8 encoded string.

Returns: int
The length of the string returned. Returns -1 if the current app Id does not have permission to use this interface, the App ID is invalid, or the client doesn't know about it.

GetInstalledApps

uint32 GetInstalledApps( AppId_t *pvecAppID, uint32 unMaxAppIDs );
NameTypeDescription
pvecAppIDAppId_t *Returns the list of installed AppIds by copying them into this array.
unMaxAppIDsuint32This should be the length of pvecAppID, which should be the same number provided by GetNumInstalledApps.

Retrieves the list of installed apps in order.

Returns: uint32
The number of apps copied into the array. Returns 0 if the current app Id does not have permission to use this interface.

GetNumInstalledApps

uint32 GetNumInstalledApps();
Gets the number of installed apps in the local steam client.

This loops through ALL of the users apps, including uninstalled ones. So it's a good idea to call this once and cache the result as this could end up being very expensive if used as a loop conditional if the user has thousands of apps.

Returns: uint32
The number of installed apps. Returns 0 if the current app Id does not have permission to use this interface.

Example:
void ListInstalledApps() { uint32 unNumApps = SteamAppList()->GetNumInstalledApps(); std::vector<AppId_t> vecListOfApps( unNumApps ); SteamAppList()->GetInstalledApps( vecListOfApps.data(), unNumApps ); for ( uint32 i = 0; i < unNumApps; ++i ) { char szName[256]; int len = SteamAppList()->GetAppName( vecListOfApps[i], szName, sizeof( szName ) ); if ( len > 0 ) { printf( "App name: %s\n", szName ); } char szInstallDir[MAX_PATH]; len = SteamAppList()->GetAppInstallDir( vecListOfApps[i], szInstallDir, sizeof( szInstallDir ) ); if ( len > 0 ) { printf( "Install dir: %s\n", szInstallDir ); } int buildid = SteamAppList()->GetAppBuildId( vecListOfApps[i] ); printf( "Build Id: %d\n", buildid ); } }

Callbacks

These are callbacks which can be fired by calling SteamAPI_RunCallbacks. Many of these will be fired directly in response to the member functions of ISteamAppList.

SteamAppInstalled_t

Called when a new app is installed.

NameTypeDescription
m_nAppIDAppId_tId of the app that was installed.

SteamAppUninstalled_t

Called when an app is uninstalled.

NameTypeDescription
m_nAppIDAppId_tId of the app that was uninstalled.

Constants

These are constants which are defined for use with ISteamAppList.

NameTypeValueDescription
STEAMAPPLIST_INTERFACE_VERSIONconst char *"STEAMAPPLIST_INTERFACE_VERSION001"