[Libreoffice] Multi-language MSI installer in a single file

Andras Timar timar74 at gmail.com
Fri Sep 30 12:14:23 PDT 2011


Hi,

Currently LibreOffice Windows installer is rather complicated. It
starts with the NSIS installer which extracts MSI file, language MST
files, readmes, setup.ini and setup.exe to a directory in the user's
file system. Desktop is the default. Then setup.exe starts. It also
tries to find out the language to be used, installs the vcredist
files, then starts the MSI installer (with a language transform, if
necessary). MSI installer does the real installation.

Problems with NSIS:
- It does not know Unicode. Localized installers cannot be made for
many languages.
- Help packs have localized installers and localized text is displayed
correctly only when the system legacy code page setting matches to
that language. For example Russian help pack installer displays
garbage characters on English system.
- It extracts files to Desktop (per default). Users are confused, they
don't know, if they can remove those files or not.
- It has a cryptic bug which caused problems with Chinese installers
(garbage characters) fdo#32335

In fact MSI alone is capable to install anything. In a few steps I
created a multi-lingual single MSI installer for LibreOffice 3.4
1. In solenv/bin/modules/installer/global.pm set $include_cab_in_msi
from 0 to 1. This creates one big MSI file with the CAB included.
2. Instead of installing vcredist_x86.exe separately, the necessary
runtime files can be merged into the MSI. We definitely need MSVCRT,
I'm not sure about ATL, and we don't need MFC. So it helps in reducing
the size of installer, if we don't ship DLLs that are not used by
LibreOffice. Merge modules should be copied to external/msm90, they
can be found at c:\Program Files (x86)\Common Files\Merge Modules\ in
every Windows dev environment. Scp2 and installer creator perl scripts
can handle merge modules.
3. The use of embedded language transforms is an undocumented feature
of Windows Installer. A language transform is a transform that is
located in a substorage of a Windows Installer package that is named
after the LangId. The Summary Information Stream (Property:
PID_TEMPLATE) includes a list of languages that are supported by the
package. Windows Installer automatically selects the language that
matches the language preference that is set for the operating system.
Basically I followed the instructions on
http://www.installsite.org/pages/en/msi/articles/embeddedlang/. The
necessary VBScript files are part of Windows SDK, at least Microsoft
mentions this in KB articles. I found them elsewhere on the net.

I uplodead the result to http://ftp.fsf.hu/LibreOffice/Multilang-MSI/.
The installer file, libreoffice34.msi starts in the default language
of Windows. Any language can be forced, e.g. Hungarian with LCID 1038:
msiexec -i libreoffice34.msi TRASNFORMS=:1038
Note the colon before the number, that denotes internal transform.

I don't know why OOo chose NSIS. I don't know why they preferred
vcredist_x86.exe instead of merge module. Please let me know, if I'm
missing something.

TODO:
- Implement step 3. as part of the build.
- Do the same for helppack installers.
- Clean up the code (remove NSIS, possibly remove ulfconv, etc.)

Comments are welcome.

Andras


More information about the LibreOffice mailing list