Name "temp" OutFile "temp.exe" Section "" Call checkForUninstall SectionEnd Function checkForUninstall ReadRegStr $R0 HKLM "SOFTWARE\legacy" "name" IfErrors done MessageBox MB_OK|MB_ICONINFORMATION "$R0 inside" Abort done: MessageBox MB_OK|MB_ICONINFORMATION "$R0 pass" FunctionEnd