JSM
14th May 2003 06:50 UTC
Finding path to program
Hi all, I tried searching, but I could not find anything, maybe I put the wrong info to search for.
I am a level designer for Raven-Shield, what I need for the installer to do is to grab the info on where the client has installed his raven-shield copy to. Like an auto find, instead of him having to use the browse button to select the location of his installation.
I love NSIS btw,it is great!
virtlink
14th May 2003 10:57 UTC
There is an instruction for reading path information from the registry (but I can't recall the instruction's name).
kichik
14th May 2003 11:44 UTC
You usually use InstallDirRegKey for this purpose. It'll get the installation directory from a specific registry key. An example from makensis.nsi:
InstallDir $PROGRAMFILES\NSIS
InstallDirRegKey HKLM SOFTWARE\NSIS ""
You might also want to use .onVerifyInstDir to make sure the directory used is the right one. For example:
Function .onVerifyInstDir
;Check for Winamp installation
IfFileExists $INSTDIR\Winamp.exe Good
Abort
Good:
FunctionEnd
Afrow UK
14th May 2003 16:20 UTC
Is there ever going to be a command for doing "search all hard drives on a pc for a specific file"
That would be usful for my updates program, but right now I have to get the user to 'tell' the updater app where his downloaded files dirs are (where he commanly downloads files to) which is kinda stupid if you ask me!
-Stu
kichik
14th May 2003 16:22 UTC
You can search a given directory using FindFirst, FindNext, and FindClose.