Set Text Style through Custom Action

Having trouble running Advanced Installer? Got a bug to report? Post it all here.

Set Text Style through Custom Action

Postby pay928 » Tue May 01, 2012 11:13 pm

Hello,

I have AI 7.1.3 and I want to develop a custom action to choose the text style of a text control. I have created the text style so it is selectable in the dropdown for the control within AI, but want to set status text onto the dialog based on what happens in the custom action and color the text as green/red. I wish to develop the custom action as a C++ dll. Any suggestions on the best way to accomplish this task?

Thanks for any help,
Pat
pay928
 
Posts: 25
Joined: Thu Dec 02, 2010 11:32 pm

Re: Set Text Style through Custom Action

Postby mihai.petcu » Wed May 02, 2012 1:30 pm

Hello Pat,

Can you please be very specific about the control you are trying to refresh depending on the custom action result? Attaching screenshots to mockup the desired functionality will help.

Also, how many possible states (colors) do you want a control to change to depending on the custom action result? Are there only two (red and green)?

All the best,
Mihai
Mihai Petcu
Advanced Installer Team
http://www.advancedinstaller.com/
mihai.petcu
 
Posts: 3452
Joined: Thu Aug 05, 2010 8:01 am

Re: Set Text Style through Custom Action

Postby pay928 » Wed May 02, 2012 5:22 pm

The control is a static control pulled from the Advanced Installer toolbox. I have attached a screenshot of the dialog with the text. I want the text to be green if they pass Minimum Requirements and red otherwise. For example, if memory is less than 4, it should be red. Otherwise it passes and is green.
Attachments
Installer ScreenShot.jpg
Installer ScreenShot.jpg (37.77 KiB) Viewed 451 times
pay928
 
Posts: 25
Joined: Thu Dec 02, 2010 11:32 pm

Re: Set Text Style through Custom Action

Postby mihai.petcu » Thu May 03, 2012 12:49 pm

Hello,

Here's a project developed with our latest version that demonstrates how to accomplish this:
test.zip
(3.16 KiB) Downloaded 35 times

Basically the easiest approach is to have the custom action that determines the color value execute on the "Next" button of the dialog before.
The above example uses our new feature called "Text-styles fallback".

All the best,
Mihai
Mihai Petcu
Advanced Installer Team
http://www.advancedinstaller.com/
mihai.petcu
 
Posts: 3452
Joined: Thu Aug 05, 2010 8:01 am

Re: Set Text Style through Custom Action

Postby pay928 » Thu May 03, 2012 5:29 pm

Are there any C++ dll examples that's compatible with older versions? Want to know if it's possible with version 7.1.3 using a C++ dll custom action.

Update: Looking at text style options. There is no fallback settings available in my text style. Seems like the only thing that would work is if I could change a text control's text style through a dll. Is that possible through a custom action or is the fallback option the only way?

Second Update: I am able to do this by adding 2 text controls. One with Green Pass and one with Red Fail, then clearing out 1 string by setting it to a property I set from Custom action. This is getting the job done, but if there is an easier way it'd be good to hear. Thanks.
pay928
 
Posts: 25
Joined: Thu Dec 02, 2010 11:32 pm

Re: Set Text Style through Custom Action

Postby mihai.petcu » Fri May 04, 2012 10:29 am

Are there any C++ dll examples that's compatible with older versions?

Here's our serial validation C++ .DLL user guide sample.
In a C++ .DLL you get and set installer properties by using the MsiGetProperty and MsiSetProperty functions

I am able to do this by adding 2 text controls.

Using control conditions like you did is the correct way to accomplish this with an older version.

All the best,
Mihai
Mihai Petcu
Advanced Installer Team
http://www.advancedinstaller.com/
mihai.petcu
 
Posts: 3452
Joined: Thu Aug 05, 2010 8:01 am


Return to Common Problems

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests

cron