Reference/InstallDirRegKey

From NSIS Wiki
Jump to navigationJump to search

InstallDirRegKey

root_key subkey key_name

This attribute tells the installer to check a string in the registry, and use it for the install dir if that string is valid. If this attribute is present, it will override the InstallDir attribute if the registry key is valid, otherwise it will fall back to the InstallDir default. When querying the registry, this command will automatically remove any quotes. If the string ends in ".exe", it will automatically remove the filename component of the string (i.e. if the string is "C:\program files\foo\foo.exe", it will know to use "C:\program files\foo"). For more advanced install directory configuration, set $INSTDIR in .onInit.

Language strings and variables cannot be used with InstallDirRegKey.

InstallDirRegKey HKLM Software\NSIS ""
InstallDirRegKey HKLM Software\ACME\Thingy InstallLocation