Reference/ReadRegStr: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
mNo edit summary |
(→ReadRegStr: Document behavior on string overflow) |
||
Line 3: | Line 3: | ||
user_var(output) root_key sub_key name | user_var(output) root_key sub_key name | ||
Reads from the registry into the user variable $x. Valid values for root_key are listed under [[Reference/WriteRegStr|WriteRegStr]]. The error flag will be set and $x will be set to an empty string ("") if the string is not present. If the value is present, but is of type REG_DWORD, it will be read and converted to a string and the error flag will be set. | Reads from the registry into the user variable $x. Valid values for root_key are listed under [[Reference/WriteRegStr|WriteRegStr]]. The error flag will be set and $x will be set to an empty string ("") if the string is not present or longer than NSIS_MAX_STRLEN. If the value is present, but is of type REG_DWORD, it will be read and converted to a string and the error flag will be set. | ||
<highlight-nsis>ReadRegStr $0 HKLM Software\NSIS "" | <highlight-nsis>ReadRegStr $0 HKLM Software\NSIS "" |
Latest revision as of 17:46, 15 June 2015
ReadRegStr
user_var(output) root_key sub_key name
Reads from the registry into the user variable $x. Valid values for root_key are listed under WriteRegStr. The error flag will be set and $x will be set to an empty string ("") if the string is not present or longer than NSIS_MAX_STRLEN. If the value is present, but is of type REG_DWORD, it will be read and converted to a string and the error flag will be set.
ReadRegStr $0 HKLM Software\NSIS "" DetailPrint "NSIS is installed at: $0"
Command introduced with NSIS v1.2g