Extension to disable auto-update

I am trying to create an extension that will disable auto-updates. The code is available on official wiki page. This example disables auto-updates (and prevents user override)

https://wiki.documentfoundation.org/Deployment_and_Migration#Post_deployment_configuration

I wrote the extension, but getting an error at the time of install:

 "Bad root element <data>"

I am not sure about the specific changes needed in the XML file to make the code suitable for inclusion in the extension.

To discuss “the specific changes in the XML file”, it would be natural to expect having access to the specific XML file’s current text? :wink:

Copy pasted from the wiki page mentioned in the question:

<?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="Jobs" oor:package="org.openoffice.Office">
      <node oor:name="Jobs">
        <node oor:name="UpdateCheck" oor:op="fuse">
          <node oor:name="Arguments">
            <prop oor:name="AutoCheckEnabled" oor:type="xs:boolean" oor:op="replace" oor:finalized="true">
              <value>false</value>
            </prop>
          </node>
        </node>
      </node>
    </oor:component-data>
  	<oor:component-data xmlns:install="http://openoffice.org/2004/installation" oor:name="Update" oor:package="org.openoffice.Office">
      <node oor:name="Update" oor:op="fuse">
  			<prop oor:name="Enabled" oor:type="xs:boolean" oor:op="replace" oor:finalized="true">
  				<value>false</value>
  			</prop>
      </node>
    </oor:component-data>
  </oor:data>

… and how is this integrated into your extension?

OK, I likely see your problem.

The “Deployment and Migration” wiki has that XML in the “Some tricks for post deployment configuration” section, where it discusses a way to put .xcd files into shared “registry” directory, where it would define the defaults (“d” stands for “default”).

But then, the wiki discusses “Configuration Extension”, and in that section, it points to a PDF with some explanation of a different file type, which is .xcu (user configuration, “u” for “user”).

In your case, you need one xcu looking like

<?xml version="1.0"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" oor:name="Jobs" oor:package="org.openoffice.Office">
  <node oor:name="Jobs">
    <node oor:name="UpdateCheck" oor:op="fuse">
      <node oor:name="Arguments">
        <prop oor:name="AutoCheckEnabled" oor:type="xs:boolean" oor:op="replace" oor:finalized="true">
          <value>false</value>
        </prop>
      </node>
    </node>
  </node>
</oor:component-data>

and another one like

<?xml version="1.0"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" oor:name="Update" oor:package="org.openoffice.Office">
  <node oor:name="Update" oor:op="fuse">
    <prop oor:name="Enabled" oor:type="xs:boolean" oor:op="replace" oor:finalized="true">
      <value>false</value>
    </prop>
  </node>
</oor:component-data>

where both have their root element oor:component-data.

Getting the same error “Bad root element”. Here is a sample extension file.

https://lambdaoksoft.s3.us-east-1.amazonaws.com/extension_update_disable.oxt

Wow, but what did you use for inspiration??? There are so many information there, the PDF about the configuration extension creation - right on the page; the sample extension; the dev guide … yours doesn’t follow any of these.

Basically: drop yours, and start from scratch.