Well you have
$rc=SetOption('NoVarsInStrings','On')
 
and you clearly have a var in a string for $KeyName

Maybe this would be better
 
$Application = ReadValue("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\"+$KeyName, "DisplayName")