OpenOffice and Background Processes

Damn I hate OpenOffice sometimes! I'm sure it's a great app for an end-user, but its API could use some work. One problem I've been fighting with is getting a background task (ASP.Net Web Service) to start openoffice successfully. It would start, be never listened. This little gem really would have helped several weeks ago: http://www.artofsolving.com/node/11. The important part is "Step 7":
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>
I guess OOo was trying to popup some sort of setup or license agreement. This change tell OOo I've already done those things. This is all despite the fact that I'm starting the soffice.exe with -headless -nologo -nofirstartwizard

1 comment:

  1. I've recently started a blog, the information you provide on this site has helped me tremendously. Thank you for all of your time & work.
    Microsoft Office 2007 Enterprise

    ReplyDelete