views:

86

answers:

2

Hi,

I have a msi file. I want to get the Revision Number of this file.

I can get it by properties->summary ({690D33BD-602F-4E71-9CB5-1CF2E9593DEE})

But I want to get this number using .net code.

So can u please help me out in this...

+1  A: 

You can probably figure out your answer from @sasha's answer to this similar question.

rschuler
Thanks, that saved me digging up my own answer ;)
sascha
A: 

What you're after is called the Package Code.

Here's an example to retrieve using VBscript (unfortunately I'm not familiar with .NET):

Dim installer, database

Set installer = CreateObject("WindowsInstaller.Installer")
Set database = installer.OpenDatabase ("my.msi", 0)

Dim sumInfo  : Set sumInfo = installer.SummaryInformation("my.msi", 0)
sPackageCode =  sumInfo.Property(9) ' PID_REVNUMBER = 9, contains the package code.

WScript.Echo sPackageCode
sascha
Thanks sascha :)
Sunil Agarwal