Creating a Windows Service lets you have an OpenOffice.org instance always running as a service and listening for connections. That’s what you usually want to do on a server machine. Here is one way to create a Windows Service: use the SRVANY utility that you can download for free as part of the Resource Kit. (This was done on an XP SP2, YMMV.)
- I assume you already installed OpenOffice.org and started at least once under the current user
- Download and install the Windows Server 2003 Resource Kit Tools
- Read How To Create a User-Defined Service
- Create a service named OpenOfficeUnoServer following the instructions above; as the Application registry value use C:\Program Files\OpenOffice.org 2.0\program\soffice.exe
- Add another value to the Parameters key named AppParameters and set it to -headless -accept=socket,port=8100;urp;
- From Control Panel / Administrative Tools / Services open the Properties for the new service and change the Log On account to be Local Service which is a more secure option than SYSTEM
- If we stop here the service will start but not actually work. That’s because the service runs as a special account and OpenOffice.org will try to show the license agreement dialog as if it was a new user instead of starting the application. To avoid this, you need to edit share\registry\data\org\openoffice\Setup.xcu (it’s an XML file) inside the OpenOffice.org installation directory and replace this bit
<prop oor:name="ooSetupInstCompleted"> <value>false</value> </prop> <prop oor:name="ooSetupShowIntro"> <value>true</value> </prop>
with this other one (replace the date with today’s date; it must be later than the OOo installation time)
<prop oor:name="ooSetupInstCompleted" oor:type="xs:boolean"> <value>true</value> </prop> <prop oor:name="LicenseAcceptDate" oor:type="xs:string"> <value>2006-07-25T17:34:04</value> </prop> <prop oor:name="FirstStartWizardCompleted" oor:type="xs:boolean"> <value>true</value> </prop>
- Start your new service (e.g. from Control Panel / Administrative Tools / Services)
- You may need to unblock the new service at the firewall level
- From a command prompt do
> netstat -anp tcp
this should show a listening on port 8100. Chances are that the service will only listen on the 127.0.0.1 interface; this means you can only connect from the same machine and it’s good from a security point of view. However, if you want to be able to connect from other machines as well you need to change the accept string to "socket,host=0.0.0.0,port=8100;urp;" in the AppParameters registry value