Archive: Find Directory


Find Directory
Hy I know that it gives an post here how is similarly but I'm not understand how I make this. (I'am German so my English isn't very good)

I would make for my Counter-Strike Mod an Function with that my installer automatically find if counter-Strike is installed or not. The Regpath is HKLM "SOFTWARE\Valve\Steam" "InstallPath"

The Script must be installed in But the script has to be installed in
Valve\

How can I make this could you make me an Code which I only mus paste ?

Please help me


http://nsis.sourceforge.net/archive/...instances=0,11

Then use GetParent function, available in the NSIS manual under Useful Scripts to get X:\Path\To\Valve.

Function .onInit

Call GetSteamAccountName
Pop $R0 ; account name e.g. afrow uk
Pop $R1 ; steam path e.g. C:\Valve\Steam

Push $R1
Call GetParent
Pop $INSTDIR

FunctionEnd


-Stu

Hy thank you for your reply


But i've write this script for a noun steamversion. And there is the path e.g. C:\Programs\Valve

How can I do this ?

There musn't be found an account name... only the patch where the game was installed must be found.

Thank you


Please use your imagination!
The function returns the Steam install path, so now all you need to do is check if the Counter-Strike source GCF files exist...


Function .onInit

Call GetSteamAccountName
Pop $R0 ; account name e.g. afrow uk
Pop $R1 ; steam path e.g. C:\Valve\Steam

IfFileExists "$R1\SteamApps\counter-strike source client.gcf" 0 +2
IfFileExists "$R1\SteamApps\counter-strike source shared.gcf" +3

MessageBox MB_OK|MB_ICONSTOP "CS:Source not installed!"
Abort

Push $R1
Call GetParent
Pop $INSTDIR

FunctionEnd


-Stu