thenefield
Posts: 68
Joined: Thu Dec 06, 2007 6:19 pm

Updating Action Text in a VBS Custom Action ...

Is there anyway to update a VBScript custom action's action text from the default "Generating script operations for action:"?

Is there any Session.Property method than can be used?

Best Regards,

Trey
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Re: Updating Action Text in a VBS Custom Action ...

Hi Trey,

For an In-Script Custom Action (Deferred, Rollback, Commit), you can specify the action text using the "Action Text" button from the Custom Actions page.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
thenefield
Posts: 68
Joined: Thu Dec 06, 2007 6:19 pm

Re: Updating Action Text in a VBS Custom Action ...

Thanks for the response.

I am actually referring to a custom action that is configured to execute immediately so that AI property values can be passed. In this configuration, the Action Text button is grayed out.
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Re: Updating Action Text in a VBS Custom Action ...

Hi Trey,

Sorry for the late reply.

For Immediate Custom Actions you can use the MsiProcessMessage function or the Session.Message method to send ActionStart and ActionData messages to the installer.

I have attached a sample project and VB Script Custom Action illustrating this approach. The code from this post is used to delay script execution so that the ActionStart and ActionData messages are visible during installation.

Some notes:

1. In the Custom Actions page, an Attached VB Script Custom Action has been added as Immediate under the Install node. You will find the code in the "action_text.vbs" file inside the archive.

2. In the Dialogs page, the ProgressDlg dialog contains a Static Text control named "ActionText" (at the right of the "Status:" Static Text control). Use the combobox from the Properties list at the right in order to select it.

3. In the bottom pane, "Subscribed Events" tab, you will notice that the "ActionText" control is subscribed to an ActionText Control Event, which sets the Text of the control whenever an ActionStart message is received.

4. I have also added another Static Text control under the progress bar named ActionData. This control is subscribed to an ActionData event (which will modify the text on the control whenever an ActionData message is received).

5. See the code for the "ActionStart" and "ActionData" functions inside the attached VBS file.

Hope this helps.

Regards,
Ionut
Attachments
ActionTextExample.zip
(60.45 KiB) Downloaded 1163 times
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
thenefield
Posts: 68
Joined: Thu Dec 06, 2007 6:19 pm

Re: Updating Action Text in a VBS Custom Action ...

Hi ionut,

Thanks so much for that reply. I can't believe I just now saw the response.

You guys are awsome!

I will give it a shot.

Thanks again!

Trey
thenefield
Posts: 68
Joined: Thu Dec 06, 2007 6:19 pm

Re: Updating Action Text in a VBS Custom Action ...

Hi Ionut,

I got it working perfectly! Thanks so much for the example.

I do have one additional question though.

Is there a way to only show the action data text box for certain custom actions? For instance, I noticed that additional info is now displayed for other processes such as copying files, adding registry settings, etc. Is there a way to enable the text box when I want its information visible and hide when not needed, preferably from within vbscript?

Thanks!

Trey
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Updating Action Text in a VBS Custom Action ...

Hi Trey,
Is there a way to only show the action data text box for certain custom actions? For instance, I noticed that additional info is now displayed for other processes such as copying files, adding registry settings, etc. Is there a way to enable the text box when I want its information visible and hide when not needed, preferably from within vbscript?
I'm afraid that this is not supported by Windows Installer or by Advanced Installer.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”