diff --git a/Docs/src/registry.but b/Docs/src/registry.but index 0a9a0cf5..2489a300 100644 --- a/Docs/src/registry.but +++ b/Docs/src/registry.but @@ -60,12 +60,13 @@ Set user variable $x with the name of the 'index'th registry key in root_key\\Su \c 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 if there are no more values, and returns an empty string and sets the error flag if there is an error. +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. \c StrCpy $0 0 \c loop: +\c ClearErrors \c EnumRegValue $1 HKLM Software\Microsoft\Windows\CurrentVersion $0 -\c StrCmp $1 "" done +\c IfErrors done \c IntOp $0 $0 + 1 \c ReadRegStr $2 HKLM Software\Microsoft\Windows\CurrentVersion $1 \c MessageBox MB_YESNO|MB_ICONQUESTION "$1 = $2$\n$\nMore?" IDYES loop diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 2ec4706d..de710265 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -1223,7 +1223,11 @@ static int NSISCALL ExecuteEntry(entry *entry_) { DWORD d=NSIS_MAX_STRLEN-1; if (parm4) RegEnumKey(key,b,p,d); - else RegEnumValue(key,b,p,&d,NULL,NULL,NULL,NULL); + else if (RegEnumValue(key,b,p,&d,NULL,NULL,NULL,NULL)!=ERROR_SUCCESS) + { + exec_error++; + break; + } p[NSIS_MAX_STRLEN-1]=0; RegCloseKey(key); }