Deployment and Migration
22 May 2015: some outstanding things to do are listed on the Discussion tab.
This page currently concerns deployments only on the Windows platform; however, a lot is relevant for all platforms.
- 1 Prerequisites
- 2 Testing Plan, Deployment and Migration Plan
- 3 Business case proposal for upgrading to LibreOffice
- 4 Silent and Unattended Installations
- 5 Extension installation
- 6 Deploying via Group Policy Objects (GPO)
- 7 MSI file manipulation / MST transform creation
- 8 Post deployment configuration
- 9 Removing LibreOffice and Help Pack
There are 2 versions of LibreOffice for Windows.
- a 32-bit version for 32-bit and 64-bit Windows
- a 64-bit version for 64-bit Windows, starting with LibreOffice 5.0.
You do not need to uninstall an earlier version of LibreOffice if it is version 3.4.5 or higher; preferences are preserved and the old installation will be overwritten. Versions lower than 3.4.5 should be uninstalled prior to installation.
OpenOffice.org will not be uninstalled, but you do need to remove the OpenOffice Quickstart if LibreOffice is to be your primary office suite.
LibreOffice 3.5 and above is an MSI file with everything embedded, containing language transforms as substorages, VC redistributables as merge modules and a CAB file is embedded too. Whereas LibreOffice 3.4 and below were seperate files, an EXE file which contained NSIS pre-installer + a setup.exe loader + an MSI file + a separate CAB file + many language transforms + VC redistributable files.
There are many ways to install LibreOffice, and some are as follows:
- For a handful of computers, perhaps up to a dozen, it is probably quickest to just use the GUI at each computer.
- A few dozen computers, simply run a batch file based on the examples given below at each computer.
Silent unattended installations:
- Dozens, or hundreds of computers, use Group Policy computer startup scripts.
- For hundreds of computers get a knowledge of editing MSIs, perhaps using an MSI editor such as ORCA.
- WPKG is an automated software deployment, upgrade and removal program for Windows.
Testing Plan, Deployment and Migration Plan
Before a migration you need a testing plan. This could involve running an installation of LibreOffice alongside an existing office suite. iIt can be configured as the default for OpenDocument files, and other file type defaults can be left as they are until you commence your migration.
Business case proposal for upgrading to LibreOffice
Here is a well-written and compelling business case proposal that works. It is for upgrading to LibreOffice from Microsoft Office 2003; you could easily adapt it for a proposal to upgrade from another office suite such as Microsoft Office 2007 or 2010. It is easy to modify being a Hybrid PDF. First save it locally, then open the PDF from within LibreOffice and edit it as you would a normal document.
Silent and Unattended Installations
Feature and Property parameters can be used as command line options.
ADDLOCAL=ALL, The installed features are core components and they pretty much correspond with the page in the dialog that is only available if you select Custom installation from the GUI. If you want to manipulate the installed components with parameters you must first either identify every single component you want to install or (better) install everything with the parameter ADDLOCAL=ALL and then define everything you don't want with REMOVE.
REMOVE=, Everything you want to remove must be specified in one string using comma as separator and no spaces.
If you use ADDLOCAL=ALL all the dictionaries will be installed, select the ones you want to remove by their language codes, see below for examples of these codes. Dictionaries are also installed as predefined extensions but in the installer process these are categorized as Dictionaries, so you need to add an extra part to the REMOVE like this:
Similarly, we can remove predefined extensions or components like this:
The online update feature is just a check to see if a more recent version is available, with a pop up a message to let the user know when there is. In an enterprise environment it is pointless as staff would normally not be able to upgrade their software. We can completely remove the online update feature, taking it a step further than the ISCHECKFORPRODUCTUPDATES property:
During installation you can set these properties. The list is not complete, here are some examples:
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 (bugged in 4.1.0+, solved in tdf#65102 for 4.1.4 and 4.2.0)
INSTALLLOCATION - specify installation directory
RebootYesNo (default=Yes) – reboot after the installation
ISCHECKFORPRODUCTUPDATES (default=1) - check for updates
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.)
VC_REDIST (default=1) - installs Microsoft Visual C++ Runtime. Since LibreOffice 3.5.4.
QUICKSTART (default=0) - turns on Quickstart, if Quickstart feature is installed. Since LibreOffice 3.6.0.
IS1033 (default=1) – until LibreOffice 3.5.4 all UI languages were installed by default so you had to specify each language that you don't want to install
UI_LANGS - UI language selection. Since LibreOffice 3.5.5
VC_REDIST=0 could save installation time and resources if the C++ Runtime is already installed. The C++ Runtime must be installed before LibreOffice, so the following cmd could precede the LibreOffice installation cmd, it checks for the Runtime and installs it only if needed. In this example msvcr110.dll is shipped with the 32-bit LibreOffice 4.4.2:
If not exist c:\windows\system32\msvcr110.dll c:\file-path-to\vcredist_x86 /q /promptrestart / l c:\file-path-to\vcredist_install_log.txt
To find the version of C++ Runtime is required, install LibreOffice via the GUI as this installs the bundled Runtime, then look in the Control Panel, Programs and Features. Take care though, as if these runtimes are backwards compatible, the install might start and backout, and you don't want this happening everytime the computer starts up as it may waste bandwidth or something.
32-bit msvcr110.dll Microsoft Visual C++ 2010 Redistributable Package (x86). This is required for the 32-bit version of LibreOffice 4.42 (Windows 7 (x86))
64-bit msvcr120.dll Visual Studio 2013 C++ 64-bit redistributable runtime. This is required for the new 64-bit version of LibreOffice 5.00, it has higher system requirements of 512MB (Windows 7 (x86 and x64))
In the unlikely event you get error code 1935 during installation, try to install LibreOffice with VC_REDIST=0
Default silent install selects only those user interface (UI) languages that are among the UI languages available on the system. Language variants are included. This means for example, that there will be 3 UIs for English.
We can add multiple user interface languages, while also removing unnecessary languages, using numeric Locale ID, keeping the primary enabled language last, like this:
IS5146=1 IS1033=1 IS1078=0 IS1025=0
With LibreOffice 3.5.4 UI language selection through IS<lcid> properties does not work during silent install. With LibreOffice 3.5.5 and higher, language selection works as follows.
msiexec /i Lib...._.msi UI_LANGS=en_US,de,fr,hu
Installing English (US), German, French, and Hungarian. There are still some minor issues with language selection, because for example pt_BR also selects pt implicitly, but this is the same as we have with automatic language selection.
When the user tries to fool the installer by giving invalid language codes, installer will fall back to en_US. Also, en_US is not installed by default, unlike with the automatic selection.
Dictionaries: See Tools/Extension Manager to see installed dictionaries. See Tools/Options/Language Settings/Languages for ticked languages that indicates spell checking is available, these correlate to installed shared extensions under C:\Program Files (x86)\LibreOffice 4\share\extensions (Windows 7 and 8.1).
Quickstart, when turned on creates a shortcut that depends on user: "%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\LibreOffice 3.5.lnk" (Windows 7).
Help: A cmd line to install LibreOffice Help for the optional local help files, otherwise online web based help is available
msiexec /qb /i file-path-to\LibreOffice_4.4.2_Win_x86_helppack_en-GB.msi /l* file-path-to\libo_helpinstall_log.txt
UI Language of Installer
LibreOffice Windows installer supports as many languages as LibreOffice itself. It depends on the language set at Region and Language -> Format (Windows 7); you can access the dialog using
intl.cpl command line.
You can force it to start in any language. The following example will start the installer of LibreOffice 3.5.3 in Scottish Gaelic. The number after the colon is the Locale ID of the language.
msiexec /i LibO_3.5.3_Win_x86_install_multi.msi TRANSFORMS=:1084
You likely will not be able to force English (US) language (1033) this way, because there's no embedded transform for it (it is used as the base language of installer). For this case, temporarily setting language through Format tab of intl.cpl should do the job.
Or use ProductLanguage property with decimal [MS-LCID] value for any language supported by installer:
msiexec /i LibreOffice_X.Y.Z_Win_x64.msi ProductLanguage=1033
Note that this doesn't affect the language of installer when editing (adding/removing components/uninstalling) already installed version.
Example 1 - Install LibreOffice in tandem with another office suite.
Installs LibreOffice as the default office suite for OpenDocument files, leaving other file types unchanged. So everyone can do this, irrespective of whether a migration to LibreOffice has been planned yet. At the very minimum this is justifyable as a backup office suite, mitigating against licensing issues or rogue updates breaking another office suite.
This example installs LibreOffice 4.4.2 to become the default app for OpenDocument files, MS Office file types are not changed. It creates an install log, English_GB UI, no Online update, no Reboot, Quickstart off, no Visual C++ Runtime, leaving English and French dictionaries:
If you want to remove the French dictionary add gm_r_ex_Dictionary_Fr, or for English gm_r_ex_Dictionary_En
Other distributions or versions of LibrOffice may ship with different optional features in the MSI, if there is a problem with trying to remove a non-existing feature, there will be an error and it can be easilly fixed.
The log file details the installation process, in this you can see most of the properties that you can set in the installation.
Written as one line:
msiexec /qb /i LibreOffice_4.4.2_Win_x86.msi /l* LibreOffice_install_log.txt REGISTER_NO_MSO_TYPES=1 UI_LANGS=en_GB ISCHECKFORPRODUCTUPDATES=0 \ REBOOTYESNO=No QUICKSTART=0 ADDLOCAL=ALL VC_REDIST=0 \ REMOVE=gm_o_Onlineupdate,gm_r_ex_Dictionary_Af,gm_r_ex_Dictionary_An,gm_r_ex_Dictionary_Ar,gm_r_ex_Dictionary_Be, gm_r_ex_Dictionary_Bg, \ gm_r_ex_Dictionary_Bn,gm_r_ex_Dictionary_Br,gm_r_ex_Dictionary_Pt_Br,gm_r_ex_Dictionary_Pt_Pt,gm_r_ex_Dictionary_Ca,gm_r_ex_Dictionary_Cs, \ gm_r_ex_Dictionary_Da,gm_r_ex_Dictionary_Nl,gm_r_ex_Dictionary_Et,gm_r_ex_Dictionary_Gd,gm_r_ex_Dictionary_Gl,gm_r_ex_Dictionary_Gu, \ gm_r_ex_Dictionary_De,gm_r_ex_Dictionary_He,gm_r_ex_Dictionary_Hi,gm_r_ex_Dictionary_Hu,gm_r_ex_Dictionary_It,gm_r_ex_Dictionary_Lt, \ gm_r_ex_Dictionary_Lv,gm_r_ex_Dictionary_Ne,gm_r_ex_Dictionary_No,gm_r_ex_Dictionary_Oc,gm_r_ex_Dictionary_Pl,gm_r_ex_Dictionary_Ro, \ gm_r_ex_Dictionary_Ru,gm_r_ex_Dictionary_Si,gm_r_ex_Dictionary_Sk,gm_r_ex_Dictionary_Sl,gm_r_ex_Dictionary_El,gm_r_ex_Dictionary_Es, \ gm_r_ex_Dictionary_Sv,gm_r_ex_Dictionary_Te,gm_r_ex_Dictionary_Th,gm_r_ex_Dictionary_Vi,gm_r_ex_Dictionary_Zu
Example2: LibreOffice as default office suite.
Installs LibreOffice as the default office suite for OpenDocument files and also Microsoft's proprietary binary and OOXML files. Existing office suites can remain installed and can still be used with “Open with”, until you choose to remove them later on.
The command is the same as the example above, just replace REGISTER_NO_MSO_TYPES=0 with REGISTER_ALL_MSO_TYPES=1
Examples for older versions of LibreOffice:
Older versions of LibreOffice may different components, also the old shortened filename LibO is used.
The following is for LibreOffice 3.6.4, with log included, all file types registered, English (US), French, Hungarian and Bosnian UI languages, without Online update, Quickstart turned on, without Visual C++ Runtime, or mobile components, leaving English, French, Croatian and Serbian dictionaries.
msiexec /qn /i LibO_3.6.4_Win_x86_install_multi.msi /l* LibreOffice_install_log.txt SELECT_WORD=1 SELECT_EXCEL=1 SELECT_POWERPOINT=1 \ REGISTER_ALL_MSO_TYPES=1 UI_LANGS=en_US,fr,hu,bs RebootYesNo=No ISCHECKFORPRODUCTUPDATES=0 QUICKSTART=1 VC_REDIST=0 \ ADDLOCAL=ALL REMOVE=gm_o_Onlineupdate,gm_o_jf_Palm,gm_o_jf_Pocketpc,gm_r_ex_Dictionary_Af,gm_r_ex_Dictionary_An,\ gm_r_ex_Dictionary_Ar,gm_r_ex_Dictionary_Be,gm_r_ex_Dictionary_Bg,gm_r_ex_Dictionary_Bn,gm_r_ex_Dictionary_Br,\ gm_r_ex_Dictionary_Pt_Br,gm_r_ex_Dictionary_Pt_Pt,gm_r_ex_Dictionary_Ca,gm_r_ex_Dictionary_Cs,gm_r_ex_Dictionary_Da,\ gm_r_ex_Dictionary_Nl,gm_r_ex_Dictionary_Et,gm_r_ex_Dictionary_Gd,gm_r_ex_Dictionary_Gl,gm_r_ex_Dictionary_Gu,gm_r_ex_Dictionary_De,\ gm_r_ex_Dictionary_He,gm_r_ex_Dictionary_Hi,gm_r_ex_Dictionary_Hu,gm_r_ex_Dictionary_It,gm_r_ex_Dictionary_Ku_Tr,gm_r_ex_Dictionary_Lt,\ gm_r_ex_Dictionary_Lv,gm_r_ex_Dictionary_Ne,gm_r_ex_Dictionary_No,gm_r_ex_Dictionary_Oc,gm_r_ex_Dictionary_Pl,\ gm_r_ex_Dictionary_Ro,gm_r_ex_Dictionary_Ru,gm_r_ex_Dictionary_Si,gm_r_ex_Dictionary_Sk,gm_r_ex_Dictionary_Sl,gm_r_ex_Dictionary_El,\ gm_r_ex_Dictionary_Es,gm_r_ex_Dictionary_Sv,gm_r_ex_Dictionary_Te,gm_r_ex_Dictionary_Th,gm_r_ex_Dictionary_Uk,gm_r_ex_Dictionary_Vi,\ gm_r_ex_Dictionary_Zu
The following is for LibreOffice 3.5.2, with log included, a selection of dictionaries, English, French, Spanish, Italian, German, Russian, Bosnian, Croatian and Serbian UI languages, all file types registered, without Online update or mobile components, with Quickstart feature (but not turned on):
msiexec /qn /i LibO_3.5.2_Win_x86_install_multi.msi /l* LibreOffice_install_log.txt SELECT_WORD=1 \ SELECT_EXCEL=1 SELECT_POWERPOINT=1 REGISTER_ALL_MSO_TYPES=1 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=1 \ IS1604=0 IS2129=0 IS1032=0 IS2057=0 IS7177=0 IS1553=0 IS1034=1 IS1061=0 IS1069=0 IS1065=0 IS1035=0 IS1036=1\ IS2108=0 IS1084=0 IS1110=0 IS1095=0 IS1037=0 IS1081=0 IS1050=1 IS1038=0 IS1057=0 IS1039=0 IS1040=1 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=1 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=1 IS1033=1 ADDLOCAL=ALL RebootYesNo=No \ REMOVE=gm_o_Onlineupdate,gm_o_jf_Palm,gm_o_jf_Pocketpc,gm_r_ex_Dictionary_Af,gm_r_ex_Dictionary_An,\ gm_r_ex_Dictionary_Ar,gm_r_ex_Dictionary_Be,gm_r_ex_Dictionary_Bg,gm_r_ex_Dictionary_Bn,gm_r_ex_Dictionary_Br,\ gm_r_ex_Dictionary_Pt,gm_r_ex_Dictionary_Pt_Pt,gm_r_ex_Dictionary_Ca,gm_r_ex_Dictionary_Cs,gm_r_ex_Dictionary_Da,\ gm_r_ex_Dictionary_Nl,gm_r_ex_Dictionary_Et,gm_r_ex_Dictionary_Gd,gm_r_ex_Dictionary_Gl,gm_r_ex_Dictionary_Gu,\ gm_r_ex_Dictionary_He,gm_r_ex_Dictionary_Hi,gm_r_ex_Dictionary_Hu,gm_r_ex_Dictionary_Ku_Tr,gm_r_ex_Dictionary_Lt,\ gm_r_ex_Dictionary_Lv,gm_r_ex_Dictionary_Ne,gm_r_ex_Dictionary_No,gm_r_ex_Dictionary_Oc,gm_r_ex_Dictionary_Pl,\ gm_r_ex_Dictionary_Ro,gm_r_ex_Dictionary_Si,gm_r_ex_Dictionary_Sk,gm_r_ex_Dictionary_Sl,gm_r_ex_Dictionary_El,\ gm_r_ex_Dictionary_Sv,gm_r_ex_Dictionary_Te,gm_r_ex_Dictionary_Th,gm_r_ex_Dictionary_Uk,gm_r_ex_Dictionary_Vi,\ gm_r_ex_Dictionary_Zu
Extensions can be managed using UNOPKG, it can also manage shared extensions. For help use unopkg -h. For 64-bit machines replace %PROGRAMFILES% with %PROGRAMFILES(x86)% accordingly. e.g. to add an extension:
"%PROGRAMFILES%\LibreOffice 4\program\unopkg add --suppress-license --shared \\server\LibreOffice\Extension.oxt"
Deploying via Group Policy Objects (GPO)
Computer startup script
Programs can be started automatically at computer startup / shutdown with administrator privilege silently in the background. You can use this to run a script or batch file that installs LibreOffice when needed. See Microsoft's Group Policy computer startup scripts.
The following is an idea of a way that you could do this:
Set up a new Group Policy Object on the Domain Controller called LibreOffice and link it to your domain. Go to the Scope tab, under Security Filtering, remove Authenticated Users and add the computer objects for the workstations you want to install LibreOffice on. By filtering to computer objects, you an control which machines the GPO will and won't be applied to. You could keep it simpler and just replace Authenticated Users with Domain Computers to deploy the software to every workstation in the domain, or perhaps look into filtering by Organisational Unit which would be useful for installing to departments at different times.
Go to the Details tab of the LibreOffice Group Policy Object and change the status from Enabled to User configuration settings disabled. The only thing this GPO does is run a startup script to install VCredist, LibreOffice its offline help pack. This is because startup scripts are managed under computer configuration settings not user, so this might save a milli-second. :-)
LibreOffice.vbs: Open up the LibreOffice Group Policy Object in the Group Policy Management Editor, under Computer Configuration expand Policies, then Windows Settings. Select Scripts (Startup/Shutdown) and open up Startup Properties. Left-click Show Files and create an empty text file called LibreOffice.vbs (or whatever you prefer), enter the following using Notepad:
bDebug = False Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_USERS = &H80000003 Set Reg = GetObject("winMgMts:StdRegProv") iRet = Reg.EnumKey(HKEY_USERS, "S-1-5-19", AKeys) If iRet <> 0 Then Dim UAC : Set UAC = CreateObject("Shell.Application") UAC.ShellExecute WScript.FullName, Chr(34) & WScript.ScriptFullName & Chr(34), "", "runas", 1 WScript.Quit End If Dim WshShell : Set WshShell = CreateObject("WScript.Shell") Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject") Set WI = CreateObject("WindowsInstaller.Installer") Const msiOpenDatabaseModeReadOnly = 0 ' https://msdn.microsoft.com/en-us/library/windows/desktop/aa369487(v=vs.85).aspx Const msiUILevelBasic = 3 Const msiUILevelNone = 2 Const msiUILevelHideCancel = 32 WI.UILevel = msiUILevelBasic Dim InstallSource : InstallSource = objFSO.GetParentFolderName(Wscript.ScriptFullName) Set objFolder = objFSO.GetFolder(InstallSource) Set colFiles = objFolder.Files Dim LibreOfficeSetup, LibreOfficeSetupVersion Dim LibreOfficeHelpPack, LibreOfficeHelpPackVersion Dim Name, Version, InstallLocation, LocalPackage, ProductCode For Each objFile in colFiles If LCase(objFSO.GetExtensionName(objFile.Name)) = "msi" Then ' If bDebug Then Wscript.Echo objFile.Name & " (" & objFSO.GetExtensionName(objFile.Name) & ")" On Error Resume Next Set db = WI.OpenDatabase(objFSO.BuildPath(InstallSource, objFile.Name), msiOpenDatabaseModeReadOnly) If (Err.Number <> 0) Then If bDebug Then Wscript.Echo Err.Source & " " & Hex(Err) & ": " & Err.Description Wscript.Quit(1) End If On Error Goto 0 Set view = db.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'ProductName'") view.Execute() Name = view.Fetch().StringData(1) ' If bDebug Then Wscript.Echo Name If Left(Name, Len("LibreOffice")) = "LibreOffice" Then Set view = db.OpenView("SELECT `Value` FROM `Property` WHERE `Property` = 'ProductVersion'") view.Execute() Version = view.Fetch().StringData(1) If InStr(Name, "Help Pack") Then If IsEmpty(LibreOfficeHelpPackVersion) Or Replace(LibreOfficeHelpPackVersion, ".", "") < Replace(Version, ".", "") Then LibreOfficeHelpPack = objFile.Name LibreOfficeHelpPackVersion = Version End If Else If IsEmpty(LibreOfficeSetupVersion) Or Replace(LibreOfficeSetupVersion, ".", "") < Replace(Version, ".", "") Then LibreOfficeSetup = objFile.Name LibreOfficeSetupVersion = Version End If End If End If End If Next If bDebug Then Wscript.Echo "LibreOfficeSetup = " & LibreOfficeSetup & " (" & LibreOfficeSetupVersion & ")" & vbNewLine & _ "LibreOfficeHelpPack = " & LibreOfficeHelpPack & " (" & LibreOfficeHelpPackVersion & ")" End If If IsEmpty(LibreOfficeSetup) Then WScript.Quit(2) Set Products = WI.Products 'For Each Product In Products ' On Error Resume Next ' Name = WI.ProductInfo(Product, "ProductName") ' If Left(Name, Len("LibreOffice")) = "LibreOffice" And InStr(Name, "Help Pack") Then ' Version = DecodeVersion(WI.ProductInfo(Product, "Version")) ' If IsEmpty(LibreOfficeHelpPack) And Replace(Version, ".", "") < Replace(LibreOfficeSetupVersion, ".", "") Then ' Uninstall(Product) ' End If ' Exit For ' End If 'Next bInstallLibreOffice = True bInstallLibreOfficeHelpPack = Not(IsEmpty(LibreOfficeHelpPack)) For Each Product In Products On Error Resume Next Name = WI.ProductInfo(Product, "ProductName") Version = DecodeVersion(WI.ProductInfo(Product, "Version")) ' objFSO.GetFileVersion(InstallLocation & "\program\swriter.exe") If Left(Name, Len("LibreOffice")) = "LibreOffice" Then If InStr(Name, "Help Pack") Then If Replace(Version, ".", "") >= Replace(Left(LibreOfficeHelpPackVersion, Len(Version)), ".", "") Then bInstallLibreOfficeHelpPack = False End If Else If Replace(Version, ".", "") >= Replace(Left(LibreOfficeSetupVersion, Len(Version)), ".", "") Then bInstallLibreOffice = False End If End If If bDebug Then s1 = s1 & Name & " (" & Version & ") - " & Product & vbNewLine End If If Left(Name, Len("OpenOffice.org")) = "OpenOffice.org" Then Uninstall(Product) End If If bDebug Then s2 = s2 & Name & " (" & Version & ") - " & Product & " " Next If bDebug Then Wscript.Echo s1 & vbNewLine & "bInstallLibreOffice = " & bInstallLibreOffice & vbNewLine & _ "bInstallLibreOfficeHelpPack = " & bInstallLibreOfficeHelpPack Wscript.Echo s2 'Wscript.Quit(0) End If If bInstallLibreOffice Then Dim Temp : Temp = objFSO.GetSpecialFolder(2) ' VCRedist ' WshShell.Run """" & objFSO.BuildPath(InstallSource, "vcredist_x86.exe") & """ /q /promptrestart / l """ & Temp & "\vcredist_install_log.txt""" WI.EnableLog "voicewarmup", objFSO.BuildPath(Temp, "LibreOffice_install_log.txt") WI.InstallProduct objFSO.BuildPath(InstallSource, LibreOfficeSetup), "ALLUSERS=1 ISCHECKFORPRODUCTUPDATES=0 RebootYesNo=No REBOOT=ReallySuppress" ' WshShell.Run "msiexec /i """ & objFSO.BuildPath(InstallSource, LibreOfficeSetup) & """ /qb /norestart ALLUSERS=1 ISCHECKFORPRODUCTUPDATES=0 RebootYesNo=No REBOOT=ReallySuppress /l* """ & Temp & "\LibreOffice_install_log.txt""" Set Products = WI.Products For Each Product In Products On Error Resume Next Name = WI.ProductInfo(Product, "ProductName") If Left(Name, Len("LibreOffice")) = "LibreOffice" Then InstallLocation = WI.ProductInfo(Product, "InstallLocation") End If Next If IsEmpty(InstallLocation) Then If WshShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%") <> "x86" Then ProgramFiles = WshShell.ExpandEnvironmentStrings("%ProgramFiles%") Else ProgramFiles = WshShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%") End If Dim objFolder, objSubFolders, objSubFolder Set objFolder = objFSO.GetFolder(ProgramFiles) Set colSubFolders = objFolder.SubFolders For Each objSubFolder In colSubFolders If Left(objSubFolder.Name, Len("LibreOffice")) = "LibreOffice" Then If objFSO.FileExists(ProgramFiles & "\" & objSubFolder.Name & "\program\swriter.exe") Then InstallLocation = ProgramFiles & "\" & objSubFolder.Name & "\" Exit For End If End If Next End If If IsEmpty(InstallLocation) Then Wscript.Quit(3) If objFSO.FileExists(objFSO.BuildPath(InstallSource, "MacroSecurityLevel.xcd")) Then objFSO.CopyFile objFSO.BuildPath(InstallSource, "MacroSecurityLevel.xcd"), InstallLocation & "share\registry" End If End If If bInstallLibreOfficeHelpPack Then WI.EnableLog "voicewarmup", objFSO.BuildPath(Temp, "libo_helpinstall_log.txt") WI.InstallProduct objFSO.BuildPath(InstallSource, LibreOfficeHelpPack), "RebootYesNo=No REBOOT=ReallySuppress" ' WshShell.Run "msiexec /i """ & objFSO.BuildPath(InstallSource, LibreOfficeHelpPack) & """ /qb /norestart RebootYesNo=No REBOOT=ReallySuppress /l* """ & Temp & "\libo_helpinstall_log.txt""" End If Sub Uninstall(Product) On Error Resume Next LocalPackage = WI.ProductInfo(Product, "LocalPackage") If Not IsEmpty(LocalPackage) Then WI.InstallProduct LocalPackage, "REMOVE=ALL" Else WshShell.Run "msiexec /qb! /uninstall " & Product, 0, True End If End Sub Function DecodeVersion(version) On Error Resume Next version = CLng(version) DecodeVersion = version\65536\256 & "." & (version\65535 MOD 256) & "." & (version Mod 65536) End Function
Save and exit Notepad.
In Startup Properties left-click Add. The Add a Script dialogue box appears and browse to open another Explorer window and select LibreOffice.vbs script, OK back to Startup Properties. The script should now be listed under Startup Scripts for LibreOffice. OK to close Startup Properties, and close all others.
The new Group Policy Object will now run LibreOffice.vbs on the workstations every time they're switched on if it is not installed or when upgrading from an older version is required.
While GPO installation is possible, bear in mind that unattended MSI installation installs all dictionaries by default. See tdf#45750 about potential issues with deployment via GPO.
Managed software deployment
This is the recommended method as you can centrally manage which version of LibO is installed on various machines in Active Directory as well as centrally deploy upgrades just by adding a newer package to the GPO.
- Download the installer for the version of LibO you want to deploy.
- Open the MSI file in ORCA or InstEd. (See the section on MSI editing for download links.)
- Go to ▸ in ORCA or ▸ in InstEd.
- Remove some of the language codes listed in the Languages field, making sure to keep at least the one(s) you need. http://www.science.co.il/language/locale-codes.asp (This is required to avoid an error when adding the package to the GPO.)
- Save the MSI to a network location where all machine accounts have Read access.
- If you wish to customize the installation, create a Transform using ▸
- Click the Property table on the left, then make your changes on the right as described in the MSI editing section.
- Save the transform to a network location where all machine accounts have Read access.
- (You can create as many transforms with different options as you like and use them with the single MSI file.)
- Start the Group Policy Management tool (gpmc.msc)
- Expand your domain, right-click Group Policy Objects and click New. Name it something useful like "Deploy LibreOffice." (Skip this step if you're just upgrading LibO.)
- Right-click "Deploy LibreOffice" and click Edit...
- Go to ▸ ▸ ▸
- Right-click the right pane and click ▸
- Browse to the network location (e.g. \\server\share\foo) where the MSI file is stored and select it.
- Choose Advanced & click OK.
- Check that all of the options are as you like. (If you've done this before, the Upgrades tab will show older versions that will be automatically upgraded by this new package.)
- If you want to include a transform, click the Modifications tab, click Add, and browse to the network location where the MST file is located.
- Click OK & close the GPO editor.
- Back in the main editor, right-click the "Deploy LibreOffice" policy, click ▸ so that it's checked. (Saves a bit of processing time since we only changed Computer settings.)
- Drag this policy on top of the OU containing the machines to which you want to deploy LibO.
- After about 10 minutes, the machines in the OU will have the policy. The next time they restart, they will install/upgrade LibO automatically.
MSI file manipulation / MST transform creation
You can manipulate the MSI file or create an MST transform file using a program like ORCA or InstEd. You'll only be editing the Property table. The parameters explained above apply here as well. Edit (or add) rows in the table that correspond to the items you wish to change.
To restrict which UI languages are installed:
- Add a row with property UI_LANGS and set its value to a comma-separated list of the languages you would like available for the user interface (e.g. en_US,it,es)
To install only certain items:
- Add a row with property ADDLOCAL and set its value to ALL.
- Add another called REMOVE and set it to a comma-separated list of the items you don't want installed, just like in the command-line installation examples above. (This is particularly useful to limit which spelling dictionaries are installed as the full set can take up considerable disk space.) The list of possible items to put here can be found in the "Feature" column of the Feature table. (Note that you don't need to worry about any "langpack" items since the UI_LANGS property mentioned above will handle excluding them.)
- Alternatively, you could set REMOVE to ALL and specify a list of comma-separated items you want installed for ADDLOCAL, but this method requires more care since you need to make sure you include any dependent items as well.
Post deployment configuration
MSIEXEC silent installation doesn't allow the control of all parameters.
▸ ▸ ▸ is set to High. In order to be able to open a macro it needs to be set to Medium.
Language settings are set to default values.▸ ▸ ▸ ▸ , ▸ ▸ ▸ and ▸ ▸ ▸ ▸ cannot be set during silent installation.
Similar, default format for documents available in GUI under▸ ▸ ▸ cannot be set during silent installation.
These settings are mostly personal and stored in a specific file registrymodifications.xcu. Toolbars and icons are also personal. For example, custom Writer toolbars are in "%userprofile%\AppData\...\LibreOffice\4\user\config\soffice.cfg\modules\swriter\toolbar".
Some tricks for post deployment configuration
In some situations, such as decreasing the Macro security levels on a silent install, or configuring an option for the installation, can be performed by placing a XML file in the right place, after LibreOffice is installed and with the help of a script or automated tool. For example the following XML file with .xcd extension can be placed in
and will set macro security level to Medium
<?xml version="1.0"?> <oor:data xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oor="http://openoffice.org/2001/registry"> <dependency file="main" /> <oor:component-data xmlns:install="http://openoffice.org/2004/installation" oor:name="Common" oor:package="org.openoffice.Office"> <node oor:name="Security"> <node oor:name="Scripting"> <prop oor:name="MacroSecurityLevel" oor:op="fuse"> <value>1</value> </prop> </node> </node> </oor:component-data> </oor:data>
This example sets the experimental features on (for macro recording)
<?xml version="1.0"?> <oor:data xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oor="http://openoffice.org/2001/registry"> <dependency file="main" /> <oor:component-data xmlns:install="http://openoffice.org/2004/installation" oor:name="Common" oor:package="org.openoffice.Office"> <node oor:name="Misc"> <prop oor:name="ExperimentalMode" oor:op="fuse" oor:type="xs:boolean"> <value>true</value> </prop> </node> </oor:component-data> </oor:data>
Any of the 25,000 LibreOffice settings can be configured and managed through Windows Registry, this can be managed through one or more Group Policies in the Active Directory or similar administration system.
e.g. Set “Macro security level” to “High” and lock the settings:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Security\Scripting\MacroSecurityLevel] "Value"="2" "Final"=dword:00000001
Read about it in the LibreOffice 4.2 Release Notes. Also see Windows Group Policy ADMX files below
Windows Group Policy ADMX files
LibreOffice can be configured and managed in a Windows Domain using Group Policy ADMX files. For more information also see:
Removing LibreOffice and Help Pack
On a system with LibreOffice already installed, you can get the uninstall string for that particular version, the same one for all languages. Create an empty text file called LibreOfficeUninstall.vbs (or whatever you prefer), enter the following using Notepad:
Const HKEY_LOCAL_MACHINE = &H80000002 Const HKEY_USERS = &H80000003 Set Reg = GetObject("winMgMts:StdRegProv") iRet = Reg.EnumKey(HKEY_USERS, "S-1-5-19", AKeys) If iRet <> 0 Then Dim UAC : Set UAC = CreateObject("Shell.Application") UAC.ShellExecute WScript.FullName, Chr(34) & WScript.ScriptFullName & Chr(34), "", "runas", 1 WScript.Quit End If Set WI = CreateObject("WindowsInstaller.Installer") Dim WshShell : Set WshShell = CreateObject("WScript.Shell") ' https://msdn.microsoft.com/en-us/library/windows/desktop/aa369487(v=vs.85).aspx Const msiUILevelBasic = 3 Const msiUILevelNone = 2 Const msiUILevelHideCancel = 32 WI.UILevel = msiUILevelBasic Set Products = WI.Products For Each Product In Products On Error Resume Next Name = WI.ProductInfo(Product, "ProductName") If Left(Name, Len("LibreOffice")) = "LibreOffice" Then LocalPackage = WI.ProductInfo(Product, "LocalPackage") If Not IsEmpty(LocalPackage) Then WI.InstallProduct LocalPackage, "REMOVE=ALL" Else WshShell.Run "msiexec /qb! /uninstall " & Product, 0, True End If End If Next
Save, exit Notepad and run the script.