Tuesday, November 27, 2007

OpenOffice as Windows Service AKA How to install SRVANY and live happy

Install OpenOffice as Windows Service is not so easy as it seems. You could spent an afternoon or more to understand why it wont start! So I hope this could help somebody.

To install OpenOffice as Windows Service you need two application, SRVANY.EXE and INSTSRV.EXE. You can download it from the Windows Server 2003 Resource Kit Tools at Microsoft Download Center .

I suppose you have already installed OpenOffice and you have also have started it as Administrator. It is important after the first start that you agree the license. If you first don't agree the license after the service won't start as Service.

The easiest way after you have installed OpenOffice (at this moment I have installed the version 2.3) is:

copy c:\Program Files\Windows Resource Kits\Tools\SRVANY.EXE C:\Windows\system32\

instsrv.exe "OpenOffice" c:\WINDOWS\system32\SRVANY.EXE

and add the following key into the registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OpenOffice]
"DisplayName"="Resin - OpenOffice"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OpenOffice\Parameters]
"AppParameters"="-headless -accept=socket,host=0.0.0.0,port=8100;urp;"
"Application"="C:\\OpenOffice.org.2.3\\program\\soffice.exe"
"AppDirectory"="C:\\OpenOffice.org.2.3"

to load these lines automatically you could copy into a OpenOffice.reg file and double click on the new file.