Reference/EnumRegValue: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with "=EnumRegValue= user_var(output) root_key subkey index Set user variable $x with the name of the 'index'th registry value in root_key\Subkey. Valid values for root_key are list...")
 
mNo edit summary
 
Line 14: Line 14:
   MessageBox MB_YESNO|MB_ICONQUESTION "$1 = $2$\n$\nMore?" IDYES loop
   MessageBox MB_YESNO|MB_ICONQUESTION "$1 = $2$\n$\nMore?" IDYES loop
done:</highlight-nsis>
done:</highlight-nsis>
''Command introduced with NSIS v1.50''

Latest revision as of 20:28, 4 June 2013

EnumRegValue

user_var(output) root_key subkey index

Set user variable $x with the name of the 'index'th registry value in root_key\Subkey. Valid values for root_key are listed under WriteRegStr. Returns an empty string and sets the error flag if there are no more values or if there is an error.

StrCpy $0 0
loop:
  ClearErrors
  EnumRegValue $1 HKLM Software\Microsoft\Windows\CurrentVersion $0
  IfErrors done
  IntOp $0 $0 + 1
  ReadRegStr $2 HKLM Software\Microsoft\Windows\CurrentVersion $1
  MessageBox MB_YESNO|MB_ICONQUESTION "$1 = $2$\n$\nMore?" IDYES loop
done:

Command introduced with NSIS v1.50