Difference between revisions of "LibreOffice"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m (removed "2>&1" so wpkg 1.3 accepts the package as valid xml)
m (Common Installer Options)
Line 21: Line 21:
 
=== Common Installer Options ===
 
=== Common Installer Options ===
  
* ALLUSERS (default=1) - performs a per-user installation or per-machine installation depending on the access privileges of the user
+
* ALLUSERS (default=1) - perform a per-user installation or per-machine installation depending on the access privileges of the user  
* CREATEDESKTOPLINK (default=1) - Create desktop shortcuts
+
* CREATEDESKTOPLINK (default=1) - create desktop shortcut icon
* INSTALLLOCATION - specify installation directory
+
* INSTALLLOCATION - specify installation directory  
* ISCHECKFORPRODUCTUPDATE (default=1) - Check for updates
+
* RebootYesNo (default=Yes) – reboot after the installation
* REGISTER_ALL_MSO_TYPES - Use LibreOffice as the default application for Microsoft Office file formats
+
* ISCHECKFORPRODUCTUPDATES (default=1) - check for updates – this property is deprecated
* REMOVE - remove specified components
+
* REGISTER_ALL_MSO_TYPES (default=0) - use LibreOffice as the default application for Microsoft Office file formats  
 +
* REGISTER_NO_MSO_TYPES (default=0) – don't use LibreOffice as default application for any Microsoft Office file formats
 +
* REGISTER_DOC (default=0) - use LibreOffice as the default application for Microsoft Word file format .doc (You can use similar for .xls, .ppt etc.)
 +
* SELECT_WORD - use LibreOffice as the default application for Microsoft Word file formats (You can use similar for EXCEL and POWERPOINT)
 +
* REMOVE - remove specified components(comma as separator and no space)
 +
* IS1033 (default=1) – all languages are installed as default so you must specify each language that you don't want to install.
 +
 
 +
