tolo1984
Posts: 34
Joined: Tue Jul 26, 2011 9:47 am

can't access property from vbscript

we execute a custom action based on a vbscript.

We need to access a property that is an identifier from a folder created on 'Files and Folders' menu.
( Edit Folder dialog --> Identifier --> BTIDB_IMAGEDATAFOLDER )


Other two properties are defined on 'Install Parameters-Properties'

USERNAME_BY_SID,
BTIDB_SHAREDFOLDERNAME

this lines at the beginning of the script, doesn't work,

Code: Select all


folder = Session.Property("BTIDB_IMAGEDATAFOLDER")
username = Session.Property("USERNAME_BY_SID")
sharedName = Session.Property("BTIDB_SHAREDFOLDERNAME")
...
...
and the variables are NOT populated.

Although those properties for sure have got a value before this custom action is executed.

The custom action is scheduled after 'Start Services' in 'InstallExecuteSequence'

And, NO.
We can't use 'Inmediate Execution' option. WE need the files already installed.

Any solution?
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: can't access property from vbscript

Windows Installer states that no public property can be accessed from deferred custom actions, this is the reason why your variables don't get populated with the properties values.

From a deferred custom action you can only read the value of the special property "CustomActionData". So what you need to do is to have the three properties added in "Action Data" field of your custom action like this:

Code: Select all

[BTIDB_IMAGEDATAFOLDER] | [USERNAME_BY_SID] | [BTIDB_SHAREDFOLDERNAME]
When you read the property CustomActionData, it will contain the value for all three properties, all you need to do is to parse it in order to get the values in separate variables. As you can easily see the separator is '|'.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
tolo1984
Posts: 34
Joined: Tue Jul 26, 2011 9:47 am

Re: can't access property from vbscript

Thank you very much Bogdan.
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: can't access property from vbscript

Always a pleasure.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”