我正尝试通过GPO安装已安装在某些计算机上的程序的新版本。 目前,该策略是基于用户的,如果没有安装以前版本的程序,则工作正常。 如果安装了该程序的旧版本,则该策略什么也不做,但仍然认为是成功的。 旧版本的程序是在每台机器上手动安装的,所以我不能升级。
是否有一个简单的方法来更换或删除旧版本? 我想有另一个政策删除旧版本,但似乎有点马虎。
如果在“添加/删除程序”中列出了应用程序,则可以确定执行以前的msi命令来执行全新安装。 通常, HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall和特定的UninstallString类似MsiExec.exe / I {23170F69-40C1-2702-0920-000001000000}。
所以,你可以做一个GPO以前运行CMD执行该命令CON计算机启动,并推后新的应用程序。
这是用VBS重装我的Jabber的最后一个版本的一个例子:
On Error Resume Next DIM fso Dim version Set fso = CreateObject("Scripting.FileSystemObject") Set WshShell = WScript.CreateObject("WScript.Shell") x86=wshShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%")&"\Cisco Systems\Cisco Jabber\CiscoJabber.exe" x64=wshShell.ExpandEnvironmentStrings("%PROGRAMFILES%")&"\Cisco Systems\Cisco Jabber\CiscoJabber.exe" If (fso.FileExists(x86) or fso.FileExists(x64)) Then version= CreateObject("Scripting.FileSystemObject").GetFileVersion(x86) if (strcomp(version,"",1)=0) then version= CreateObject("Scripting.FileSystemObject").GetFileVersion(x64) 'Wscript.echo "x64" end if 'Wscript.Echo version & " en x86" if (strcomp(version,"11.5.1.29337",1)=0) then 'Wscript.Echo "Tiene la ultima version" else 'Wscript.Echo "Updating" WshShell.Run "msiexec.exe /I ""\\server\sharefolder\CiscoJabberSetup.msi"" /quiet" end if Else 'WScript.Echo("Install as new app") 'WshShell.Run "msiexec.exe /I ""\\server\sharefolder\CiscoJabberSetup.msi"" /quiet" End If WScript.Quit()