Lodahl's blog: Silent installation of LibreOffice on Windows

## 15 February 2011

### Silent installation of LibreOffice on Windows

The product packaging and installation procedure of LibreOffice for Windows are rather different from earlier experiences from OpenOffice.org. LibreOffice comes with one installation file containing all languages. Further more you need to download and install the help files separately.

If you are a private user this isn't any problem. Just download the two files, install it. You can change the language under Tools – Options – Language settings – Language.

But what if you are to install LibreOffice in a larger scale? Companies, organizations and public authorities can't install LibreOffice individual on each machine.

Most IT departments uses some kind of installation tool like Zenworks or IBM Tivoli. No matter which you need to know some insight knowledge to succeed.

In this article I will demonstrate some techniques using simple batch scripting but you can probably 'translate' these demonstrations to your own tool.

## Preparing the installation files

First you need to do is to download the two relevant installation files:

• LibO_3.3.0_Win_x86_install_multi.exe

• LibO_3.3.0_Win_x86_helppack_da.exe

When you have downloaded the files you should execute and run the installation.

Select a suitable spot where you can extract the content. Be carefull not to mix the two. Extract the content to two separate subfolders e.g.,: “Program” and “Help”.

After extracting the content you should abort the installation (Cancel).

Extracting content from the executables can be done silently with the following command:

LibO_3.3.2_Win_x86_install_multi.exe /EXTRACTONLY=ON /S /D=c:\Path\to\Extracted\Installer\Files

The installation package is now extracted but not installed yet.

### Installation

Because we need to atomize the installation process we will create a simple Windows batch file named “Install.bat” in the form of a normal text file. You can use Notepad or any other plain text editor. The content could look like this:

 @echo offCD "Program"msiexec /qn /i libreoffice33.msi /L* ../logfile1.txtCD ..CD "Help"msiexec /qn /i libreoffice33.msi /L* ../logfile2.txt

Please note that the two folders “Program” and “Help” is one level below the folder where “Install.bat” is. There will be created two log files (the /L parameter is optional) so you can detect errors if any.

Execute the bat file by double-clicking on the icon. You will see an empty dos window while the installation runs. It takes several minutes.

This window will close when the installation of LibreOffice is finalized.

## Language settings

The version you just installed contains all (or most) languages but the graphical interface is in English. You can manually change this in “Tools – Options – Language Settings – Language” and change User interface to any other language of your choice. The language will be changing the next time you launch LibreOffice.

