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

Session.Property - What am I doing wrong?

I have created a property in the Property Manager called "REPLACE_SCHEDULER_CONFIG" with an initial value of 0 (Zero).

In a deferred custom action scheduled for After InstallInitialize I run the following function:


Function ReplaceConfig()
sConfigPath="e:\scheduler\system\config\scheduler.cfg"
sConfig = LCase(readFile(sConfigPath))

If Len(sConfig) > 0 then
If InStr(1, sConfig, "Scheduler Service 2.0") then
Session.Property("REPLACE_SCHEDULER_CONFIG") = 0
Else
Session.Property("REPLACE_SCHEDULER_CONFIG") = 1
End If
End if
ReplaceConfig = IDSUCCESS
End Function


What I am trying to do is set the value of "REPLACE_SCHEDULER_CONFIG" depending upon the what is in the current config file.

I have also tried unsuccesfully to read the value of

Session.Property("REPLACE_SCHEDULER_CONFIG")

in the deferred action. I have successfully read Session.ProductProperty("REPLACE_SCHEDULER_CONFIG") - but according to the documentation session.ProductProperty is read-only.

My goal is to use the value of REPLACE_SCHEDULER_CONFIG as a condition of putting a new configuration file on the users system.

Does anyone know what I am doing wrong - or how I could better accomplish this?
Labels (1)
0 Kudos
(2) Replies
Videstra
Level 7

As usual - after struggling for hours I post a question - and then figure it out. Harumph...
There appear to be numerous problems.

1. In order to access session.property I need Immediate Execution, not Deferred.
2. The value that I'm assigning to the session.property needs to be a string value: "1" not 1.

Now it appears to work.
0 Kudos
MSIYER
Level 8

Using Session.Property to fetch Property values in a Deferred CA will not work. Only a few Installer properties are available in the deferred mode.

You need to look into CustomActionData. This provides us with a method to access custom properties during deferred mode.
0 Kudos