code:
StrCmp $1 "" 0 loop
This would be much easier with the LogicLib:
code:
!include LogicLib.nsh
#...
StrCpy $2 0
${Do}
ClearErrors
EnumRegKey $1 HKLM SOFTWARE\Microsoft\.NETFramework $2
${If} ${Errors}
${Break}
${EndIf}
${If} $1 == "v2.0.50727"
MessageBox MB_OK found
${Break}
${EndIf}
IntOp $2 $2 + 1
${LoopWhile} $1 != ""
Or even better:
http://nsis.sourceforge.net/Get_.NET_Version