Trying to make a multilingual installer – the process is working in general, but seems to be failing for localised files that are to be installed.
Each of the localised installers works fine as a standalone and installs the localised files like the eula.pdf.
I’m hoping that I’m just missing a flag on the transform generation step (or maybe using the wrong tool?)
Process being to start by having a bunch of installers 1 for each language.
To build each installer we are ‘lighting’ using -b "folder" and -loc "folder" option to specify each language which includes some alternate file content such as the licence.pdf.
The files to be localised have a common source name
<File Id='License.pdf' Name='eula.pdf' Source='License(EULA).pdf' KeyPath='yes'/>
<WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
Folders for example being
en-US/License(EULA).pdf
en-US/License.rtf
en-US/Product.wxl
fr-FR/License(EULA).pdf
fr-FR/License.rtf
fr-FR/Product.wxl
There are also some files such as binary.dll and binary.exe which are not localised and are the same for all msi – don’t expect to see them in MST.
Following the next step in the process is creating an MST diff between a base language (english) and each of the other languages. Using Windows\v7.1\Bin\MsiTran.exe from the Window SDK
The MST seem a bit small for the change in content.
Merging all the MST files into a single installer using the Windows\v7.1\Samples\sysmgmt\msi\scripts\wisubstg.vbs
Installing in a language other than english shows the whole installer UI including rtf version of the licence as being localised, but the eula.pdf on disk is always the base english.
Using the Ant-dotnet tasks to run the build (in case it makes a difference)
The msi build task
<wix mode="light" target="${outlocation}\${lang.folder}\my.msi" wixHome="${wixhome}">
<lightArg line="-b "${location}""/> <!-- provide the location of the signable binaries -->
<lightArg line="-b "${msiwixsource}\Localisation\${lang.folder}""/> <!-- provide the location of the localisation -->
<lightArg line="-sice:ICE57"/>
<lightArg line="-cultures:${lang.culture}"/>
<lightArg line="-loc "${msiwixsource}\Localisation\${lang.folder}\Product.wxl""/>
<lightArg line="-ext "${wixhome}\WixUtilExtension.dll""/>
<lightArg line="-ext "${wixhome}\WixUIExtension.dll""/>
<lightArg line="-ext "${wixhome}\WixFirewallExtension.dll""/>
<lightArg line="-ext "${wixhome}\WixNetFxExtension.dll""/>
<sources dir="${msiwixobjects}">
<include name="*.wixobj"/>
</sources>
<moresources dir="${msiwixsource}\Localisation\${lang.folder}">
<include name="*"/>
</moresources>
<moresources dir="${location}">
<include name="binary.dll,binary.exe"/>
</moresources>
</wix>
The transform task
<exec executable="${windowsSDKBin}">
<arg value="-g"/>
<arg value="${outlocation}\en-US\my.msi"/>
<arg value="${outlocation}\${lang.folder}\my.msi"/>
<arg value="${outlocation}\${lang.folder}\my.mst"/>
</exec>
The repack task
<exec executable="cscript">
<arg value="${windowsSDKMsi}"/>
<arg value="${outlocation}\my.msi"/>
<arg value="${outlocation}\${lang.folder}\my.mst"/>
<arg value="${lang.id}"/>
</exec>
Product/@Language=”!(loc.Lang)” specified in Product.wxl
for English base we listed all 1033,1028,1029,1031,1036,1040,1041,1043,1045,1046,2052,3082 for other languages just the specific such as 1036 for fr-FR
Ok, so after a couple of days of searching I found an article that describes the issue.
How To Localize the Setup GUI and Deliver Localized Files Using a MST.
The issue being that MST doesn’t include ‘_Streams’ table elements which is where the CAB files are stored.
You could go several ways from that –
1) make multiple file & component entries for the different languages with conditional inclusion based on language or culture
This means changing your wxs if you want to change which languages are supported.
Which in turn means recompiling instead of just relinking the wxl. You still need to repack the mst files.
2) manually adjust the localised MSI
As per the How To Localize the Setup GUI and Deliver Localized Files Using a MST.
3) automated split the localised items into a seperate CAB with a localised name
Rather than recompile this is then relinking and extra process for managing the CAB files.
Extra process to –
* extract the CAB file(s) along with generating the mst,
* then when merging the mst also add the cab files.
Add an extra media which has a localised name – I’m using the lang id as it is convenient
Change the localised files/components to come from the new media
When generating the transforms using
MSITran.exealso export the localised CAB files usingMsiDb.ExeWhen merging the transforms into the base MSI using
WiSubStg.vbsalso add the CAB files to the _Streams usingWiStram.vbsI’ve gone with option 3
I hope somebody else finds this useful.
Note:
and the ant build looks something like the following.