Access Features in VB script

Need help authoring your installer? Ask the community for tips and advice.

Access Features in VB script

Postby umaunni » Wed Jul 11, 2012 3:39 pm

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
umaunni
 
Posts: 3
Joined: Wed Jul 11, 2012 3:31 pm

Re: Access Features in VB script

Postby Bogdan » Fri Jul 13, 2012 2:36 pm

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
http://www.advancedinstaller.com/
Bogdan
 
Posts: 2398
Joined: Tue Jul 07, 2009 7:34 am

Re: Access Features in VB script

Postby umaunni » Mon Jul 16, 2012 7:13 am

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
umaunni
 
Posts: 3
Joined: Wed Jul 11, 2012 3:31 pm

Re: Access Features in VB script

Postby Daniel » Mon Jul 16, 2012 12:27 pm

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
http://www.advancedinstaller.com/
Daniel
 
Posts: 2006
Joined: Mon Apr 02, 2012 1:11 pm

Re: Access Features in VB script

Postby umaunni » Wed Jul 18, 2012 5:51 am

hi,

Thanks for your reply. It's really worked.. thanks a lot .. :D
umaunni
 
Posts: 3
Joined: Wed Jul 11, 2012 3:31 pm


Return to Building Installers

Who is online

Users browsing this forum: No registered users and 0 guests