Resources - Using tfhxreg

Beginning with version 6, Doc-O-Matic comes with its own tool for registering Help 2 content, named TFHxReg. It is a command line utility that takes an XML command file as input. The command file contains the instructions for registration and unregistration of namespaces, titles, filters and plugins.

Why use TFHxReg?

TFHxReg has a number of advantages over other tools:

  • It is fully Unicode compliant. TFHxReg supports registration and unregistration of Unicode namespace names, Unicode titles using Unicode filenames.
  • TFHxReg does not require the user to have administrative privileges. To register your own namespace, normal user privileges are sufficient. You only need admin rights when plugging a title into a namespace that was registered with admin rights. This is a big advantage on Vista systems where even administrators run with a lower privilege level by default.
  • TFHxReg uses a straight-forward XML file for configuration of the registration tasks.

XML Command File

TFHxReg is configured through an UTF-8 encoded XML command file with the following syntax:

<?xml version="1.0" encoding="utf-8"?>
<help2registration>
  <register>
    <namespace id="mynamespace" collectionfile="test_COL_MASTER.HxC" description="My Namespace">
      <title id="project" langid="1033" helpfile="project.HxS" 
              indexfile="project.HxS" queryfile="" attrfile=""></title>
      <filter id="(No Filter)" query=""></filter>
      <filter id="mytestfilter" query="(&quot;product&quot;=&quot;FooBar&quot;)"></filter>
      <plugin parent="MS.VSIPCC+" parenttocfile="" tocfile="" attrfile=""></plugin>
    </namespace>
  </register>
  <unregister>
    <namespace id="mynamespace">
      <title id="project" langid="1033"></title>
      <filter id="mytestfilter" query="(&quot;product&quot;=&quot;FooBar&quot;)"></filter>
      <plugin parent="MS.VSIPCC+" parenttocfile="" tocfile="" indexfile=""></plugin>
    </namespace>
    <namespace id="mynamespace"></namespace>
  </unregister>
</help2registration>

The file basically consists of 2 parts, the register and unregister part. Everything is hierarchically ordered by namespaces. Notice that the namespace is listed twice in the unregister part. The first one is for unregistering any titles, filters and plugins contained in the namespace but not the namespace itself. To unregister the namespace, an empty namespace element is required. To unregister titles, filters or plugins while leaving the namespace intact, just remove that empty namespace element from the unregister section.

The plugin element's parent attribute contains the namespace into which the registered namespace should be plugged into. It supports an optional wildcard character + at the end of the name which makes TFHxReg register the plugin into all namespaces that start with that name. This is a convenient feature that allows you to deploy the help file without having to know the actual target system's version of the MSDN (for example) that is being used.

Unless you have very special requirements to the registration of your Help 2 files, any attributes that are left blank in the example above usually can remain blank. You can also remove filter and plugin elements if not needed.

All filenames in the command file can be given absolute or relative to the command file's location.

Command Line Usage

tfhxreg.exe [-r|-u] <CommandFile>

TFHxReg takes the command file on the command line and one of two optional switches. The -r switch makes TFHxReg process the registration part only. Similarly, the -u switch make it process the unregistration part only. If neither -r nor -u is passed, TFHxReg will first execute the unregistration part followed by the registration part (if available in the command file).

Redistribution of TFHxReg

TFHxReg may be distributed under the Doc-O-Matic license for the purpose of registering specific Help 2 systems on end users' computers. There is no license fee due for this kind of usage. Unless explicit written permission is given, any other redistribution is strictly prohibited including but not limited to distribution via download sites and as part of other software or tool collections.

Copyright © 2000-2024 by toolsfactory software OG All rights reserved.