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.
No comments:
Post a Comment