Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

Setting Session.Property with a variable

Hopefully this just another dumb Session.Property question - couldn't find it answered anyway.

VBScript custom action in a Basic MSI project, running in Immediate mode.

I'd like to set a number of MSI properties using a loop, setting a different property in each iteration. I load an array with the property names that I want...

arrPropName(0) = "INST_ONE"
arrPropName(1) = "INST_TWO"

{and so forth}

then during the loop (For loop, indexed by numServ)

strPropName = arrPropName(numServ)
{and later}
Session.Property(strPropName) = strInstanceNames

I know from testing the VBS outside of the installer that strPropName is correct. So is strInstanceName. But setting the MSI property is just not working.

Can I not set Session.Property defined by a variable this way? Am I making some other obvious blunder or novice mistake??

Thanks for your eyes -
Labels (1)
0 Kudos
(1) Reply
Level 8

I think you need Session.Property("INST_ONE") = strInstanceNames
and not Session.Property(strPropName) = strInstanceNames.
0 Kudos