/build/static/layout/Breadcrumb_cap_w.png

Way to find patch installed?

[font="trebuchet ms"]Hi,
[font="trebuchet ms"]
[font="trebuchet ms"]I would required to find whether the patch is installed for a particular application.
[font="trebuchet ms"]I want to execute a script from a batch file based on the whether the patch is installed. Apart from ARP entry, is there a way to find the installed patch for an appl. programatically.
[font="trebuchet ms"]
[font="trebuchet ms"]Thanks

0 Comments   [ + ] Show comments

Answers (19)

Posted by: anonymous_9363 16 years ago
Red Belt
0
Hastily cobbled together from a sample I d/l (sorry, I can't recall the source):

Const msiInstallContextUserManaged = 1 '// products that are under the managed context (deployed by GP)
Const msiInstallContextUserUnManaged = 2 '// products that are under the unmanaged context.
Const msiInstallContextMachine = 4 '// products that are under the machine account.

Dim strPatchCode
Dim strProductCode
Dim objPatch

strPatchCode = "{0DD140D3-9563-481E-AA75-BA457CBDAEF2}"
strProductCode = "{ADA0463D-8D47-4A3A-ADA7-B17B6209C295}"

Set objPatch = Installer.Patch(strPatchCode, strProductCode, "", msiInstallContextMachine)
MsgBox objPatch.State
Check out MSDN, anyway http://msdn.microsoft.com/en-us/library/aa370594(VS.85).aspx
Posted by: getIT 16 years ago
Orange Senior Belt
0
[font="trebuchet ms"]Ian,
[font="trebuchet ms"]
[font="trebuchet ms"]I tried executing the VbS, but throws an exception on 'Installer.Patch' object could not be found.
[font="trebuchet ms"]Is there any registry updated from a small or minor patch in general??
[font="trebuchet ms"]
[font="trebuchet ms"]Thanks.
[font="trebuchet ms"]
Posted by: anonymous_9363 16 years ago
Red Belt
0
Well, I *did* say it was thrown together!

You *could* test all of this guff using bare registry entries but then you'd need to get into unpacking packed GUIDs, matching ProductCodes versus patches and so on. Not for the faint-hearted

I'm guessing that the error occurs because the patch with PatchCode 'strPatchCode' hasn't been applied to the product with ProductCode 'strProductCode'. You did substitute your own codes in there, didn't you? I figure if you look up 'PatchInfo' on MSDN, there might be a list of returned codes against which you could error-trap.
Posted by: getIT 16 years ago
Orange Senior Belt
0
[font="trebuchet ms"]Iam,
[font="trebuchet ms"]
[font="trebuchet ms"]I did test the script after applying the patch and making necessary modifications. I will have a look at MSDN and try getting it working.
[font="trebuchet ms"]
[font="trebuchet ms"]Kim,
[font="trebuchet ms"]I hope the link u sent would be really useful. I will try as per that and let you know.
[font="trebuchet ms"]
[font="trebuchet ms"]Thanks .
Posted by: matrixtushar 16 years ago
Purple Belt
0
Patch is a windows installer object, and therefore, the code will run if embedded inside an MSI or called as a custom action from the installation. Similar to other objects, the patch object also will throw an error if run directly through WScript or CScript engines.

Try embedding the code inside the MSI as a custom action and it surely will work.

regards,
tushar
Posted by: AngelD 16 years ago
Red Belt
0
How about:

Dim ProductCode : ProductCode = "{90120000-0020-0409-0000-0000000FF1CE}"
Dim PatchCode : PatchCode = "{026C2636-B788-409C-B178-A7603289EC2A}"

Dim Installer : Set Installer = Nothing
Set Installer = CreateObject("WindowsInstaller.Installer")
Dim IsPatchInstalled : IsPatchInstalled = False

Dim PatchList : Set PatchList = Nothing
Set PatchList = Installer.Patches(ProductCode)

If PatchList.Count >= 1 Then
For index = 0 To PatchList.Count-1
If PatchList.Item(index) = PatchCode Then IsPatchInstalled = True
Next
End If

If IsPatchInstalled = False Then
WScript.Echo "Product: " & ProductCode & vbNewLine _
& "Patch has not been applied for this product"
End If

Set Session = Nothing
Set Installer = Nothing
Posted by: getIT 16 years ago
Orange Senior Belt
0
[font="trebuchet ms"]Hi Kim,
[font="trebuchet ms"]Script is working. Exactly what i wanted.
[font="trebuchet ms"]Thanks.
Posted by: AngelD 16 years ago
Red Belt
0
Glad it suited you!
Posted by: anonymous_9363 16 years ago
Red Belt
0
LOL...I left out a *WHOLE* bunch of stuff, didn't I? :) Ah well, my excuse is I didn't have time to test it, as I'm *still* fighting with getting InstallShield to capture Fidessa Latent Zero's Sentinel client. What a pig of an app!
Posted by: AngelD 16 years ago
Red Belt
0
hehe

Well, I would also have used Installer.Patch and the State property if I wasn't to lazy with some error handling due to patch (PatchCode) wasn't installed. But that would be the same if the package (ProductCode) wasn't installed either from my posted script.

Cheers Ian!
Posted by: getIT 16 years ago
Orange Senior Belt
0
[font="trebuchet ms"]Ian,
[font="trebuchet ms"]
[font="trebuchet ms"]I hope, if i had worked on ur code also (to get rid of the error i got when running the VBS file), it would have helped me. Since i was in lack of time, i couldn't.
[font="trebuchet ms"]
[font="trebuchet ms"]Anyway Thanks Ian and Kim.
Posted by: AngelD 16 years ago
Red Belt
0
ORIGINAL: VBScab

I'm *still* fighting with getting InstallShield to capture Fidessa Latent Zero's Sentinel client. What a pig of an app!

InstallShield? Judas [:D]
Posted by: anonymous_9363 16 years ago
Red Belt
0
ORIGINAL: AngelD
InstallShield? Judas [:D]
Had to, no choice. Not for the first time WPS's SetupCapture bombed in spectacular style on an app which writes lots and lots of registry stuff. I posted a bug report, of course, but I shall be in my box before Altiris get round to fixing it. Let's be honest, they're still working through bugs reported for 5.6...or ignoring them.

Needless to say, IS brought with it its own 'challenges', not the least of which being how much T I M E it spent building the MSI. You may have thought WPS was pedestrian? IS 2008 is in a different league. All right, I already said that this app was a clunker but 2.5 H O U R S to go from project state to MSI? And this was with JUST the VM running - I closed down EVERYTHING ELSE on the host. Yawnsville, Arizona. Still, it got the job done, where SetupCapture failed so...swings and roundabouts, I suppose.
Posted by: PackageExpert 16 years ago
Blue Belt
0
usually patches will install greater file versions. For example if original installation has a file with version 2.0.1112.8971, the patch may upgrade it to 2.1.0000.4500, and hence you may create a VBS or batch file to locate the file, and if found that means the patch is installed.
Posted by: getIT 16 years ago
Orange Senior Belt
0
[font="trebuchet ms"]Thanks Harj.
[font="trebuchet ms"]I am aware of this file upgrades. I thought of fnding the installed patch in a generic way rather than from files getting installed, as my patch installs very few files conditionally.
Posted by: anonymous_9363 16 years ago
Red Belt
0
ORIGINAL: harjind
usually patches will install greater file versions. <snip> and if found that means the patch is installed.
Hmmm...nice try but not a good idea, really, because it's not inconceivable that the file could have been replaced by some other process e.g. by installing the package which natively installs v2.1.0000.4500. It doesn't guarantee that the patch was applied.
Posted by: AngelD 16 years ago
Red Belt
0
ORIGINAL: VBScab

ORIGINAL: AngelD
InstallShield? Judas [:D]
Had to, no choice. Not for the first time WPS's SetupCapture bombed in spectacular style on an app which writes lots and lots of registry stuff. I posted a bug report, of course, but I shall be in my box before Altiris get round to fixing it. Let's be honest, they're still working through bugs reported for 5.6...or ignoring them.

Needless to say, IS brought with it its own 'challenges', not the least of which being how much T I M E it spent building the MSI. You may have thought WPS was pedestrian? IS 2008 is in a different league. All right, I already said that this app was a clunker but 2.5 H O U R S to go from project state to MSI? And this was with JUST the VM running - I closed down EVERYTHING ELSE on the host. Yawnsville, Arizona. Still, it got the job done, where SetupCapture failed so...swings and roundabouts, I suppose.

No need to add some defense Ian as I already know your "Wise history".
I was just pulling your leg [:D]

Cheers!
Posted by: anonymous_9363 16 years ago
Red Belt
0
ORIGINAL: AngelD
No need to add some defense Ian as I already know your "Wise history".
I was just pulling your leg [:D]
I knew that, don't worry. I just thought I'd give folks some background and a heads-up that sometimes, even supposedly mature tools can prove to be next to useless.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