If all your applications have corresponding GUID keys in "KEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall", you can also do something like this:
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{GUID} >NUL 2>NUL || MSIEXEC.EXE /qb /L* "%LOGDIR%\myuninstaller.log" /x{GUID}
This will only start msiexec.exe if the key is present (and will be slightly more efficient than running msiexec.exe on non-existent GUIDs using / qn).
Flavio
source share