echo off

REM Ensure we are on the correct drive

%~d0

REM Ensure we are in the correct folder

@cd "%~dp0"

Installer.exe /Silent=True /Uninstall="PSCAD Free x64"

@if "%errorlevel%" == "0" goto NoErrorDisplay

echo Error code = %errorlevel%
goto AfterErrorDisplay

:NoErrorDisplay
echo Successfully uninstalled

:AfterErrorDisplay
@if "%errorlevel%" == "32511" goto UninstallFailed

goto end

:UninstallFailed
  echo Product may already be uninstalled. If not, then the uninstall failed
  goto exit

:end
echo .

:exit
echo Done...

pause
