Using VBScript to Set Properties in MSI
Updated: 09 Sep 2008 | 1 comment
We can easily use Set Property Custom Action to set Windows Installer Property, but sometimes we wish to set the property directly in VbScript, specially if we are taking an input from a user through VBScript. Hope this tip helps.
To set property through VBScript we can use "Session" object like:
Session.Property("ALLUSERS")="1"
or we can directly use Property keyword like:
Property("REBOOT")="ReallySuppress"
The only catch here is that we cannot set INSTALLDIR property through the above method as the package uses Directory table to store the value of INSTALLDIR. We need to write the below VBScript to set INSTALLDIR:
dim instpath
instpath = "C:\newpath\newfolder"
Session.TargetPath("INSTALLDIR")=instpath
Remember to place this Custom Action after CostFinalize if you are changing the value of INSTALLDIR property in UI Sequence.
blog entry Filed Under:

The Endpoint Management Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the Endpoint Management community. Any authenticated Connect member can contribute to this blog.
Comments
It is sufficient to set
It is sufficient to set REBOOT = R instead of ReallySuppress as windows installer only checks the first letter. This can be useful if you are using an embedded VBScript custom action and wish to remain within the 256 character schema limit. (Fortunately not yet enforced by Microsoft).
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Would you like to reply?
Login or Register to post your comment.