cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wilkinse
Level 3

Is it possible to use a custom action to set a property to a numeric value

I am using a property DEFAULT_PORT in my installer that I default to a specified integer value say 16315. I have a vbscript custom action that gets the session.property("DEFAULT_PORT") and then determines if in fact the port is open..if its not it upticks the value until an open port if found.

The problem I am having is when I need to store the new integer value in the property. (defaultPort is the open port we are going to set DEFAULT_PORT to)

This does not work: ( you do not see the value being set in the msi.log file)
Session.Property("DEFAULT_PORT") = defaultPort

This will work, but now when I display the value in a later dialog it has " " around the value. So "16317" is displayed instead of 16317
Session.Property("DEFAULT_PORT") = chr(34)& defaultPort &chr(34)

Is there some other way I can assign the new value to the property to use later in the install process?

Thanks,
Erik
Labels (1)
0 Kudos
(2) Replies
Domnitch
Level 2

Anyway a property is a string value. Convert you numeric value to string.

Dim defaultPort, s1, s2

defaultPort = 16317
s1 = CStr(defaultPort)
Session.Property("DEFAULT_PORT") = s1

s2 = Session.Property("DEFAULT_PORT")
MsgBox s2
0 Kudos
wilkinse
Level 3

Thanks for the reply.

I did find CStr() call worked to reset the value without adding quotes, so when I use it later in a Dialog is displays correctly.
0 Kudos