REM Script for remote uninstallation of the Vector Asset 
REM Management Client using the Vector Software Distribution agent.
REM
REM ** This script requires the following files to exist in the same folder **
REM 	closeapp.exe 
REM 	vnltvc8324d.dll 
REM	SETUP.EXE
REM
REM v5.60
REM
REM Copyright (c) Vector Networks Technologies Limited. All Rights Reserved.
REM


REM ------------------------------------------------------------------------
REM ---------------------------------CHECK----------------------------------
REM Check if the parameter DO is passed or not. 
REM It should not be passed on the first time the batch file is called 
REM and usually it is only this batch file who calls it with the DO parameter.

if not "%1"=="DO" goto VNCALLDO
if "%1"=="DO" goto VNEXECUTE


:VNCALLDO

REM ------------------------------------------------------------------------
REM ---------------------------------CALL DO--------------------------------
REM If DO was not passed, then call this same script but in a separate 
REM process so that the Software Distribution agent that is monitoring the
REM first process (batch fike) can terminate.

start /B "Remote Uninstall" "%~dp0\VAMUninstall.bat" DO



REM ------------------------------------------------------------------------
REM Nothing else to do in this mode.
goto VNDONE



:VNEXECUTE

REM ------------------------------------------------------------------------
REM ------------------------ CLOSE ALL CLIENT PROGRAMS ---------------------

REM Stop the Software Distribution Agent

net stop "LANutil32 Distribution Agent"

REM Stop the Software Metering Agent

net stop "LANutil32 Software Metering Agent"
net stop "Vector Asset Management Agent"


REM Stop the Software Metering User application
"%~dp0\closeapp.exe" class=CLMETER


REM ------------------------------------------------------------------------
REM -------------------------- UNINSTALL PREVIOUS VERSIONS -----------------


REM Uninstall the VAM Client 5.0 silently

msiexec /x {8E76EB16-E277-44A1-A5E9-7D83CAC099FF} /qn REBOOT=R

REM Uninstall the VAM Client 5.5 silently

msiexec /x {41DFC812-B596-408D-8AA1-1E106F137CE3} /qn REBOOT=R

REM Uninstall the VAM Client 5.6 silently

msiexec /x {E0B1485D-6ACB-4DC2-BFA4-2F1ED5E6F993} /qn REBOOT=R

REM Uninstall the VAM Client 5.7 silently

msiexec /x {A40A237D-C090-4C05-8580-9DBECFE3602B} /qn REBOOT=R

REM Uninstall the VAM Client 5.8 silently

msiexec /x {B80B4DC6-0A49-442B-9393-3A0387B6D77C} /qn REBOOT=R

REM uninstall the VAM Client 5.8 silently (a)

msiexec /x {4229B10A-6565-4084-A658-68A4ED0F1D98} /qn REBOOT=R

REM uninstall the VAM Client 5.8 silently (b)

msiexec /x {9892177B-2489-4858-BEBE-E09F1FCD7C04} /qn REBOOT=R

REM Uninstall the VAM Client 6.0 silently

msiexec /x {D455E588-61BE-4C71-9DBA-538A7B8EBA70} /qn REBOOT=R



REM ---------------------------------EXIT----------------------------------
Exit
:VNDONE


