Is it possible to change the language code of WiX depending on what language the OS is in?
I already know about the UserLanguageID and SystemLanguageID properties, but is there a开发者_StackOverflow中文版ny way I could put this number into the language attribute of the Product tag?
I'm probably either doing something very wrong, or it can't be done.
Thanks
UserLanguageID and SystemLanguageID are runtime properties, ie they don't exist until the MSI actually runs. The product's language code, on the other hand, is determined when the MSI is generated by the Wix toolset. AFAIK there's no way to change it dynamically.
Short answer: it can't be done.
You're not very clear about what it is you're trying to do... however I use something like the following. Don't know if this will help?
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" Codepage="1252" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="Language">en-US</String>
<!-- .... -->
</WixLocalization>
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
UpgradeCode="$(var.Property_UpgradeCode)"
Name="!(loc.ApplicationName)"
Language="!(loc.Property_ProductLanguage)"
Version="$(var.version)"
Manufacturer="!(loc.ManufacturerName)" >
<!-- .... -->
</Product>
</Wix>
精彩评论