@echo off

rem *********************************************************************************************************************
rem IBM InfoSphere Business Glossary Anywhere installation uses the Microsoft Windows Installer (Msiexec.exe). 
rem You can use this sample file as-is for a silent uninstallation, or you can add additional functionality to this script.
rem For example, you can add more error checking by using additional msiexec.exe error codes. 
rem *********************************************************************************************************************

echo Uninstalling IBM InfoSphere Business Glossary Anywhere...
start /wait msiexec.exe /x BGAInstaller.msi /quiet /l*e BGAInstall.log
rem Handling only "not installed" error here, but more errors can be handled this way. 
rem See the documentation for the Windows Installer (Msiexec.exe) from Microsoft for error codes.
if "%errorlevel%" == "0" goto OK
if "%errorlevel%" == "1605" goto notInstalled
rem All other errors will display this message.
echo There was an error during installation. Error code: %errorlevel%
goto err

:OK
echo Uninstalled successfully.
goto end

:notInstalled
echo IBM InfoSphere Business Glossary Anywhere is not installed for this user.
goto err

:err
echo See BGAInstall.log for full details.
goto end

:end