WindowsInstaller.Installer
(1)
Wscript.CreateObject
(1)
MsiOpenDatabase
(1)
Database
(1)
Installer.OpenDatabase
(1)
Record.StringData
(1)
Database.OpenView
(1)
WiX
(1)

How to find the ProductCode of one installed app.msi

Asked By VP
19-Nov-09 03:43 AM
I developed one app.msi to intall one app. And I need to develop one
bootstraper.exe to retrieve the ProductCode of previously installed app
outside the MSI.

Some one suggested me to use MsiOpenDatabase/MsiViewExecute.

Could you please give me an example how to use it?

Here is some vbscript to show you how to use those objects:Untested but'll you

Sebastian Brand replied to VP
19-Nov-09 08:43 AM
Here is some vbscript to show you how to use those objects:

Untested but'll you get the idea:

Set installer =3D Wscript.CreateObject("WindowsInstaller.Installer")
Set database =3D installer.OpenDatabase("c:\path\toyour\msifile.msi", 0)
query =3D "SELECT 'Value' FROM Property WHERE Property=3D'ProductCode'"
Set view =3D database.OpenView(query)
view.Execute
Set record =3D view.Fetch
WScript "ProductCode is " & record.StringData(1)


Best regards,
Sebastian Brand

Deployment consultant
E-Mail: sebastian@instyler.com

Instyler Setup - Creating WiX-based MSI installations, elegantly.
http://www.instyler.com
Post Question To EggHeadCafe