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?
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!
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).