Click or drag to resize
Sandcastle Help File BuilderDeploying an MS Help 2 File

The MS Help 2 system maintains a registry of all help collections and titles currently installed on a machine. This registry determines what help titles are included in each help collection as well as maintaining references between the help collections.

Unlike HTML Help 1 (CHM) files, an MS Help 2 title or collection must be registered in order to view it. This makes deploying HTML Help 2 documentation more complex than simply delivering a single file and creating a shortcut to it. While it is possible to create a Windows Installer package to deploy and register help collections and titles, it is a rather lengthy process and it does not always work as well as it should.

The easiest approach to deploying and registering Help 2 collections is to use the shareware tool H2Reg.exe from The Helpware Group. It is a command line tool that can be included by scripted installers as well as Windows Installer packages as a custom action.

When producing an MS Help 2 file, the help file builder produces a valid set of collection files and creates a configuration file suitable for use by H2Reg.exe. In order to deploy the generated HTML Help 2 files, follow these steps:

  1. Set the Plug In Namespaces project property to a comma separated list of one or more namespaces that your collection should be plugged into when deployed. The default setting will plug it into all available collections. See the H2Reg.exe help file for details about the possible values that can be used.

  2. Build the help project.

  3. Include all of the generated help files as well as the generated configuration file and the H2Reg.exe executable in your installer.

  4. During installation, copy the help files, the configuration file, and H2Reg.exe to their installed location.

  5. Execute H2Reg.exe with the following syntax:

    H2Reg -r "CmdFile=<Path to the configuration file>"
  6. During uninstallation, before the help files are removed, execute H2Reg.exe with the following syntax:

    H2Reg -u "CmdFile=<Path to the configuration file>"

Your product's installer can create a shortcut to open your Help 2 file by executing a command similar to the following (lines wrapped for display purposes):

"%CommonProgramFiles%\Microsoft Shared\Help 9\dexplore.exe" /helpcol ms-help://MS.VSCC.v90
  /filter "[Your help title here]"

Substitute your product's help title project property value for "[Your help title here]" in the example above.

See Also