chmhtml-help

Recompile CHM file


I'm working on a script that should be able to add additional information to a .chm file.

After decompiling it with hh.exe -decompile outputFolder fileName.chm command, I get the html files, and other 2 files with .hhc and .hhk extension.

After editing the html files, I'd like to recompile the files into a single .chm file. I read that that I also need a .hhp file in order to do that, but that's not generated in the decompilation process.

How can I solve this?


Solution

  • This is a problem of Compiled Help Modules (CHM). And yes - you need a *.hhp for compiling again by HTMLHelp Workshop or e.g. FAR HTML.

    You know, you can also use 7Zip to decompile a CHM help file OR just open a command prompt window on a Windows PC and type the following:

    hh.exe -decompile <target_directory> <path>\<filename>.chm
    

    The only decompiler with any additional features is KeyTools as this can try to rebuild the project (.hhp) file. You'll need this file if you want to recompile the help project.

    You'll find some further info about the methods described above and other methods.

    One thing to note is that the decompile/recompile process isn't a "round-trip" process. Certain features that the help author added to the original help file can't be recovered when you decompile it, so these may no longer work properly after you've recompiled. This is especially true in the area of context-sensitive help, which may be broken in the new version of the file.

    It can be useful, to include the .hhp file itself - after regenerating is done - into the section [FILES] of the project file (.HHP). Thus, this is included in the Compiled Help Module (CHM) when compiling. The appropriate *.HHP file then is decompiled in addition to the other files for future use.