Read a localization string from a CustomAction in wix
I have a localizated wix project, and some custom actions in c#. Those custom actions sets some properties with customer facing text, so i want to assing a localizated text to开发者_运维问答 those properties. Does any one know if i can read a localization string from a c# custom action?
Set a Property to the localized string, and then access that Property from your Custom Action. If your CA is deferred, then you will need to load the localized string into it's CustomActionData dictionary.
Based on @Bryan Batchelder's answer i was able to achieve this:
.wxl localization file:
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="IISRequired">This application requires IIS.</String>
</WixLocalization>
.wxs file:
<Property Id="TXT_IIS_REQUIRED" Value="!(loc.IISRequired)"></Property>
.cs Custom Action file:
string str = session["TXT_IIS_REQUIRED"];
精彩评论