Reference/InstallDirRegKey: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(Created page with "=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 th...") |
m (Less shit) |
||
Line 3: | Line 3: | ||
root_key subkey key_name | 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 [[Reference/InstallDir|InstallDir]] attribute if the registry key is valid, otherwise it will fall back to the [[Reference/InstallDir|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\ | 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 [[Reference/InstallDir|InstallDir]] attribute if the registry key is valid, otherwise it will fall back to the [[Reference/InstallDir|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. | Language strings and variables cannot be used with InstallDirRegKey. |
Latest revision as of 15:26, 8 June 2017
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