Hey Rocket Man,
Thanks for the reply.
Still no luck.
This is the VBS script that I was left with that doesnt work. It installs the new software but I dont think it does it in the right order so it doesnt work.
- Install new version
- Uninstall old version
- Add reg settings
-----------------
Option Explicit Dim ObjShell, ReturnVal, ExistingVersion, ProductCode, objWMIService, objProcess, colProcess, ProcessesFound, temp, x, ProductNameTemp Set ObjShell = CreateObject("WScript.Shell") KillProcess("outlook.exe") install x= 0 Dim ProductName(0) ProductName(0) = "Crestron RoomView Outlook Addin" KillProcess("outlook.exe") 'Set ObjShell = CreateObject("WScript.Shell") For x=0 To UBound(ProductName) ProductNameTemp = ProductName(x) If Uninstall(GetProductCode(ProductNameTemp,32),ProductNameTemp,32) = "" Then If Uninstall(GetProductCode(ProductNameTemp,64),ProductNameTemp,64) = "" Then 'Error End If End if Next wscript.quit(ReturnVal) Function Uninstall(ProductCode, ProductName, Regtype) On Error Resume Next Dim ExistingVersion If ProductCode <> "" Then ObjShell.LogEvent 4, "Found " & ProductName & " - " & ProductCode & " in " & Regtype & "-Bit" ReturnVal = ObjShell.run ("Msiexec.exe /x " & ProductCode & " /qn reboot=reallysuppress /lve " & Chr(34) & "C:\Program Files\GPT\logging\Uninstall -" & ProductName & ".log" & Chr(34), 1, True) If Not (ReturnVal = 0 Or ReturnVal = 3010) then LogError("Could not Uninstall " & ProductName & "!") Uninstall = ReturnVal Else ObjShell.LogEvent 4, "No product code supplied for product: " & ProductName & " - in " & RegType & "bit , no search will be done" End If End Function Function GetProductCode(strName,Regtype) Dim oCtx, oLocator, oReg, oInParams, oOutParams, arrValueNames, strValue, key, i, newkey Const HKEY_LOCAL_MACHINE = &H80000002 Set oCtx = CreateObject("WbemScripting.SWbemNamedValueSet") oCtx.Add "__ProviderArchitecture", Regtype Set oLocator = CreateObject("Wbemscripting.SWbemLocator") Set oReg = oLocator.ConnectServer("", "root\default", "", "", , , , oCtx).Get("StdRegProv") Key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" oReg.EnumKey HKEY_LOCAL_MACHINE, Key, arrValueNames For I=0 To UBound(arrValueNames) newkey = key & "\" & arrValueNames(I) oReg.GetStringValue HKEY_LOCAL_MACHINE,newkey,"DisplayName",strValue Dim temp1 temp1 = InStr(LCase(strValue), LCase(strName)) If InStr(LCase(strValue), LCase(strName)) > 0 Then If InStr(LCase(strValue), LCase(strName)) = 1 Then oReg.GetStringValue HKEY_LOCAL_MACHINE,newkey,"UninstallString",strValue If strValue <> "" Then GetProductCode = Replace(Replace(Replace(Replace(UCase(strValue), "MSIEXEC.EXE /X",""), "MSIEXEC.EXE /I",""), "MSIEXEC /X",""), "MSIEXEC /I","") ObjShell.LogEvent 4, "Uninstall String Found: " & GetProductCode End If End If End If Next End Function Function LogError (Message) ObjShell.LogEvent 1, "Installation Error: " & Message & " MSI Return Code: " & ReturnVal WScript.Quit ReturnVal End Function Function install ReturnVal = ObjShell.run ("msiexec /I ""OutlookAddinSetup.msi"" /qn /lve ""C:\Program Files\GPT\logging\RoomViewFusion.log""", 0, True) If Not (ReturnVal = 0 Or ReturnVal = 3010) then LogError("RoomViewFusion! ReturnCode:" & ReturnVal) 'ReturnVal = ObjShell.run ("regedit /s settings.reg", 0, True) 'If Not (ReturnVal = 0 Or ReturnVal = 3010) then LogError("RoomViewFusion! ReturnCode:" & ReturnVal) End Function Function KillProcess(strProcess) Dim Process, strObject, objProcess, IsProcessRunning, strComputer IsProcessRunning = False strComputer = "." For Each Process in GetObject( strObject ).InstancesOf( "win32_process" ) If UCase( Process.name ) = UCase( strProcess ) Then IsProcessRunning = True Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = '" & strProcess & "'" ) For Each objProcess in colProcess objProcess.Terminate() Next Exit For else End If Next End Function Function installShield Dim strComputer, objReg, objWMIService, colItems, objItem, i, arrFind, strKeyPath, strEntryName, strValue Const HKEY_CLASSES_ROOT = &H80000000 'On Error Resume Next Set objShell = CreateObject("WScript.Shell") strComputer = "." Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_DCOMApplicationSetting",,48) For Each objItem in colItems If objItem.Description <> "" Then arrFind=Split(objItem.Description) For i=0 To UBound(arrFind) If lcase(arrFind(i))="installshield" Then strKeyPath = "AppID\" & objItem.AppID strEntryName = "RunAs" strValue = "" objReg.DeleteValue HKEY_CLASSES_ROOT,strKeyPath,strEntryName End If Next End If Next End Function