njshaw2
Posts: 26
Joined: Fri Apr 19, 2013 10:36 am

Text file update based on property condition

Hi,

I want to do a text file update based on the language the user selected the installer to run in. How can I do this? I see that [ProductLanguage] is the selected installer language, but how do I do a text file update based on a property condition?

Thanks,
Nick.
njshaw2
Posts: 26
Joined: Fri Apr 19, 2013 10:36 am

Re: Text file update based on property condition

I've figured out a way of doing what I need for my scenario, but it's a bit of a roundabout way and doesn't involve a condition on the text file update. Thought I'd share for people:

1) Create user-defined property, "LANG_TXT", default to "eng" (for English);
2) Create without-sequence custom action to set that property value to "pol";
3) Add the custom action as an Init Event to the FolderDlg (for example - just has to be before the file copying happens), with the condition "ProductLanguage=1045";
4) Add a Text File Update replace operation to replace my desired setting with the property [LANG_TXT] which will contain "eng" for non-Polish installer language, and "pol" for Polish installer language.

Is there a better way of doing this? It's a very long-winded way!

Thanks.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Text file update based on property condition

Hi Nick,

The way you update your file is actually the right way. However, you can reduce the number of steps by creating a custom action with sequence at step 2) instead of one without sequence.

In this case you can place your custom action anywhere you want in the "Wizard Dialogs Stage" and set the "ProductLanguage=1045" condition for it. Then, you can skip step 3).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
njshaw2
Posts: 26
Joined: Fri Apr 19, 2013 10:36 am

Re: Text file update based on property condition

Thanks for the suggestion, that sounds like a better way of doing things.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Text file update based on property condition

My pleasure.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”