eandersen
Posts: 12
Joined: Fri Nov 28, 2008 7:24 am

Sesion.Property in VB script

Under InstallExecuteSequence->Install I have created a VB script custom action. Execution Options is Deferred. Action Data contains [#AutoExec.Sas], which is a reference to one of the file names being installed. During the execution of the VB script I can get the name of the file by doing:

MsgBox "[CustomActionData]="+Session.Property("CustomActionData")

this works as expected, but when I use System.Property against any other properties I get a blank result, like this:

MsgBox "[APPDIR]="+Session.Property("APPDIR")

Can anybody tell me whats wrong?

I have tried changing Execution Options to Immediate, then Session.Properties are okay, but the files (which I'm trying to modify) has not been installed into the target location.
PS! I have other custom actions defined under"UI Custom Action" and here I can get the contents of the other properties.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Sesion.Property in VB script

Hello and welcome to the Advanced Installer Forums,

Actually only immediate custom actions have direct access to public properties. The purpose of the "CustomActionData" property is to aid you if you need to get or set a public property from within a deferred custom action.
I have tried changing Execution Options to Immediate, then Session.Properties are okay, but the files (which I'm trying to modify) has not been installed into the target location.
This is the expected behavior because an immediate custom action is executed in the phase when the installation script is created and no modifications are yet brought to the target machine.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
eandersen
Posts: 12
Joined: Fri Nov 28, 2008 7:24 am

Re: Sesion.Property in VB script

Is there another way to modify the installed files? I need to change references in some files to reflect location of the installed folders. The files to be modified is not XML nor INI files, but plain text files.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Sesion.Property in VB script

Hello,

The solution you are looking for is described in this how to from our user guide.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”