Difference between revisions of "LibreOffice"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
(LibreOffice 3.5.x WPKG 1.3)
(English (US))
Line 72: Line 72:
  
 
===== English (US) =====
 
===== English (US) =====
 +
* 3.6.0 - 19D6F37E-BA93-4B73-BC6A-46BBFCEEFC7A
 
* 3.5.5 - FB78B8E5-8766-4E1E-BE6B-8E8362FA94A8
 
* 3.5.5 - FB78B8E5-8766-4E1E-BE6B-8E8362FA94A8
 
* 3.5.4 - 3124D64F-F72B-41C6-AF35-4ACCBDDFC54A
 
* 3.5.4 - 3124D64F-F72B-41C6-AF35-4ACCBDDFC54A

Revision as of 14:35, 10 August 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 HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall when LibreOffice installed (in older versions this was in 'productcode' in setup.ini).

LibreOffice

All Languages
  • 3.6.0 - AFD5A54E-E9A1-413D-8AA2-C9EDB6782400
  • 3.5.5 - B1F9C834-0594-4563-B344-4ED9599A5945
  • 3.5.4 - EF790F1C-CB0C-4B95-8C54-60783F3B6661
  • 3.5.3 - 28C70D19-6DE9-43EF-BFA3-342F4A11B727
  • 3.5.2 - 09D72100-CAC9-42BF-AD52-47F784C92DB6
  • 3.5.1 - 0E8E4718-0702-4D33-B007-5E95849BAB3C
  • 3.5.0 - BB21B808-F784-4883-A4D4-B1473384C1C6
  • 3.4.5 - 03CEFC42-378E-4467-9909-DCBAFD38CA9F
  • 3.4.4 - D64833F8-860D-4216-8EDC-DD08AD68C0B5
  • 3.4.3 - 7821C7B2-7E21-4CF3-925B-58B6A8BC6311
  • 3.4.2 - F1161EC6-7CC1-4D9F-83F6-8839C17019C2
  • 3.4.1 - 528882DF-7239-436F-811B-F48F4179D017

LibreOffice Help Pack

English (GB)
  • 3.5.5 - 145A79BA-4D50-4AED-B688-398620824DFA
  • 3.5.4 - 3EC61BE4-2134-45FA-8DB4-CA1076BB7D44
  • 3.5.3 - EEE2CE8A-E0B3-49BE-9C96-55537BD4309B
  • 3.5.1 - 7CB88D92-E18F-406B-AB59-389ABCD0D282
  • 3.5.0 - ?
  • 3.4.5 - CB6A0C73-6D33-46F0-9616-E47645626244
  • 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.6.0 - 19D6F37E-BA93-4B73-BC6A-46BBFCEEFC7A
  • 3.5.5 - FB78B8E5-8766-4E1E-BE6B-8E8362FA94A8
  • 3.5.4 - 3124D64F-F72B-41C6-AF35-4ACCBDDFC54A
  • 3.5.3 - 368A06CC-909A-4F55-AF29-6CFCCEA02479
  • 3.5.2 - 7604F21E-DAD2-4098-98CB-5552AABA58E9
  • 3.5.1 - 90B4BD24-B33F-429B-AE16-06E325195D46
  • 3.5.0 - ECF59E8B-3C98-4F89-9D98-3392A4A3B31F
  • 3.4.5 - DA80782F-847B-41DC-84C7-466606468066
  • 3.4.3 - 3759AE04-BB49-4299-B342-2EA611394620

LibreOffice 3.6.0 WPKG 1.3

 <package
  id="libreoffice" 
  name="LibreOffice" 
  revision="%version%"
  reboot="false" 
  priority="70">
  
  <variable name="version" value="3.6.0.4" />
  <variable name="LANG" value="IS1078=0 IS1025=0 IS1101=0 IS1610=0 IS1059=0 IS1026=0 IS2117=0 IS2121=0 IS1150=0 IS1603=0 IS5146=0 IS1027=0 IS32771=0 IS1029=0 IS1106=0 IS1030=0 IS1031=0 IS1604=0 IS2129=0 IS1032=0 IS2057=0 IS7177=0 IS1553=0 IS1061=0 IS1069=0 IS1065=0 IS1035=0 IS1036=0 IS2108=0 IS1084=0 IS1110=0 IS1095=0 IS1037=0 IS1081=0 IS1050=0 IS1038=0 IS1057=0 IS1039=0 IS1040=0 IS1041=0 IS1079=0 IS1087=0 IS1107=0 IS1099=0 IS1042=0 IS1111=0 IS1120=0 IS1574=0 IS1134=0 IS1108=0 IS1063=0 IS1062=0 IS1605=0 IS1071=0 IS1100=0 IS1104=0 IS1112=0 IS1102=0 IS1109=0 IS1044=0 IS1121=0 IS1043=0 IS2068=0 IS1580=0 IS1132=0 IS1154=0 IS2162=0 IS1096=0 IS1094=0 IS1045=0 IS2070=0 IS1046=0 IS1048=0 IS1049=0 IS1569=0 IS1103=0 IS1606=0 IS1113=0 IS2074=0 IS2133=0 IS1051=0 IS1060=0 IS1052=0 IS3098=0 IS1579=0 IS1072=0 IS1053=0 IS1089=0 IS1097=0 IS1098=0 IS1064=0 IS1054=0 IS1074=0 IS1055=0 IS1073=0 IS1092=0 IS1152=0 IS1058=0 IS1091=0 IS1075=0 IS1066=0 IS1076=0 IS2052=0 IS1028=0 IS1077=0 IS1050=0 IS1033=1 IS1034=0" />
  <variable name="ASSO" value="SELECT_WORD=1 SELECT_EXCEL=1 SELECT_POWERPOINT=1" />
 
  <check type="uninstall" condition="versiongreaterorequal" path="LibreOffice .+" value="%version%" />
 
  <install cmd='msiexec /qb! /i "%SOFTWARE%\LibO_3.6.0_Win_x86_install_multi.msi" ALLUSERS=1 CREATEDESKTOPLINK=1 REGISTER_ALL_MSO_TYPES=1 ISCHECKFORPRODUCTUPDATE=0 %LANG%' />
 
  <upgrade include="install" />
  
  <remove cmd="msiexec /qb! /uninstall {AFD5A54E-E9A1-413D-8AA2-C9EDB6782400}" />
 
 </package>

LibreOffice 3.5.x Custom Script

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
    set FILEASSOC=1
    
    :: 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      Install 4J 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'.