Could you tell me how we can use the properties of msi in VBscript.

0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



I just posted a VBScript that displays all properties from an MSI file at http://www.itninja.com/blog/view/reading-an-msi-setup-with-vbscript

Answered 09/06/2013 by: bkelly
Red Belt

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



Example of usage:


Function TestScript()


ListBoxProperty  = Session.Property("LISTBOXPROPERTY")

VersionNT        = Session.Property("VersionNT")

Version9x        = Session.Property("Version9X")

Password         = Session.Property("PASSWORD")

NotePad          = Session.Property("NOTEPADEXE")


MsgBox ("List Box:  " & ListBoxProperty & vbCrlf _

& "VersionNT: " & VersionNT & vbCrlf _

& "Version9X: " & Version9x & vbCrlf _

& "Password:  " & Password & vbCrlf _

& "Notepad:   " & NotePad) 




End Function
Answered 09/06/2013 by: jaybee96
Red Belt

  • It looks like the session object is declared outside this function making this a bit incomplete as reference ;)
Please log in to comment

you can use properties by adding it to command line during creating a vbscript.

Answered 09/06/2013 by: Gary
Blue Belt

  • Hi Gary, Assume msi is already built. And based on some property values in msi, I would like to perform some task using vbscript. In this scenario how i can proceed.
Please log in to comment

Get the Platform SDK. In there (admittedly buried pretty deep) will be the Windows Installer SDK. In there, you'll find sample scripts for handling MSIs.

The tables, including the Property table, can be queried using standard SQL syntax.

Answered 09/06/2013 by: VBScab
Red Belt

Please log in to comment