On Error Resume Next
'---------------------------------------------------------------------------------------------
' UNINSTALL operations
'---------------------------------------------------------------------------------------------
sUmbrellaMSI="{423C817E-14DE-46C4-B8EF-C4322D5C36F2}"
' sGinaMSI="{621CEF4F-D26A-4D3B-A3F1-727B4BD9F811}"
sDartMSI="{0FB3AC84-0C82-478F-BD1E-A2826FC8A9E0}"

sVPNPack="Core VPN package"
EmersonLog sApplicationName & " Version " & sApplicationVersion & " - " & sVPNPack & " Uninstall started."
sSetupLogFile = sLogPath & "\" & Replace(sPackageName & "_" & sPackageVersion & "-" & sVPNPack & ".log"," ","_")	
RC = WshShell.Run("msiexec /X" & sMSIProductCode & " REBOOT=ReallySuppress /qn /l* " & Chr(34) & sSetupLogFile & Chr(34),1,True)
 
ExitCode = RC
Select Case RC
   Case 0
      EmersonLog "Uninstall Finished succesfully RC=" & RC
   Case 3010
      EmersonLog "Uninstall Finished succesfully, but it requires a reboot, RC=" & RC
   Case 1605
      EmersonLog sPackageName & " Version " & sPackageVersion & " - " & sVPNPack & " Already uninstalled, RC=" & RC
   Case Else
      Err.Raise 2000, sPackageName & " " & sPackageVersion, "Error running setup, RC = " & RC
End Select
RuntimeErrLog


sVPNPack="Umbrella package"
EmersonLog sApplicationName & " Version " & sApplicationVersion & " - " & sVPNPack & " Uninstall started."
sSetupLogFile = sLogPath & "\" & Replace(sPackageName & "_" & sPackageVersion & "-" & sVPNPack & ".log"," ","_")	
RC2 = WshShell.Run("msiexec /X " & sUmbrellaMSI & " REBOOT=ReallySuppress /qn /l* " & Chr(34) & sSetupLogFile & Chr(34),1,True)
 
ExitCode = RC2
Select Case RC2
   Case 0
      EmersonLog "Uninstall Finished succesfully RC2=" & RC2
   Case 3010
      EmersonLog "Uninstall Finished succesfully, but it requires a reboot, RC2=" & RC2
   Case 1605
      EmersonLog sPackageName & " Version " & sPackageVersion & " - " & sVPNPack & " Already uninstalled, RC2=" & RC2
   Case Else
      Err.Raise 2000, sPackageName & " " & sPackageVersion, "Error running setup, RC2= " & RC2
End Select
RuntimeErrLog

' sVPNPack="Gina package"
' EmersonLog sApplicationName & " Version " & sApplicationVersion & " - " & sVPNPack & " Uninstall started."
' sSetupLogFile = sLogPath & "\" & Replace(sPackageName & "_" & sPackageVersion & "-" & sVPNPack & ".log"," ","_")	
' RC3 = WshShell.Run("msiexec /X " & sGinaMSI & " REBOOT=ReallySuppress /qn /l* " & Chr(34) & sSetupLogFile & Chr(34),1,True)
 
' ExitCode = RC3
' Select Case RC3
   ' Case 0
      ' EmersonLog "Uninstall Finished succesfully RC3=" & RC3
   ' Case 3010
      ' EmersonLog "Uninstall Finished succesfully, but it requires a reboot, RC3=" & RC3
   ' Case 1605
      ' EmersonLog sPackageName & " Version " & sPackageVersion & " - " & sVPNPack & " Already uninstalled, RC3=" & RC3
   ' Case Else
      ' Err.Raise 2000, sPackageName & " " & sPackageVersion, "Error running setup, RC3= " & RC3
' End Select
' RuntimeErrLog

sVPNPack="DART package"
EmersonLog sApplicationName & " Version " & sApplicationVersion & " - " & sVPNPack & " Uninstall started."
sSetupLogFile = sLogPath & "\" & Replace(sPackageName & "_" & sPackageVersion & "-" & sVPNPack & ".log"," ","_")	
RC4 = WshShell.Run("msiexec /X " & sDartMSI & " REBOOT=ReallySuppress /qn /l* " & Chr(34) & sSetupLogFile & Chr(34),1,True)
 
ExitCode = RC3
Select Case RC3
   Case 0
      EmersonLog "Uninstall Finished succesfully RC3=" & RC3
   Case 3010
      EmersonLog "Uninstall Finished succesfully, but it requires a reboot, RC3=" & RC3
   Case 1605
      EmersonLog sPackageName & " Version " & sPackageVersion & " - " & sVPNPack & " Already uninstalled, RC3=" & RC3
   Case Else
      Err.Raise 2000, sPackageName & " " & sPackageVersion, "Error running setup, RC3= " & RC3
End Select
RuntimeErrLog

EmersonLog sApplicationName & " Version " & sApplicationVersion & " Uninstall ended, RC, RC2, RC3, RC4 = " & RC & "," & RC2 & "," & RC3 & "," & RC4
