Skip to content
⌘ NSIS Forum Archive

Finding path to program

5 posts

JSM#

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#
There is an instruction for reading path information from the registry (but I can't recall the instruction's name).
kichik#
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#
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