How to get "Revision Number" from msi using .NET code?

I have a msi file. I want to get the version number of this file.

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

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

So please help me with this ...

+3
source share
2 answers

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

+1
source

What you need is called Package Code .

Here is an example of extracting using VBscript (unfortunately I am 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
+1
source

Source: https://habr.com/ru/post/1744513/


All Articles