LibreOffice has a [https://wiki.documentfoundation.org/Deployment_and_Migration Deployment and Migration wiki page with MSI properties].
  
 
OpenOffice has a [http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Automatic_Installation_on_Windows#MSI_Properties wiki page with MSI properties], most of which apply to LibreOffice.
 
OpenOffice has a [http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Automatic_Installation_on_Windows#MSI_Properties wiki page with MSI properties], most of which apply to LibreOffice.

Revision as of 17:55, 29 February 2012

LibreOffice is an office suite. It is a fork of OpenOffice, and a replacement of Novell's Go-OO, managed by the Document Foundation. See www.libreoffice.org


Get LibreOffice

Download LibreOffice from www.libreoffice.org/download/

You need the program itself:

  • LibO_3.x.x_Win_x86_install_multi.exe

or

  • LibO_3.x.x_Win_x86_install_all_lang.exe (for uncommon languages)

Additionaly you may want to install the help package for your language, for example:

  • LibO_3.x.x_Win_x86_helppack_en-US.exe 8.6

Dependencies

The Java Runtime Environment is a software prerequiste for LibreOffice, thus is a <depends> of the package.

Dual Installation with OpenOffice

LibreOffice does not replace an already installed OpenOffice (though LibreOffice 3.3 beta did), so you may like to remove OpenOffice before installing LibreOffice.

Common Installer Options

  • ALLUSERS (default=1) - perform a per-user installation or per-machine installation depending on the access privileges of the user
  • CREATEDESKTOPLINK (default=1) - create desktop shortcut icon
  • INSTALLLOCATION - specify installation directory
  • RebootYesNo (default=Yes) – reboot after the installation
  • ISCHECKFORPRODUCTUPDATES (default=1) - check for updates – this property is deprecated
  • REGISTER_ALL_MSO_TYPES (default=0) - use LibreOffice as the default application for Microsoft Office file formats
  • REGISTER_NO_MSO_TYPES (default=0) – don't use LibreOffice as default application for any Microsoft Office file formats
  • REGISTER_DOC (default=0) - use LibreOffice as the default application for Microsoft Word file format .doc (You can use similar for .xls, .ppt etc.)
  • SELECT_WORD - use LibreOffice as the default application for Microsoft Word file formats (You can use similar for EXCEL and POWERPOINT)
  • REMOVE - remove specified components(comma as separator and no space)
  • IS1033 (default=1) – all languages are installed as default so you must specify each language that you don't want to install.

LibreOffice has a Deployment and Migration wiki page with MSI properties.

OpenOffice has a wiki page with MSI properties, most of which apply to LibreOffice.

Uninstall Strings

Get the uninstall string for your particular language from 'productcode' in setup.ini.

LibreOffice

English (US/GB)
  • 3.4.4 - D64833F8-860D-4216-8EDC-DD08AD68C0B5
  • 3.4.3 - 7821C7B2-7E21-4CF3-925B-58B6A8BC6311 (Also Spanish Code)
  • 3.4.2 - F1161EC6-7CC1-4D9F-83F6-8839C17019C2
  • 3.4.1 - 528882DF-7239-436F-811B-F48F4179D017

LibreOffice Help Pack

English (GB)
  • 3.4.4 - 035196C0-BB99-4ACF-B577-751CF40E53B1
  • 3.4.3 - 522C02C1-B575-4E1E-81CF-FBAEA22B6532
  • 3.4.2 - 31FCEE1C-7E49-4B2F-9376-617151B1BA4D
  • 3.4.1 - C41B221F-FB0D-4B1E-9048-2A4D40BDB202
English (US)
  • 3.4.3 - 3759AE04-BB49-4299-B342-2EA611394620

LibreOffice 3.5.x

I am using a custom cmd script to launch the installer in custom way. This also allows me to customize MSI installer options. Currently I use this to create a minified LibreOffice installer which excludes language packs I don't need. This heavily speeds up deployment on my machines. Installing full LibreOffice 3.5 on my test machine took around 15-20 minutes while minified version with reduced language set finished in 2 minutes.

Here's what my WPKG package looks like. Note that it's a very basic package working with WPKG 1.2 and newer.

<package id='LibreOffice' name='LibreOffice' revision='350' priority='50' reboot='false' >
  <check type='uninstall' condition='exists' path='LibreOffice 3.5' />
  <install cmd='"%SOFTWARE%\LibreOffice v.3.5.0\unattended.cmd" > NUL' />
  <remove cmd='"%SOFTWARE%\LibreOffice v.3.5.0\unattended-uninstall.cmd" > NUL' />
  <upgrade cmd='"%SOFTWARE%\LibreOffice v.3.5.0\unattended.cmd" > NUL' />
</package>

As you can see I am just calling unattended.cmd / unattended-uninstall.cmd. The following chapters list these files. The application folder should therefore contain the following files:

  • install.cmd
  • LibO_3.5.0_Win_x86_install_multi.msi
  • unattended.cmd
  • unattended-uninstall.cmd

unattended.cmd

This script is used to install LibreOffice with custom options (see CUSTOM_OPTIONS variable). I am using 3 'for' loops in order to exclude languages I do not need. The first loop removes dictionaries which are excluded. The second loop removes unneeded help packs and the third one removes unneeded language packs (user interface localizations). Removing help and language packs can reduce installation time dramatically.

If you need to know the full list of dictionaries, helppack and langpack language codes, then open the installer MSI file with an MSI editor like Orca and head towards the 'Components' table. Herein you will find all gm_r_ex_Dicctionary_*, gm_Helppack_r_* and gm_Langpack_r_* components with descriptions.

In addition this script checks for the existence of a Microsoft Office installation. If an Office installation folder is found, then gm_p_Wrt_MSO_Reg,gm_p_Calc_MSO_Reg,gm_p_Impress_MSO_Reg is appended to the remove list so LibreOffice will not associate Office file extensions to LibreOffice.


   @echo off
   
   :: This script is a generic unattended installer/uninstaller. It helps you to
   :: run installer.cmd with the right command line arguments. In addition it
   :: allows you to simply add *-preinstall.cmd *-postinstall.cmd scripts:
   :: call trace:
   ::  - unattended.cmd                | - unattended-uninstall.cmd
   ::   -> unattended-preinstall.cmd   |   -> unattended-uninstall.cmd
   ::   -> installing application      |   -> remove application
   ::   -> unattended-postinstall.cmd  |   -> unattended-uninstall-postinstall.cmd
   
   
   :: Name of the application (just to print it on the command prompt)
   set PROGRAM_NAME=LibreOffice
   
   :: 32-bit installer command (run on 32-bit Windows)
   if not "%CMD32%" == "" goto CMD32alreadySet
   set CMD32=LibO_3.5.0_Win_x86_install_multi.msi
   :CMD32alreadySet
   
   :: 64-bit installer command (run on 64-bit Windows)
   if not "%CMD64%" == "" goto CMD64alreadySet
   :: set to %CMD32% to install the same package on 64-bit Windows
   set CMD64=%CMD32%
   :CMD64alreadySet
   
   :: Type of installer, select one supported by install.cmd
   :: e.g. msiinstall, msiuninstall, nsis, innosetup...
   set INSTALLER_TYPE=msiinstall
   
   :: Additional options to be passed to installer.
   set INSTALLER_OPTIONS=
   
   :: Working directory for installer
   set INSTALLER_WORKDIR=
   
   :: install helper script name (needs to be within the same directory)
   set INSTALLER=install.cmd
   
   
   set PROGRAM_FILES=%ProgramFiles%
   if not "%ProgramFiles(x86)%" == "" set PROGRAM_FILES=%ProgramFiles(x86)%
   
   REM valid values:
   REM set FILEASSOC=0
   REM set FILEASSOC=1
   set FILEASSOC=0
   
   :: check if MS Office is installed
   if exist "%ProgramFiles%\Microsoft Office" set FILEASSOC=0
   if exist "%ProgramFiles(x86)%\Microsoft Office" set FILEASSOC=0
   
   :: disable file association if globally disabled
   if "%FILE_ASSOCIATION%" == "0" set FILEASSOC=0
   
   :: echo FILE ASSOCIATION: %FILEASSOC% >> c:\fileassoc.txt
   
   :: custom options to pass to the installer
   set CUSTOM_OPTIONS=ALLUSERS=1 SELECT_WORD=%FILEASSOC% SELECT_EXCEL=%FILEASSOC% SELECT_POWERPOINT=%FILEASSOC% REGISTER_DOCX=0 REGISTER_PPTX=0 REGISTER_ALL_MSO_TYPES=%FILEASSOC% CREATEDESKTOPLINK=0 ADDLOCAL=ALL, REMOVE=gm_o_Quickstart,gm_o_Systemintegration,gm_o_Winexplorerext,gm_o_Winexplorerext_PropertyHdl,gm_o_Xsltfiltersamples,gm_o_Pyuno,gm_o_jf_Palm,gm_o_Javafilter,gm_o_jf_Pocketpc
   if not "%FILEASSOC%" == 1 (
       set CUSTOM_OPTIONS=%CUSTOM_OPTIONS%,gm_p_Wrt_MSO_Reg,gm_p_Calc_MSO_Reg,gm_p_Impress_MSO_Reg
   )
   
   SETLOCAL ENABLEDELAYEDEXPANSION
   set INSTALLER_LANG_OPTS=
   :: Dictionaries
   for %%I IN (Af An Ar Be Bn Br Pt Pt_Pt Ca Et Gd Gl Gu Hi Lt Lv Ne Oc Si Te Th Vi Zu) DO (
       set INSTALLER_LANG_OPTS=!INSTALLER_LANG_OPTS!,gm_r_ex_Dictionary_%%I
   )
   
   :: Helppack
   for %%I IN (af ar as be bg bn bo br brx bs ca ca_XV cs cy da dgo dz el en_ZA eo es et eu fa fi ga gd gl gu he hi hr hu id is ja ka kk km kn ko kok ks ku lb lo lt lv mai mk ml mn mni mr my nb ne nl nn nr nso oc om or pa_IN pl pt pt_BR ro ru rw sa_IN sat sd sh si sk sl sq sr ss st sv sw_TZ ta te tg th tn tr ts tt ug uk uz ve vi xh zh_CN zh_TW zu) DO (
       set INSTALLER_LANG_OPTS=!INSTALLER_LANG_OPTS!,gm_Helppack_r_%%I
   )
   
   :: Langpack
   for %%I IN (af sq ar as ast eu be bn brx bs br bg my ca ca_XV zh_CN zh_TW hr cs da dgo nl dz en_ZA eo et fa fi gl ka el gu he hi hu is id ga ja kn ks kk km rw kok ko ku lo lv lt lb mk mai ml mni mr mn nr ne nso nb nn oc or om pl pt pt_BR pa_IN ro ru sa_IN sat gd sr sh sd si sk sl st es sw_TZ ss sv tg ta tt te th bo ts tn tr uk ug uz ve vi cy xh zu) DO (
       set INSTALLER_LANG_OPTS=!INSTALLER_LANG_OPTS!,gm_Langpack_r_%%I
   )
   
   
   set CUSTOM_OPTIONS=%CUSTOM_OPTIONS%%INSTALLER_LANG_OPTS%
   
   :: ############################################################################
   :: No need to change anything below this line (usually ;-))
   :: ############################################################################
   set INSTALLER_LOC=%~dp0
   set CMDPATH=%~dpn0
   
   if exist "%INSTALLER_LOC%prerun.cmd" (
   	setlocal
   	call "%INSTALLER_LOC%prerun.cmd"
   	endlocal
   )
   
   if exist "%CMDPATH%-pre.cmd" (
   	setlocal
   	call "%CMDPATH%-pre.cmd"
   	endlocal
   
   )
   
   :install
   echo Installing %PROGRAM_NAME%
   
   set PROGRAM_FILES=%ProgramFiles%
   if not "%ProgramFiles(x86)%" == "" set PROGRAM_FILES=%ProgramFiles(x86)%
   
   call "%INSTALLER_LOC%%INSTALLER%" %INSTALLER_TYPE% "%CMD32%" "%CMD64%" "%INSTALLER_WORKDIR%" "%INSTALLER_OPTIONS%"
   set EXIT_CODE=%ERRORLEVEL%
   
   ENDLOCAL
   
   if exist "%CMDPATH%-post.cmd" (
   	setlocal
   	call "%CMDPATH%-post.cmd"
   	endlocal
   )
   
   if exist "%INSTALLER_LOC%postrun.cmd" (
   	setlocal
   	call "%INSTALLER_LOC%postrun.cmd"
   	endlocal
   )
   
   :end
   exit /B %EXIT_CODE%


unattended-uninstall.cmd

This script is basically identical to unattended.cmd.

   @echo off
   
   :: This script is a generic unattended installer/uninstaller. It helps you to
   :: run installer.cmd with the right command line arguments. In addition it
   :: allows you to simply add *-preinstall.cmd *-postinstall.cmd scripts:
   :: call trace:
   ::  - unattended.cmd                | - unattended-uninstall.cmd
   ::   -> unattended-preinstall.cmd   |   -> unattended-uninstall.cmd
   ::   -> installing application      |   -> remove application
   ::   -> unattended-postinstall.cmd  |   -> unattended-uninstall-postinstall.cmd
   
   
   :: Name of the application (just to print it on the command prompt)
   set PROGRAM_NAME=LibreOffice
   
   :: 32-bit installer command (run on 32-bit Windows)
   if not "%CMD32%" == "" goto CMD32alreadySet
   set CMD32=LibO_3.5.0_Win_x86_install_multi.msi
   :CMD32alreadySet
   
   :: 64-bit installer command (run on 64-bit Windows)
   if not "%CMD64%" == "" goto CMD64alreadySet
   :: set to %CMD32% to install the same package on 64-bit Windows
   set CMD64=%CMD32%
   :CMD64alreadySet
   
   :: Type of installer, select one supported by install.cmd
   :: e.g. msiinstall, msiuninstall, nsis, innosetup...
   set INSTALLER_TYPE=msiuninstall
   
   :: Additional options to be passed to installer.
   set INSTALLER_OPTIONS=
   
   :: Working directory for installer
   set INSTALLER_WORKDIR=
   
   :: install helper script name (needs to be within the same directory)
   set INSTALLER=install.cmd
   
   
   
   set PROGRAM_FILES=%ProgramFiles%
   if not "%ProgramFiles(x86)%" == "" set PROGRAM_FILES=%ProgramFiles(x86)%
   
   :: check if MS Office is installed
   if exist "%PROGRAM_FILES%\Microsoft Office" set FILEASSOC=0
   
   :: custom options to pass to the installer
   :: set CUSTOM_OPTIONS=SELECT_WORD=%FILEASSOC% SELECT_EXCEL=%FILEASSOC% SELECT_POWERPOINT=%FILEASSOC% ADDLOCAL=ALL,gm_o_Accessories REMOVE=gm_o_Quickstart,gm_o_Systemintegration,gm_o_Testtool,gm_o_Winexplorerext,gm_o_Winexplorerext_PropertyHdl
   :: set CUSTOM_OPTIONS=TRANSFORMS=%~dp0trans_de.mst SELECT_WORD=%FILEASSOC% SELECT_EXCEL=%FILEASSOC% SELECT_POWERPOINT=%FILEASSOC% ADDLOCAL=ALL REMOVE=gm_o_Quickstart,gm_o_Systemintegration,gm_o_Testtool,gm_o_Winexplorerext,gm_o_Winexplorerext_PropertyHdl
   
   
   :: ############################################################################
   :: No need to change anything below this line (usually ;-))
   :: ############################################################################
   set INSTALLER_LOC=%~dp0
   set CMDPATH=%~dpn0
   
   if exist "%INSTALLER_LOC%prerun.cmd" (
   	setlocal
   	call "%INSTALLER_LOC%prerun.cmd"
   	endlocal
   )
   
   if exist "%CMDPATH%-pre.cmd" (
   	setlocal
   	call "%CMDPATH%-pre.cmd"
   	endlocal
   
   )
   
   :install
   echo Installing %PROGRAM_NAME%
   
   set PROGRAM_FILES=%ProgramFiles%
   if not "%ProgramFiles(x86)%" == "" set PROGRAM_FILES=%ProgramFiles(x86)%
   
   call "%INSTALLER_LOC%%INSTALLER%" %INSTALLER_TYPE% "%CMD32%" "%CMD64%" "%INSTALLER_WORKDIR%" "%INSTALLER_OPTIONS%"
   set EXIT_CODE=%ERRORLEVEL%
   
   if exist "%CMDPATH%-post.cmd" (
   	setlocal
   	call "%CMDPATH%-post.cmd"
   	endlocal
   )
   
   if exist "%INSTALLER_LOC%postrun.cmd" (
   	setlocal
   	call "%INSTALLER_LOC%postrun.cmd"
   	endlocal
   )
   
   :end
   exit /B %EXIT_CODE%


install.cmd

Both scripts above use install.cmd. This script is a generic installer able to deal with many standard installers.

   @echo off
   
   :: Usage:
   :: install.cmd <type> <32-bit-installer> <64-bit-installer> [installer-location [custom-options]]
   :: where type is one of
   ::     msiinstall     Install the given MSI package
   ::     msiuninstall   Uninstall the given MSI package
   ::     msiupdate      Update the given MSP package
   ::     install4j      Install4J setup
   ::     innosetup      Inno setup
   ::     installshield  Install shield
   ::     nsis           Nullsoft install system (NSIS)
   ::     custom         Custom installer - options required in this case
   :: 32-bit-installer   Full file name (including extension) of 32-bit installer
   :: 64-bit-installer   Full file name (including extension) of 64-bit installer
   :: installer-location Path where the installers are stored, if empty assumes directory where install.cmd is
   :: custom-options     Replace the default installer options with the ones given
   
   :: do not export variables
   setlocal
   
   :: Additional options to be passed to the installer
   :: set CUSTOM_OPTIONS=
   
   :: Global variables
   set INSTALL_CMD=
   set EXIT_CODE=0
   
   :: Get command type
   set TYPE=%~1
   
   :: Get 32-bit installer name
   set CMD32=%~2
   
   :: Get 64-bit installer name
   set CMD64=%~3
   
   :: get file path
   set INSTALLER_PATH=%~dp0
   if not "%~4" == "" (
   set INSTALLER_PATH=%~4
   )
   
   set OPTIONS=
   if not "%~5" == "" (
   set OPTIONS=%~5
   )
   
   :: Detect which system is used
   if not "%ProgramFiles(x86)%" == "" goto 64bit
   goto 32bit
   
   
   :: ##########################################################################
   :: 64-bit system detected
   :: ##########################################################################
   :64bit
   :: Determine 64-bit installer to be used
   echo 64-bit system detected.
   :: set INSTALLER64=
   if not "%CMD64%" == "" (
   set INSTALLER64=%CMD64%
   ) else (
   :: Use 32-bit installer if available, no 64-bit installer available.
   if not "%CMD32%" == "" (
   echo Using 32-bit installer, no 64-bit installer specified.
   set INSTALLER64=%CMD32%
   ) else (
   echo Neither 64-bit nor 32-bit installer specified. Exiting.
   goto usage
   )
   )
   
   :: Check if installer is valid
   if exist "%INSTALLER_PATH%%INSTALLER64%" (
   set INSTALL_CMD=%INSTALLER_PATH%%INSTALLER64%
   ) else (
   if exist "%INSTALLER64%" (
   set INSTALL_CMD=%INSTALLER64%
   ) else (
   echo Installer "%INSTALLER_PATH%%INSTALLER64%" cannot be found! Exiting.
   exit /B 97
   )
   )
   goto installerselection
   
   
   :: ##########################################################################
   :: 32-bit system detected
   :: ##########################################################################
   :32bit
   :: Determine 32-bit installer to be used
   echo 32-bit system detected.
   set INSTALLER32=
   if not "%CMD32%" == "" (
   set INSTALLER32=%CMD32%
   ) else (
   echo No 32-bit installer specified. Exiting.
   exit /B 96
   )
   
   
   :: Check if installer is valid
   if exist "%INSTALLER_PATH%%INSTALLER32%" (
   set INSTALL_CMD=%INSTALLER_PATH%%INSTALLER32%
   ) else (
   if exist "%INSTALLER32%" (
   set INSTALL_CMD=%INSTALLER32%
   ) else (
   echo Installer "%INSTALLER_PATH%%INSTALLER32%" cannot be found! Exiting.
   exit /B 95
   )
   )
   goto installerselection
   
   
   
   :: ##########################################################################
   :: select installer system
   :: ##########################################################################
   :installerselection
   if /i "%TYPE%" == "msiinstall"    goto msiinstaller
   if /i "%TYPE%" == "msiinstall"    goto msiupdate
   if /i "%TYPE%" == "msiuninstall"  goto msiuninstaller
   if /i "%TYPE%" == "install4j"     goto install4j
   if /i "%TYPE%" == "innosetup"     goto innoinstaller
   if /i "%TYPE%" == "installshield" goto installshieldinstaller
   if /i "%TYPE%" == "nsis"          goto nsisinstaller
   if /i "%TYPE%" == "custom"        goto custominstaller
   goto usage
   
   
   
   :msiinstaller
   echo Installing "%INSTALL_CMD%"
   if "%OPTIONS%" == "" (
   set OPTIONS=/qn /norestart
   )
   start /wait "Software installation" /D"%INSTALLER_PATH%" msiexec /i "%INSTALL_CMD%" %OPTIONS% %CUSTOM_OPTIONS%
   set EXIT_CODE=%ERRORLEVEL%
   goto end
   
   :msiupdate
   echo Installing "%INSTALL_CMD%"
   if "%OPTIONS%" == "" (
   set OPTIONS=/qn /norestart
   )
   start /wait "Software installation" /D"%INSTALLER_PATH%" msiexec /update "%INSTALL_CMD%" %OPTIONS% %CUSTOM_OPTIONS%
   set EXIT_CODE=%ERRORLEVEL%
   goto end
   
   :msiuninstaller
   echo Uninstalling "%INSTALL_CMD%"
   if "%OPTIONS%" == "" (
   set OPTIONS=/qn /norestart
   )
   start /wait "Software uninstallation" /D"%INSTALLER_PATH%" msiexec /x "%INSTALL_CMD%" %OPTIONS% %CUSTOM_OPTIONS%
   set EXIT_CODE=%ERRORLEVEL%
   goto end
   
   
   :install4j
   echo Installing "%INSTALL_CMD%"
   start /wait "Software installation" /D"%INSTALLER_PATH%" "%INSTALL_CMD%" -q %OPTIONS% %CUSTOM_OPTIONS%
   set EXIT_CODE=%ERRORLEVEL%
   goto end
   
   
   :innoinstaller
   echo Installing "%INSTALL_CMD%"
   :: if "%OPTIONS%" == "" (
   :: set OPTIONS=/verysilent /norestart /sp-
   :: )
   start /wait "Software installation" /D"%INSTALLER_PATH%" "%INSTALL_CMD%" /verysilent /norestart /sp- %OPTIONS% %CUSTOM_OPTIONS%
   set EXIT_CODE=%ERRORLEVEL%
   goto end
   
   
   :installshieldinstaller
   echo Installing "%INSTALL_CMD%"
   start /wait "Software installation" /D"%INSTALLER_PATH%" "%INSTALL_CMD%" /s %OPTIONS% %CUSTOM_OPTIONS%
   set EXIT_CODE=%ERRORLEVEL%
   goto end
   
   
   :nsisinstaller
   echo Installing "%INSTALL_CMD%"
   start /wait "Software installation" /D"%INSTALLER_PATH%" "%INSTALL_CMD%" /S %OPTIONS% %CUSTOM_OPTIONS%
   set EXIT_CODE=%ERRORLEVEL%
   goto end
   
   :custominstaller
   if "%OPTIONS%" == "" goto usage
   echo Installing "%INSTALL_CMD%"
   start /wait "Software installation" /D"%INSTALLER_PATH%" "%INSTALL_CMD%" %OPTIONS% %CUSTOM_OPTIONS%
   set EXIT_CODE=%ERRORLEVEL%
   goto end
   
   :usage
   echo Usage:
   echo "%~nx0 <type> <32-bit-installer> <64-bit-installer> [installer-location [custom-options]]"
   echo where type is one of
   echo     msiinstall        Install the given MSI package
   echo     msiuninstall      Uninstall the given MSI package
   echo     msiupdate         Update the given MSP package
   echo     innosetup         Inno setup
   echo     installshield     Install shield
   echo     nsis              Nullsoft install system (NSIS)
   echo     custom            Custom installer - options required in this case
   echo 32-bit-installer      Full file name (including extension) of 32-bit installer
   echo 64-bit-installer      Full file name (including extension) of 64-bit installer
   echo installer-location    Path where the installers are stored
   echo custom-options        Replace the default installer options with the ones given
   exit /B 99
   
   :end
   exit /B %EXIT_CODE%

LibreOffice 3.4.x

Unpack the LibreOffice installer (.exe) and help file installer (.exe) with an archive tool (for example 7-zip, or using the installer itself).

Copy the unpacked files to your server.

If required, for example to change installer options or to remove unnecessary languages, modify the MSI file or create a transform (.mst) file using an MSI editor such as Microsoft ORCA or InstEd. The main interesting sections to configure in the MSI are 'Property' and 'Feature'.

The exact version number is gleaned from setup.ini.

For the <remove> tags, these packages use the English (GB) uninstall string. Either use the uninstall string for your particular language, gleaned from 'productcode' in setup.ini, or leave the .msi file for the particular version on your server and use that (not as straight forward).

There appears to be a large penalty for not removing unwanted languages. Start up time, even with quick-starter enabled is very long. Removing languages improves this tremendously.

LibreOffice

<package
	id="libreoffice" 
	name="LibreOffice" 
	revision="4"
	reboot="false" 
	priority="3">

	<depends
		package-id="sun-jre" />

	<check 
		type="uninstall" 
		condition="versiongreaterorequal" 
		path="LibreOffice .+"
		value="3.4.3" />

	<install
		cmd='msiexec /qb /package "%SOFTWARE%\libreoffice\libreoffice34.msi" ALLUSERS=1 CREATEDESKTOPLINK=0 REGISTER_ALL_MSO_TYPES=1 ISCHECKFORPRODUCTUPDATE=0 INSTALLLOCATION="%PROGRAMFILES%\LibreOffice\"' />
		
	<!-- swriter.exe fails to run because no Microsoft Visual C++ 2008 Redistributable, which LibreOffice should install but isn't, so we install it, but you may not see this issue -->
	<install
		cmd='"%SOFTWARE%\libreoffice\redist\vcredist_x86.exe" /q' />

	<upgrade
		cmd='msiexec /qb /package "%SOFTWARE%\libreoffice\libreoffice34.msi" ALLUSERS=1 CREATEDESKTOPLINK=0 REGISTER_ALL_MSO_TYPES=1 ISCHECKFORPRODUCTUPDATE=0 INSTALLLOCATION="%PROGRAMFILES%\LibreOffice\"' />

	<remove
		cmd="msiexec /qb /uninstall {7821C7B2-7E21-4CF3-925B-58B6A8BC6311}" />
</package>


LibreOffice Help Pack

<package
	id="libreoffice-help-pack"
	name="LibreOffice Help Pack" 
	revision="4"
	reboot="false" 
	priority="3">

	<depends
		package-id="libreoffice" />

	<check 
		type="uninstall" 
		condition="exists" 
		path="LibreOffice 3.4 Help Pack (English (United Kingdom))" />

	<install
		cmd='msiexec /qb /package "%SOFTWARE%\libreoffice-help-pack\libreoffice34.msi" INSTALLLOCATION="%PROGRAMFILES%\LibreOffice\"' />

	<upgrade
		cmd='msiexec /qb /package "%SOFTWARE%\libreoffice-help-pack\libreoffice34.msi" INSTALLLOCATION="%PROGRAMFILES%\LibreOffice\"' />

	<remove
		cmd="msiexec /qb /uninstall {522C02C1-B575-4E1E-81CF-FBAEA22B6532}" />
</package>

LibreOffice 3.3.x

This is based on the OpenOffice 3.2.1 package script.

Unpack the LibreOffice installer (.exe) and help file installer (.exe) with an archive tool (for example 7-zip, or using the installer itself).

Copy the unpacked files to your server.

If required, for example to change installer options or to remove unnecessary languages, modify the MSI file or create a transform (.mst) file using an MSI editor such as Microsoft ORCA or InstEd. The main interesting sections to configure in the MSI are 'Property' and 'Feature'.


LibreOffice

<package id="libreoffice" name="LibreOffice" revision="3" reboot="false" priority="10">
    <variable name="PKG_VERSION" value="3.3.2" />

    <!-- LibreOffice removed main programs from full install -->
    <variable name="REMOVEPROGS" value="gm_p_Base,gm_p_Base_Bin,gm_p_Math,gm_p_Math_Bin" />
    <!-- LibreOffice removed options from full install -->
    <variable name="REMOVEOPTIONS" value="gm_o_Testtool,gm_o_Xsltfiltersamples,gm_o_Pyuno,gm_o_jf_Palm,gm_o_jf_Pocketpc,gm_o_Quickstart,gm_o_Extensions_PRESENTER_SCREEN,gm_o_Extensions_REPORTDESIGN,gm_o_Extensions_MEDIAWIKI" />
    <!-- Company Name option -->
    <variable name="CNAME" value="Our Company" />

    <!-- Some LibreOffice functionalities depends on Java -->
    <depends package-id="java" />

    <check type="uninstall" condition="versiongreaterorequal" path="LibreOffice .+" value="%PKG_VERSION%" />

    <install cmd='msiexec /qn /I "%SOFTWARE%\LibreOffice\LibO_%PKG_VERSION%_Win_x86_install_multi\libreoffice33.msi" COMPANYNAME="%CNAME%" USERNAME="" ISCHECKFORPRODUCTUPDATE=0 CREATEDESKTOPLINK=0 ADDLOCAL=ALL REMOVE=%REMOVEPROGS%,%REMOVEOPTIONS%' />

    <upgrade cmd='msiexec /qn /I "%SOFTWARE%\LibreOffice\LibO_%PKG_VERSION%_Win_x86_install_multi\libreoffice33.msi" COMPANYNAME="%CNAME%" USERNAME="" ISCHECKFORPRODUCTUPDATE=0 CREATEDESKTOPLINK=0 ADDLOCAL=ALL REMOVE=%REMOVEPROGS%,%REMOVEOPTIONS%' />
    
    <remove cmd='msiexec /qn /X "%SOFTWARE%\LibreOffice\LibO_%PKG_VERSION%_Win_x86_install_multi\libreoffice33.msi"' />
    
</package>


LibreOffice Help Pack

<package id="libreoffice_help" name="LibreOffice Help Pack" revision="2" reboot="false" priority="10">
    <variable name="PKG_VERSION" value="3.3.2" />
    <variable name="INS_VERSION" value="3.3" />
    <variable name="SHORT_LANG" value="cs" />
    <variable name="LANG" value="Czech" />

    <depends package-id="libreoffice" />

    <check type="uninstall" condition="exists" path="LibreOffice %INS_VERSION% Help Pack (%LANG%)" />

    <install cmd='msiexec /qn /I "%SOFTWARE%\LibreOffice\LibO_%PKG_VERSION%_Win_x86_helppack_%SHORT_LANG%\libreoffice33.msi"' />
   
    <upgrade cmd='msiexec /qn /I "%SOFTWARE%\LibreOffice\LibO_%PKG_VERSION%_Win_x86_helppack_%SHORT_LANG%\libreoffice33.msi"' />

    <remove cmd='msiexec /qn /X "%SOFTWARE%\LibreOffice\LibO_%PKG_VERSION%_Win_x86_helppack_%SHORT_LANG%\libreoffice33.msi"' />

</package>

Note: For the <remove> tag I have used the .msi file itself to get rid of the fact that the uninstall strings in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall are language dependent. But this requires you to keep the .msi file on the server for removing software. You may prefer to use remove strings such as:

<!-- language dependent msiexec remove strings (here the czech ones) -->
<remove cmd='msiexec /qn /X{CEE2613D-3B53-4447-BA2D-E88C08272581}' />
<remove cmd='msiexec /qn /X{04A88043-281E-4E32-B878-343B51F56F2E}' />

You will have to use the string relevant to your language. These strings are held in setup.ini, under 'productcode'.