3
votes

recently I'm working on creating a multilanguage wix msi package for my team. I searched the localization on Google and also on stackoverflow for quite some time and finally found something to follow:http://www.geektieguy.com/2010/03/13/create-a-multi-lingual-multi-language-msi-using-wix-and-custom-build-scripts/. Currently I just added 2 language support: english and simplified Chinese to check if this approach works for me. The main wxs front part is something like this:

<Product Id="B5CB3C6A-A8ED-4308-8ADE-17729FE1FB23" Name="MyProduct" Language="!(loc.LANG)" Codepage="UTF-8" Version="11.51.0027" Manufacturer="My Company" UpgradeCode="D42070C3-43CB-4E2B-9B96-2F8D84A6C8A8">
    <Package InstallerVersion="200" Compressed="yes" Languages="1033,2052" InstallPrivileges="elevated" InstallScope="perMachine" />

And for the Language attribute of the Product I'm getting value from the localization wxl file, I've 2 files now, one is en-US.wxl, another is zh-CN.wxl,

in en-US.wxl: 1033

in zh-CN.wxl 2052

I also set the corresponding codepage in 2 wxl files, setting en-US codepage to 1252 and zh-CN to 936.

After building the project in VS, I got 2 msi, one in en-US folder and another in zh-CN folder, and I use the following commands to create the multilanguage msi:

cscript WiLangId.vbs zh-CN\MyProduct.msi Product 2052

Msitrans.exe -g en-US\MyProduct.msi zh-CN\MyProduct.msi zh-CN.mst

cscript WiSubStg.vbs en-US\MyProduct.msi zh-CN.mst 2052

cscript WiSubStg.vbs en-US\MyProduct.msi

And performing the commands above in cmd, I copied the final msi onto a Chinese win7 system to try, the problem is after I double clicking the msi to install, the first UI dialog is still in English but shortly it became Chinese, I'm sorry that I couldn't post the screenshot here because stackoverflow requires 10 reputations to be able to post images, but the words on the first Dialog I saw is "Preparing to install...." and a button on the bottom right "Cancel" and then after 2-3 seconds the UI became Chinese. Did anyone come up with this problem before?

1
Is this an English system with Chinese support added? It might be that you are seeing a system message that is embedded in msiexec.exe or an associated language resource dll. Hence it is hard-coded into the language resources for the system itself, and has nothing to do with your package - or the language it contains.Stein Åsmul

1 Answers

0
votes

Windows System restore point is created by default (if enabled system-wide) at the start of a MSI install. This system restore point seems to occur before locale transform and cause the behavior you observed.

You can disable it by setting MSIFASTINSTALL property to 1 or any value that includes it (e.g. 5 if you also want to reduce the amount of progress messages)

<Property Hidden="yes" Id="MSIFASTINSTALL" Value="1" />

For example in your .wxs file:

<?xml version="1.0" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'>
  <Product Id="XXX" Name="XXX" Language='!(loc.LANG)' Codepage='0'
           Version="XXX" Manufacturer="XXX"
           UpgradeCode="XXX">

    <Product Id="B5CB3C6A-A8ED-4308-8ADE-17729FE1FB23" Name="MyProduct" Language="!(loc.LANG)" Codepage="UTF-8" Version="11.51.0027" Manufacturer="My Company" UpgradeCode="D42070C3-43CB-4E2B-9B96-2F8D84A6C8A8">
    <Package InstallerVersion="200" Compressed="yes" Languages="1033,2052" InstallPrivileges="elevated" InstallScope="perMachine" />

    <!-- Disable System Restore point creation for this MSI (faster installation) -->
    <Property Hidden="yes" Id="MSIFASTINSTALL" Value="1" />

    <!-- Rest of your setup ... -->
  </Product>
</Wix>

You can read about MSIFASTINSTALL on Microsoft Windows docs