Change WIX Installer language at run

2019-02-20 15:26发布

问题:

Multi-Language MSI Packages without Setup.exe Launcher

Please help me to create multi language MSI package without Setup.exe by using wix.

I have created mst file for different languages and embedded it with EmbedTransform tool but it works only with command lint option like msiexec /i SampleMulti.msi TRANSFORMS=":fr-fr.mst". It was not working if I change language of my machine and install directly using msi.

I have followed below link from post but it also did not work how to create language transformation that will correctly change the ProductLanguage property in Wix.

It can also be fine if we can choose language from dropdown and installer language change according.

Please help me out.

回答1:

You can follow the directions as described on this site: Multi-Language MSI Packages without Setup.exe Launcher

Steps described shortly:

  • You create a basic MSI-package with English as default / fallback language
  • You create transforms for every other language you want to include
  • You embed those transforms within your MSI-package (so you basically just have one MSI-file)
  • You adjust the Summary Information Stream

The scripts used are taken from the Windows SDK. Using this method you start the MSI and based on the regional options (not the UI language) configured for your system, Windows Installer will present the installation in the related language (if a transform was included) or in English (if Windows Installer couldn't find any appropriate language transform).

Used it myself with 5 languages included and worked like a charm.



回答2:

Transforms must be applied when the MSI is launched, that's the bottom line. The language of the machine is also not relevant - if you have a separate exe to launch the MSI then the system language would be a useful default language, but there's nothing to stop anyone installing an English language MSI on a German language OS. And how can Windows know which transform files you have and automatically apply them during an install.

It's still true that if you want the user to select the language you need a launch program that adds the relevant transform in the MSI launch command line. Why is the separate exe a big issue?



回答3:

Please see my answer to is it possible to create a multilanguage installer using WIX? on how to create an auto-detecting MSI. (I'd post a comment but I don't have the privilege.)