Skip to content
⌘ NSIS Forum Archive

how to install to steam/counter-strike path

12 posts

spunko#

how to install to steam/counter-strike path

hi.. I have a custom server with some files i need to install in counter-strike folder for steam.
The problem is that all steam users have their own path for steam..
I mean every path changes because of the username or hard drive, like mine "D:\Steam\SteamApps\sidico\counter-strike", but almost every one have it in "C:\Program files\Steam\SteamApps\@user\counter-strike"

how can I set "InstallDir" to get the correct path for the folder "counter-strike", no matter wich drive is it or the most important thing "the username".. I have no idea 🙁

thanx a lot..
Afrow UK#
Searching the forum for "steam" would have given you this link one way or another:


-Stu
spunko#
hi, I read your post http://forums.winamp.com/showthread....25#post1703925
it helped me a lot, now my installer works like I wanted, it install everywhere steam is..

I tryed to make another installer for my dedicated server, the problem is that I have to install it in another path, in my PC at home is in "C:\program files\valve", but in my college is in "E:\custom server\valve".. I tryed to modify the code but it doesn't compile.. I'm so noob at this, can u help me with a code like yours but this time it just have to look for the folder "valve"

I really wanted to do it myself, but I can´t..
Sorry if I´m asking too much.. sorry for my english too..

thank you..
Afrow UK#
The function should still work, because it gets the path from the registry. It does not search the computer for a "Valve" folder. This would be very unprofessional.

Is "E:\custom server\valve" a proper Steam installation?

-Stu
spunko#edited
sorry I forgot to mention, valve forlder is for counter strike 1.5 that is still popular in my country
I think 1.5 has to be with WON or something, It doesn´t come with steam 🙁

Edit: I think it has to look for hl.exe because you can change the name of valve folder too.
Afrow UK#
If it isn't a Steam program then it will likely have a registry entry somewhere else for the location that it is installed in. Use the search feature in regedit and do a search for the folder path.

-Stu
spunko#
thanx.. I have the path, the problem is i dunno how to use it to install there.. for exmaple:
I have HKCU "Software\Lala" "Lala"

Function path
ReadRegStr $La HKCU "Software\Lala" "Lala"
FunctionEnd
I don't know if that is correct, if is, how do I use it to make the installer go to that path folder?

than you..
Afrow UK#
ClearErrors
ReadRegStr $R0 HKCU "Software\Lala" "Lala"
IfErrors +2
StrCpy $INSTDIR $R0

Put that in Function .onInit

-Stu
Afrow UK#
No problem 🙂

For a default install path, use InstallDir "my path".
If that registry key exists however, it will use the path in the registry instead.

-Stu
Der_Synth#
Created A User / Game Selection Page...
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.