Using VBScript to Set Properties in MSI
Updated: 09 Sep 2008
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.