Sometimes you only have the CHM output file and nobody can locate the source files. It's not always possible to recover all files and data you need.
- Decompiling loses the
map.hfiles and their information for F1-Help (context sensitive help).
- Any KLink and ALink keywords that were contained in the source html files will be lost.
- Any Stop words (Full text search stop list file) will be lost.
KLink and ALink keywords are keywords that the help author have embedded in the HTML source of topics, rather than in the hhk file. These keywords are lost because stripped off when the existing old CHM file was compiled.
However, the methods below are well suited for simple structured CHM files and some changes. If you really want to decompile without installing any software, method 5 is the best choice.
- Method 1 - Extract with HTMLHelp Workshop
- Method 2 - Extract with FAR HTML
- Method 3 - Extract with KeyTools
- Method 4 - Extract with 7zip
- Method 5 - Extract by the man's way
Method 1 - Extract with HTMLHelp Workshop
First of all, you need to download and save the HtmlHelp.exe file to your disk.
The download link https://www.microsoft.com/en-us/download/details.aspx?id=21138 was dropped by Microsoft. You can get files from web archives:
Then install the software with the default values. At the end of the installing you may receive the message, that a newer version is already installed.
You can click OK without worrying if this window is shown.
- Launch the Microsoft HTML Help Workshop program
- Select File > Decompile from the main menu.
- Enter or browse to the folder and file requested.
Method 2 - Extract with FAR HTML
If you have FAR HTML installed, then you have the tools you need. FAR HTML is Freeware now. An installation of the Microsoft HTML Help Workshop is required for FAR HTML anyway.
- Open FAR and from the main menu go to Authoring > HH Utilities.
- Click File > Open and browse to the CHM file
- Click Decompile, select Extract All and browse to the folder to which you want to extract the files (see screenshot above: Create a new folder for this by using the icon in the upper right corner of the dialog).
- Click OK when advised the process is complete.
- Now you need to create an HHP project file that can be used to compile later. Go to Authoring > Help Express .
- In the first field, enter or browse to the folder used in Step 3.
- In the second field, enter the Title as it appears in the name of the CHM file you are decompiling.
- In the third field, enter the default topic. If you don't know what it is, select any file, you can change it later.
- In the fourth field enter the same name as the CHM file you are decompiling and click the Create Help button.
Please note to answer the question after step (9) with No at the next window. The decompiled original files Table of Contents (.hhc) and an optionally existing Index (.hhk) will be overwritten otherwise!
Method 3 - Extract with KeyTools
KeyTools is a free tool that decompiles the CHM file and creates the HHP file in one process. KeyTools was available from Ralph Walden's site and now ported by us as retired Help MVP's to http://keyworks.helpmvp.com/. If you want to download it from my site you can click here. Some notes on the installation of KeyTools. I am not aware of any incompatibilities up to Microsft's operating system Windows 10.
- Open Keytools and select the decompile option.
- Enter or browse to the two folders requested.
- Click OK.
When the process is complete, close Keytools and open Windows Explorer. Browse to the HHP file and compile it e.g. using FAR HTML or Microsoft HTML Help Workshop. You will need to check the generated HHp file, the compiled CHM file and generally make sure the project is as you want it.
Method 4 - Extract with 7zip
7zip can also unzip CHM files. To do this, simply right-click on the file or open e.g. by using a portable version of 7zip from your USD-Stick. Enter or browse to the folder and file requested.
Additional files and directories are present here, but they do not represent thematic content. These are internal binary files from the CHM file.
Method 5 - Extract by the man's way
The %SystemRoot%\hh.exe is the viewer for CHM files in Windows and can not only display CHM files but also extract CHM files. No interface - just enter this into a command prompt or PowerShell window and amend as necessary.
hh.exe -decompile <target_directory> <path>\<filename>.chm
Please note, it is only possible to use
-decompile with folder path and help file name not containing a space character. hh.exe is poor coded regarding to command line argument strings parsing. It supports
hh.exe "D:\gxml\test\a b\1.chm" to open a compiled help file with a space in fully qualified help file name. But on using
-decompile it interprets the first series of spaces after -decompile always as beginning of the folder path and the second series of spaces after -decompile as beginning of the help file name even on using " around the two argument strings.