This (and all other) personal settings are stored in one specific file (registrymodifications.xcu). So if you exchange this file after installation with a simular file with the correct language settings, you are controlling the selected language in the GUI. You can create a fresh version of the file by installing LibreOffice on a “clean” computer and then change the language (without changing anything else. After that you can simply pick the file from “C:\Documents and Settings\[BRUGERNAVN]\Application Data\LibreOffice\3\user“ and distribute it to all users.

The installation file now looks like this:

 @echo offCD "Program"msiexec /qn /i libreoffice33.msi /L* ../logfile1.txtCD ..MKDIR "%userprofile%\Application Data\LibreOffice\3\user"Copy registrymodifications.xcu "%userprofile%\Application Data\LibreOffice\3\user" /yCD "Help"msiexec /qn /i libreoffice33.msi /L* ../logfile2.txt

### Select language using an extension

Its even a better idea to control the default language by using an extension. I have created an example (http://blog.magenta-aps.dk/wp-content/uploads/2011/02/DanishUI.oxt). If you want to change the language you can simply open the oxt-file using a zip-program and edit the linguistic.xcu:

### Installing the extension

The extension can be installed in several ways. One is to activate the UNOPKG mechanisme but with LibreOffice you can simply extract the content of the oxt file to the extension folder in LibreOffice: %PROGRAMFILES%\LibreOffice 3\share\extensions\DanishUI\META-INF\ . The batch file looks like this:

 MD "%PROGRAMFILES%\LibreOffice 3\share\extensions\DanishUI\META-INF"copy DanishUI\* "%PROGRAMFILES%\LibreOffice 3\share\extensions\DanishUI\"copy DanishUI\META-INF\* "%PROGRAMFILES%\LibreOffice 3\share\extensions\DanishUI\META-INF\"

The oxt file is as mentioned above a zip file. It's not possible to unzip the content using simple batch programming, so you might have to extract it manually. The other operations are simple creating the folder and copying the files.

### Install only the one language

A third and even better solution will be only to install the language you need. Unfortunately this is only possible by manipulating the msi file.

The program Orca (http://www.softpedia.com/get/Authoring-tools/Setup-creators/Orca.shtml) is a free tool for manipulating Windows installation files. I will actually recommend that you don't change the msi file but creates a new so called transformation file. This is a kind of ammendmend to the installation file.

What you actually do is to open the msi file in Orca and then attaches the existing transformation file for your language e.g., trans_da.mst. When you are done you can save (generate) a new transformation file with another name.

In Orca you can find Property in the left meny and then find the languages in the right window. All languages but the one you want to install must be changed to 0 (False). Danish is IS1030. You can find a (more or less) complere list of language codes here: http://www.science.co.il/language/Locale-Codes.asp?s=hexadecimal .

When you install LibreOffice you should attach the transformation file like this:

 msiexec /qn /i libreoffice33.msi TRANSFORMS=trans_dansk.mst
• trans_dansk.mst is the new transformation file we created

• (trans_da.mst is the original transformation file for Danish)

Please have in mind that the transformation file (mst) must match the installation file (msi) precisely. So you have to generate a new mst file for each installation file you use.

## Silent deinstallation

The similar batch file for deinstallation (uninstall.bat) could look like this:

 @echo offCD "Help"msiexec /qn /x libreoffice33.msi /L* ../Logfile3.txtCD ..CD "Program"msiexec /qn /x libreoffice33.msi /L* ../Logfile4.txtRMDIR /S /Q "%userprofile%\Application Data\LibreOffice"

Please note that this batch file also removes all user settings. If you don't want to remove the settings you should remove the line “RMDIR…” from the batch file.

## Note:

The file structure in these examples are from an English Windos XP. Other versions and languages of Windows might use other file paths.

Soehnke said...

Hello,
thanks for this great Blogpost!

Libreoffice works fine for me with your silent installation.

Greetz

Soehnke

Urko Masse said...

Hi,
Great post, thanks for the info!
We are planning to deploy Libreoffice in our school soon, and I want to make sure I provide the best experience.
Do you have any suggestions for templates or clipart collections that I can add?
OxygenOffice it's pretty good, I've heard, but Sun also used to provide template collections.

What do you think?

Leif Lodahl said...

@Urko Masse
Hello Urko,
There is a lot of template extensions on the extension website. To pick one of them ahead of the others wouldn't be fair. I will though mention two other alternatives:
You can rather easily create your own extension containing any clipart that you have. Please remember to check copyright etc. The details about how to do it can be found here: http://wiki.services.openoffice.org/wiki/Non-code_extensions#Gallery_Extensions
The other alternative is to take another approach. With the extension "Creative Commons" http://extensions.services.openoffice.org/en/project/ccooo you can access openclipart.org Flickr etc. from within OpenOffice.org.

Another thing is:
Remember to add multible dictionaries and the LanguageTool. This will be very helpfull in language class ;-)

Cheers,
Leif

DeploymentSwede said...

Great guide!

Leif Lodahl said...
This comment has been removed by the author.
Leif Lodahl said...

I have found some additional resources on the subject:

http://webgnuru.com/tech/libreoffice_msi.php
http://wpkg.org/LibreOffice
http://ausnerd.blogspot.com/2011/02/using-libreoffice-and-openoffice-33-in.html
http://openofficetechnology.com/

anjiilyn said...

Interesting post! Thanks for sharing them with us.