[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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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
Answered 08/04/2008 by: VBScab
Red Belt

Please log in to comment
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"]
Answered 08/04/2008 by: getIT
Orange Senior Belt

Please log in to comment
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.
Answered 08/04/2008 by: VBScab
Red Belt

Please log in to comment
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 .
Answered 08/04/2008 by: getIT
Orange Senior Belt

Please log in to comment
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
Answered 08/04/2008 by: matrixtushar
Purple Belt

Please log in to comment
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
Answered 08/04/2008 by: AngelD
Red Belt

Please log in to comment
0
[font="trebuchet ms"]Hi Kim,
[font="trebuchet ms"]Script is working. Exactly what i wanted.
[font="trebuchet ms"]Thanks.
Answered 08/04/2008 by: getIT
Orange Senior Belt

Please log in to comment
0
Glad it suited you!
Answered 08/05/2008 by: AngelD
Red Belt

Please log in to comment
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!
Answered 08/05/2008 by: VBScab
Red Belt

Please log in to comment
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!
Answered 08/05/2008 by: AngelD
Red Belt

Please log in to comment
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.
Answered 08/05/2008 by: getIT
Orange Senior Belt

Please log in to comment
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]
Answered 08/05/2008 by: AngelD
Red Belt

Please log in to comment
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.
Answered 08/05/2008 by: VBScab
Red Belt

Please log in to comment
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.
Answered 08/05/2008 by: PackageExpert
Blue Belt

Please log in to comment
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.
Answered 08/05/2008 by: getIT
Orange Senior Belt

Please log in to comment
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.
Answered 08/06/2008 by: VBScab
Red Belt

Please log in to comment
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!
Answered 08/06/2008 by: AngelD
Red Belt

Please log in to comment
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.
Answered 08/07/2008 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity