Update Static Text - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

matyicsapo
Posts: 7
Joined: Mon Sep 03, 2012 12:56 pm

Update Static Text

Hi,

I'm new here, but I've looked around and I couldn't find a topic about the following problem.

Our feature selection / customization dialog is a custom one - doesn't use neither of the Selection Tree controls. We build a single MSI, so the Enchanced UI is not an option. In the customization dialog we have a list of checkboxes for the features and when you click one several Static Text controls have to be updated to show the feature's description, current feature state etc., which as far as I know is not sg. officially supported as the UpdateMsiEditControls CA doesn't update Static Text elements.

I set a publised event with a condition of 1 which sets the AiRefreshDlg property to 1 on the checkboxes which worked wonders, except on Windows XP.
The text was not updating there properly regardless of the AiRefreshDlg property set, what happened that the previous text didn't disappear so the user ended up seeing letters falling into each other resulting in a big pile gibberish.

The workaround I used was to go to the Control Conditions tab of the Static Text control's events and added both a Show and a Hide action with a condition of 1.
I'm not sure whether this will eliminate all related bugs, but it seems like, so far :D

In any way I just wanted to share this, 'cause after spending almost an hour on this I thought someone else might be interested too.
Hopefully this was the right place for that.

Oh and also here are some related links (thanks to the AI guys for these)
http://www.advancedinstaller.com/user-g ... -text.html
http://www.advancedinstaller.com/user-g ... ialog.html

matyicsapo
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Update Static Text

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve this scenario you can take a look on our "Show a custom feature selection dialog" article. Also, here's attached a sample which implements your scenario.
sample.aip
(19.35 KiB) Downloaded 444 times
If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
yylee
Posts: 6
Joined: Tue Sep 11, 2012 7:26 pm

Re: Update Static Text

Hi I am new to the software also

I am trying to put a text field in the standard First Time Install->ProgressDlg and use a vbscript to update it. I followed the instruction given by the web site (e.g. Session.property(TEXT_1_PROP), AiRefreshDlg = 1) but still no luck.

Any ideas?

David
matyicsapo
Posts: 7
Joined: Mon Sep 03, 2012 12:56 pm

Re: Update Static Text

I can't really try it out at the moment, but it should work, though I never wrote much in VBS, nor did I fiddle the ProgressDlg.

I'm not even sure how you launch your Custom Action to call that VBS code you wrote, but if you are 100% sure that the script runs, check whether Static Text elements Property Name is really set to TEXT_1_PROP and set it's Text to [TEXT_1_PROP] (the brackets are important here).

If it still doesn't work I suggest you try adding 2 lines to the Static Text's Control Conditions, one with the action Show, and with the action Hide, both with a condition of 1, which as far as I have gathered, will result in the action being evaluated anytime "something happens". As I have said in my initial post too.

Good luck! :)
yylee
Posts: 6
Joined: Tue Sep 11, 2012 7:26 pm

Re: Update Static Text

thanks matyicsapo for the reply

I use Custom Actions->Launch Attached File to call up a VBS file. The VBS code works fine (e.g. I can install AD/LDS role and intall a ADAM instance with it). The only thing I like to do is to show some messages
on the dialog box to help me debug the code.

I enabled "Enhanced UI" and used Session.property("TEXT_1_PROP") = "My text" and Session.property("AiRefreshDlg") = cstr(1); text = [TEXT_1_PROP] as suggested but still not getting the result.

However I can read the default content off from Session.property("TEXT_1_PROP") and show it on a popup MsgBox().

any advice is appreciated.
matyicsapo
Posts: 7
Joined: Mon Sep 03, 2012 12:56 pm

Re: Update Static Text

I neither use Enchanced UI nor VBS, but you could try adding a CA right after calling your VBS code - in the custom action list there is a "Display error message" and a "Display message box". Then in the Message / Action Data field of the message prompt CA you could just enter [TEXT_1_PROP] .

However, you will probably have to add the message box CA without sequence, and call it manually from VBS code, or sg. like that. I'm not sure if that's possible. Otherwise they will just keep popping up like crazy in the progress dlg.

Also if setting the AiRefreshDlg property doesn't seem to do it's just you can try calling the "Update MSI Edit Controls CA".

Good luck and have fun!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Update Static Text

Hello David and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.
I use Custom Actions->Launch Attached File to call up a VBS file. The VBS code works fine (e.g. I can install AD/LDS role and intall a ADAM instance with it). The only thing I like to do is to show some messages
on the dialog box to help me debug the code.

I enabled "Enhanced UI" and used Session.property("TEXT_1_PROP") = "My text" and Session.property("AiRefreshDlg") = cstr(1); text = [TEXT_1_PROP] as suggested but still not getting the result."

However I can read the default content off from Session.property("TEXT_1_PROP") and show it on a popup MsgBox().
I'm afraid I don't fully understand your scenario. Can you please give us more details about your scenario (maybe exemplify)? Also, can you please attach a sample reproducing the behavior?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
yylee
Posts: 6
Joined: Tue Sep 11, 2012 7:26 pm

Re: Update Static Text

Hi Daniel

Here is what I am doing:

Session.Property("TEXT_1_PROP") = "My Message"
Session.Property("AiRefreshDlg") = cstr(1)
MsgBox(Session.Property("TEXT_1_PROP")) ' this shows "My Message" on screen, but the message didn't show up on the ProgressDlg form

The above is a part of the vbscript that I added via "Custom Actions" -> "Launched Attached File".

TEXT_1_PROP is a static text object that I added on the "First Time Install"->ProgressDlg. It's text is set to [TEXT_1_PROP], property name is TEXT_1_PROP, object name is just Text_1.

Enhanced UI is turned on, Media -> Package Type is set to "EXE setup with resources next to it"

btw, I am not using any button clicks to trigger the message. It is just that I want to show some more messages on the ProgressDlg screen as the script is running.

thanks
David
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Update Static Text

Hello David,
btw, I am not using any button clicks to trigger the message.
Please keep in mind that by design Windows Installer doesn't allow the User Interface behavior to be set based on action scheduled from "Install Execution Stage". So, if your custom actions is added as a custom action with sequence under "Install Execution Stage", then the related static text control will not be updated.
It is just that I want to show some more messages on the ProgressDlg screen as the script is running.
In order to achieve this select your custom action and press the [Action Text...] button from "Custom Actions Properties" right pane. In the "Edit Action Properties" dialog set the "Description" field with text which you want to be displayed in the progress dialog box. Also, please keep in mind that only deferred custom actions can set an Action Text.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
yylee
Posts: 6
Joined: Tue Sep 11, 2012 7:26 pm

Re: Update Static Text

Hi Daniel

The "Action Text..." button on my custom action properties is greyed out. Any ideas?

How would I update this Action Text with vbscript? any code samples?

thanks
David
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Update Static Text

Hello David,
The "Action Text..." button on my custom action properties is greyed out. Any ideas?
As I mentioned in my previous post only deferred custom actions can set an Action Text. So, in "Custom Actions" page you can schedule your custom action between "Install Execution Stage -> Preparing -> InstallInitialize" and "Install Execution Stage -> Finish Execution -> InstallFinalize" standard actions. Then, in the "Custom Action Properties" right pane you can enable for your custom action the "Deferred" or "Deferred with no impersonation" execution options.
How would I update this Action Text with vbscript? any code samples?
In order to obtain this you can take a look on our "Updating Action Text in a VBS Custom Action ..." thread.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
yylee
Posts: 6
Joined: Tue Sep 11, 2012 7:26 pm

Re: Update Static Text

Hi Daniel

Not trying to be a pain here. My custom action is between "Add Resources" and "Finish Execution", so I guess it is considered a deferred action. Just don't seem to be able to get "Action Text" enabled....
As I mentioned in my previous post only deferred custom actions can set an Action Text. So, in "Custom Actions" page you can schedule your custom action between "Install Execution Stage -> Preparing -> InstallInitialize" and "Install Execution Stage -> Finish Execution -> InstallFinalize" standard actions. Then, in the "Custom Action Properties" right pane you can enable for your custom action the
"Deferred" or "Deferred with no impersonation" execution options.
thanks
David
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Update Static Text

Hello David,

As I mentioned in my previous post, in order to enable the [Action Text...] button you should check the "Deferred" or "Deferred with no impersonation" option from "Execution Option" group. If you have enabled one of this execution options for your custom action and the [Action Text...] button is still disabled, can you please attach a sample reproducing the behavior so we can investigate it?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”