There are times where you have to deploy a Stand Alone update file as a pre-req for a Software Package, in order to “Link” the packages together using the dependency feature of the Application Model can be a challenge because now you have to find a detection method for the Update.
This is how I do my SCCM Detection Methods to verify if a HotFix is installed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
Option Explicit Dim strHotFixID : strHotFixID = "KB974405" 'Enter Hotfix to detect Dim objNetwork : Set objNetwork = CreateObject("WScript.Network") Dim strComputerName : strComputerName = objNetwork.ComputerName 'On error resume next Dim objWMIService : Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputerName & "\root\cimv2") Dim strQuery : strQuery = "SELECT * FROM Win32_QuickFixEngineering WHERE HotFixID = """ & strHotFixID & """ wscript.echo strQuery Dim colResults : Set colResults = objWMIService.ExecQuery (strQuery) Dim objItem : For Each objItem in colResults If objItem.HotFixID >= strHotFixID Then Wscript.Echo "HotFix Detected" Next |