umaunni
Posts: 15
Joined: Wed Jul 11, 2012 3:31 pm

Access Features in VB script

Hi All,
I'm new to the advanced installer. i have created an installer with some vb scripts(in insatllExecuteSequence in custom actions page) in which i'm accessing some public properties and features to manipulate the controls.
But when i select the Deferred With no impersontaion as Execute option in the Custom Actions page. I am unble to access the features by using Session.FeatureRequestState("feature1").
How to access the feature in vb scripts when the execution option selectes as deferred?



Thanks & Regards
UU
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Access Features in VB script

Hi and welcome to our forums,

I'm afraid Windows Installer limits access to properties/feature states during deferred custom action execution. You can use that method only for immediate custom actions.

From what I see you have the custom action running to control UI elements, so it should be running much earlier. Can you give us more details? Maybe I can suggest you a better approach.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
umaunni
Posts: 15
Joined: Wed Jul 11, 2012 3:31 pm

Re: Access Features in VB script

Bogdan wrote:Hi and welcome to our forums,

I'm afraid Windows Installer limits access to properties/feature states during deferred custom action execution. You can use that method only for immediate custom actions.

From what I see you have the custom action running to control UI elements, so it should be running much earlier. Can you give us more details? Maybe I can suggest you a better approach.

Regards,
Bogdan
hi bogdan,
Thanks for your replay.
My need is that i have to show the status of execution of vb script files on the Progress dialog(like sample1.vbs is executing..), so that i have added the action text. but the action text has enabled only when i select the Deferred option. so i have selected the deferred and get the properties in vb script by adding the properties as actiondata. Now the problem is that i need to get the execution state of the Feature named "feature1" i am unable to add it in the actiondata. How can i get the feature in the vb script. Or Is there any other way to achieve this?



Thanks in advance,
Tanya
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Access Features in VB script

Hello Tanya,
Now the problem is that i need to get the execution state of the Feature named "feature1" i am unable to add it in the actiondata. How can i get the feature in the vb script.

In order to achieve this you can set a property (i.e. MY_PROP) with a specific value (i.e. my_value) depending on the feature state. Then, you can pass the related property to your VBS custom action through "Action Data" field in the "Custom Action Properties" right pane.

Here's the steps to proceed:
- Go to "Custom Action" page and add a "Set installer property" custom action with sequence after "Install Execution Stage -> Remove Resources" like this:
  • Property: MY_PROP
    Formatted: my_value
    Condition: Your condition based on feature state
- Add the "MY_PROP" property in the "Action Data" field of your VBS custom action.
- Build and run your project.
Or Is there any other way to achieve this?
You can take a look on the "Updating Action Text in a VBS Custom Action ..." thread.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
umaunni
Posts: 15
Joined: Wed Jul 11, 2012 3:31 pm

Re: Access Features in VB script

hi,

Thanks for your reply. It's really worked.. thanks a lot .. :D

Return to “Building Installers”