Lodahl's blog: Managing settings (on Windows)

13 October 2014

Managing settings (on Windows)

I have written quite a few articles about installation and administration of LibreOffice on Windows. My latest post was an update on the installation parameters (read it here: http://lodahl.blogspot.dk/2014/09/silent-installation-on-windows-again.html ).

This time I will write about a new and very convenient way of managing the user settings on each desktop computer. In earlier versions settings could be manipulated by installing an extension with some XML-files. Nice but not perfect as you had to distribute files to each and every computer. This method is on the other hand independent of operating system so the same extension can be used for both Mac, Linux and Windows computers.

From LibreOffice 4.2 its possible to change settings through the Windows Registry and this can be managed through one or more Group Policies in the Active Directory or similar administration system.

Read more about that here: https://wiki.documentfoundation.org/ReleaseNotes/4.2#Windows_Registry_changes.
 You can find some more detailed examples here: http://ask.libreoffice.org/en/question/29537/42-registry-configuration-backend-not-applying-all-settings/.

In this example I needed to make two small changes:

  1. Set “Warn alien format” to “false” and lock the setting. 
  2. Set “Macro security level” to “High” and lock the settings.
All I needed to do was to create two new keys in the Windows Registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Save\Document\WarnAlienFormat]
"Value"="false" 
"Final"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Security\Scripting\MacroSecurityLevel]
"Value"="2" 
"Final"=dword:00000001


Export

When you have implemented the new keys on one computer and tested it, you can easily export the new keys.

Select the branch of the registry tree (HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common) and click Files - Export. In the dialogue you should select Selected branch and enter the name "Common" because that is the brach you want to export.

Click Save and you will get a Common.reg-file with the following content:

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Save][HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Save\Document][HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Save\Document\WarnAlienFormat]
"Value"="false"
"Final"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Security]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Security\Scripting]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Common\Security\Scripting\MacroSecurityLevel]
"Value"="2"
"Final"=dword:00000001 
This file can easily be imported on other computers or you can push them to the computers through a new Group Policy to the machines:
You create a new Group Policy object and link it to the OU you have configured for all the relevant users in the domain.
  1. You open it up and edit “User Configuration | Windows Settings | Scripts (Logon/Logoff).
  2. Under the Logon node, you add you settings so that regedit.exe calls your Common.reg file silently (with the /s switch): REGEDIT.EXE Common.reg /s
  3. You click Show Files and drop your Common.reg into SYSVOL. 

Some information about Microsoft Windows Registry:
http://technet.microsoft.com/en-us/library/cc753092.aspx http://blog.thesysadmins.co.uk/group-policy-preferences-1-deploying-registry-settings.html
http://blogs.technet.com/b/askds/archive/2007/08/14/deploying-custom-registry-changes-through-group-policy.aspx

Conclusion

I must say this is a much easier approach than the extension method and it makes the whole setup much more flexible since we don't need to handle extensions on each computer any more. For enterprises I recommend using this method for future maintenance.

1 comment:

Anonymous said...

I hope some more info will available about those famous ADM(X) examples from LibreOffice deployment presentations... Seems creators are not willing to write whether they will be open sourced or sold separately. In the meantime one can check this GitHub project: https://github.com/somedowntime/libreofficegrouppolicy.