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
source
share