You may need to add some switches.. While Enumerating the uninstall key in the registry is fine, you may want to uninstall a program quietly..
Here is an example -
code:
IF KEYEXIST('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2DFE1608-BDCA-11D1-B7AE-00C04FB92F3D}')
RUN 'MsiExec.exe /qn /x{2DFE1608-BDCA-11D1-B7AE-00C04FB92F3D}'
$mailhost = 'smtp.company.com'
$recipient = 'admin@@company.com'
$sender = @userid+'@@company.com'
$mailLine = @ldrive+'Programs\blat.exe - -to $recipient -server $mailhost -subject "MS Project removed!!" '
$mailLine = $mailLine+'-body "MS Project has been removed for - @userid (@fullname)" -f $sender -q'
SHELL $mailLine
ENDIF
The following resource may be helpful for the MSIEXEC (.MSI) installer -
Command-Line Switches for the Microsoft Windows Installer Tool
Kent