简体   繁体   中英

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 any 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM