Get Steam account name and install path: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
No edit summary |
|||
Line 42: | Line 42: | ||
</highlight-nsis> | </highlight-nsis> | ||
hahahahaha losser | |||
Revision as of 04:48, 22 July 2008
Author: Afrow UK (talk, contrib) |
Description
This gets the account name for Valve's Steam (Half-Life 1, 2 etc) It also returns Steam's install path (e.g. C:\Valve\Steam)
Usage
Call GetSteamAccountName Pop $R0 ; account name e.g. afrow uk Pop $R1 ; steam path e.g. C:\Valve\Steam
If Steam is not installed, then empty strings are returned.
If Steam is installed but no accounts are found, then the account name returned is "[ACCOUNT_NAME]".
Example
Perhaps you want your $INSTDIR to be the full path to the SourceMods folder (for HL2), in which case you'd do it like so:
LangString SteamNotInstalled ${LANG_ENGLISH} "Valve's Steam is not installed!$\r$\nSetup will now exit." Function .onInit Call GetSteamAccountName Pop $R0 ; CaDDy- Pop $R1 ; E\Games\Steaaam # Check if Steam is installed StrCmp $R0 "" 0 +3 MessageBox MB_OK|MB_ICONSTOP $(SteamNotInstalled) Abort # It is installed so set INSTDIR StrCpy $INSTDIR "$R1\SteamApps\$R0\SourceMods\MyMod" FunctionEnd
hahahahaha losser