Microsoft Compiled HTML Help: Difference between revisions

Content deleted Content added
Fixed the koreader url
 
(142 intermediate revisions by 100 users not shown)
Line 1:
{{Short description|Software help file format by Microsoft}}
{{Infobox file format
| name = Microsoft Compiled HTML Help
Line 6 ⟶ 7:
| caption =
| extension = .chm
| mime = application/vnd.ms-htmlhelp<ref>{{cite web |last=Techtonik |first=Anatoly |title=application/vnd.ms-htmlhelp |url=https://www.iana.org/assignments/media-types/application/vnd.ms-htmlhelp |date=11 April 2006 |accessdate=7 March 2012}}</ref>
| mime = application/x-chm
| type code =
| uniform type =
Line 12 ⟶ 13:
| owner = [[Microsoft]]
| released = 1997
| latest release version = 1.4<ref>{{cite web|title=Microsoft HTML Help 1.4|url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms670169(v=vs.85).aspx|website=Windows Dev Center|publisher=Microsoft|accessdate=10 January 2017}}</ref>
| latest release version =
| latest release date =
| genre =
Line 19 ⟶ 20:
| extended from =
| extended to = [[Microsoft Reader|.lit]]
| standard = No
| url =
}}
{{Infobox software
| name = Microsoft HTML Help Executable
| other_names = <code>hh.exe</code>
| developer = [[Microsoft]]
| discontinued = yes
| included with = [[Microsoft Windows]]
| replaces = [[Microsoft WinHelp]]
| replaced_by = [[Microsoft Help 2]]
| genre = [[Help system]]
}}
 
'''Microsoft Compiled HTML Help''' ('''CHM''') is a [[Microsoft]] proprietary [[online help]] format, consisting of a collection of [[HTML]] pages, an index and other navigation tools. The files are compressed and deployed in a binary format with the extension .CHM. The format was intended to succeed [[Microsoft WinHelp]].
'''Microsoft Compiled HTML Help''' is a proprietary format for [[online help]] files, developed by [[Microsoft]] and first released in 1997 as a successor to the [[Microsoft WinHelp]] format. It was first introduced with the release of [[Windows 98]], and is still supported and distributed through [[Windows XP]], [[Windows Vista|Vista]] and [[Windows 7]] platforms.<ref>{{Cite book| last = Karp | first = David | title = Windows Xp in a Nutshell | publisher = O'Reilly | ___location = Sebastopol | year = 2005 | isbn = 9780596009007 }}</ref><ref>{{Cite book| last = Wang | first = Wallace | title = Steal This File-Sharing Book | publisher = No Starch | ___location = City | year = 2004 | isbn = 9781593270506 }}</ref>
 
Although the format was designed by Microsoft, it has been successfully [[Reverse engineering|reverse-engineered]] and is now supported by many document viewers.
HTML Help files are made with [[Help authoring tool]]s. [[Microsoft]] ships the [http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en Help Workshop] with supported versions of [[Microsoft Windows]] and makes the tool available as a free download. There are also a number of third-party Help authoring tools available.
 
The [[Microsoft Reader]] .LIT file format is basically a modification of the HTML Help CHM format. CHM files are sometimes used for e-books.<ref>Title Handbook of Data Compression
Authors David Salomon, Giovanni Motta, David (CON) Bryant
Edition 5, illustrated
Publisher Springer, 2009
ISBN 1848829027, 9781848829022
Length 1359 pages</ref>
 
In 2002, Microsoft announced some security risks associated with the .CHM format, as well as some security bulletins and patches.<ref>[http://www.winwriters.com/security.htm WinWriters - Security and Microsoft Help<!-- Bot generated title -->]</ref> They have since announced their intentions not to develop the .CHM format further,<ref>[http://msdn.microsoft.com/en-us/library/ms669985 Microsoft HTML Help Workshop download page]</ref> and will be moving to a new generation of Windows Help called [[Microsoft Assistance Markup Language]] in the [[Windows Vista]] operating system.
 
==History==
CHM was introduced as the successor to [[Microsoft WinHelp]] with the release of [[Windows 95#Internet Explorer|Windows 95 OSR 2.5]]. Within the [[Windows NT family]], the CHM file support is introduced in [[Windows NT 4.0]]<ref>{{Cite web|url=https://docs.microsoft.com/en-us/security-updates/securitybulletins/2002/ms02-055|title=Microsoft Security Bulletin MS02-055 - Critical|website=docs.microsoft.com|language=en|access-date=2020-10-29}}</ref><ref>{{Cite web|url=https://seclists.org/fulldisclosure/2004/Jul/679|title=Full Disclosure: HtmlHelp - .CHM File Heap Overflow|website=seclists.org|language=en|access-date=2020-10-29}}</ref> and is still supported in [[Windows 11]].<ref>{{Cite web|url=https://community.spiceworks.com/topic/1961503-solved-windows-10-chm-help-files-showing-up-blank|title=[SOLVED] Windows 10 CHM Help Files showing up blank. - Spiceworks|website=community.spiceworks.com|language=en|access-date=2020-10-29}}</ref>
 
{| class="wikitable" border="1"
!Month
Line 66 ⟶ 70:
|-
|March
|At the [[WritersUA]] (formerly WinWriters) conference, Microsoft announces plans for a new help platform, Help 2, which is also HTML based.
|-
|January
Line 73 ⟶ 77:
|}
 
Microsoft has announced that they do not intend to add any new features to HTML Help.<ref>{{cite web |title=Microsoft HTML Help Downloads |url=http://msdn.microsoft.com/en-us/library/ms669985 |publisher=Microsoft |accessdate=6 March 2012}}</ref>
==Format==
A CHM Help file name has a ".chm" extension. It has a set of web pages written in a subset of [[HTML]] and a [[hyperlink]]ed table of contents. CHM format is optimized for reading, as files are heavily indexed. All files are compressed together with [[LZX (algorithm)|LZX compression]]. Most CHM browsers have the capability to display a table of contents outside of the body text of the Help file.
 
==File format==
The file starts with bytes "ITSF" (in [[ASCII]]), for "Info-Tech Storage Format". The format has been reverse-engineered by Matthew Russotto with assistance from Peter Ferrie and Paul Wise.<ref>[http://bonedaddy.net/pabs3/code/#hhm HTML Help Maker] on Paul Wise (Pabs)' website</ref> Russotto's documentation is freely available at [http://www.russotto.net/chm/chmformat.html http://www.russotto.net/chm/chmformat.html].
Help is delivered as a binary file with the <code>.chm</code> extension. It contains a set of HTML files, a [[hyperlink]]ed table of contents, and an index file. The file format has been reverse-engineered and documentation of it is freely available.<ref>{{cite web |last=Wise |first=Paul |last2=Wing |first2=Jed |title=Unofficial (Preliminary) HTML Help Specification |url=http://www.nongnu.org/chmspec/latest/index.html |year=2005 |accessdate=15 August 2012 }}</ref><ref>{{cite web |last=Palade |first=Alexandru |title=Archive::Chm |url=https://metacpan.org/pod/Archive::Chm |year=2005 |accessdate=22 July 2014 }}</ref>
 
The file starts with bytes "ITSF" (in [[ASCII]]), for "Info-Tech Storage Format", which is the internal name given by Microsoft to the generic storage file format used for CHM files.<ref>{{Cite web|title=Virus Bulletin :: Chamber of horrors|url=https://www.virusbulletin.com/virusbulletin/2006/10/chamber-horrors/|access-date=2022-01-05|website=www.virusbulletin.com}}</ref>
On Windows computers, this Help file can be [[compiler|compiled]] using [http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=00535334-c8a6-452f-9aa0-d597d16580cc hhc.exe], part of the HTML Help Workshop. There are some [[open source]] tools which can read and explore these files, but they lack various features of the [[Microsoft Windows]] tools, most importantly write support.
 
CHM files support the following features:
A CHM file can contain links to other CHM files. When opening such a CHM file for the first time, the HTML Help viewer creates an index file with the extension ".ch''w''". The CHW file contains all the index terms of the master and linked CHM files, and enables faster searching for indexed terms.<ref>[http://office.microsoft.com/en-us/ork2000/HA011384381033.aspx ''Build Help Indexes in Advance'', Microsoft Office Online]</ref>
* Data compression (using [[LZX]])
* Built-in search engine
* Ability to merge multiple .chm help files
* Extended character support, although it does not fully support [[Unicode]].<ref>{{cite web|title=INFO: Limited Unicode Support in HTML Help|url=http://support.microsoft.com/kb/269766/|publisher=Microsoft|date=11 April 2001|accessdate=17 March 2012|archive-url=https://web.archive.org/web/20160313203857/https://support.microsoft.com/en-us/kb/269766/|archive-date=13 March 2016}}</ref>
 
The [[Microsoft Reader]]'s .lit file format is a modification of the HTML Help CHM format. CHM files are sometimes used for e-books.<ref>{{cite book| title=Handbook of Data Compression
==Design==
| first1=David |last1=Salomon |first2=Giovanni |last2=Motta |first3=David (CON) |last3=Bryant
The format has the following advantages over other systems:
| edition = 5th, illustrated
| publisher=Springer
| year = 2009
| isbn=978-1-84882-902-2
| url=https://archive.org/details/handbookofdataco0000salo
| url-access=registration
}}</ref>
 
==Viewers==
* File size smaller than plain HTML
In addition to Microsoft Windows, the following apps support CHM:
* Range of formatting options that HTML gives for text presentation
{| class="wikitable"
* Ability to search the full text
|+
* Ability to assemble several CHM files into one file with common [[TOC]], index and search (see [[MSDN]])
!Name
* Ability to Generate TOC and Topic Folders containing international characters. Standard HTML Help will not generate these correctly.
!Operating system
 
!Website
The .chm file format's ability to contain and execute arbitrary code is a potential security threat. As such, the ability to view the file is often restricted by network security settings, and is affected by [[Patch (computing)|patches]] to the Windows [[operating system]]. HTML Help also does not fully support [[Unicode]].<ref>[http://support.microsoft.com/kb/269766/ INFO: Limited Unicode Support in HTML Help]</ref>
!
 
|-
==Applications==
|[[Okular]]
This format was originally intended only for encoding Help files, but other uses have since been found. It is very handy for packing saved HTML pages in one compact and browsable archive and for creating compact [[e-book]]s. Some people use it to keep personal notes, because it can organize them in an ordered hierarchical table and allows quick text searching.
|Windows, Linux, Unix-like
 
|{{URL|https://okular.kde.org/}}
==Reading on other platforms==
{{URL|https://invent.kde.org/graphics/okular}}
====GTK====
|Uses <code>hh.exe</code> on Windows
* {{sourceforge|gnochm|GnoCHM}}
|-
|[[Calibre (software)|Calibre]]
|Windows, macOs, Linux,
|{{URL|https://calibre-ebook.com/}}
{{GitHub|kovidgoyal|calibre}}
|
|-
|[[Sumatra PDF]]
|Windows
|{{URL|https://www.sumatrapdfreader.org/}}
{{GitHub|sumatrapdfreader|sumatrapdf}}
|
|-
|GnoCHM
|Linux, BSD
|{{SourceForge|gnochm|GnoCHM}}
|
|-
|CHM View
|None/Uncompiled
|{{GitHub|ojuba-org|chmviewkit}}
|
|-
|kchmviewer
|Windows, Linux
|{{URL|https://ulduzsoft.com/kchmviewer/}}
|
|-
|KCHM
|Linux, BSD, Solaris
|{{SourceForge|kchm|KCHM}}
|
|-
|CHMPane
|Windows, macOS, Linux
|{{SourceForge|chmpane|CHMPane}}
|
|-
|CHMate Neue
|iOS, iPadOS, visionOS
|{{iTunes|app/chmate-neue-chm-reader-reloaded/id335157929|CHMate Neue}}
|
|-
|iChm
|iOS, macOS
|{{iTunes|app/ichm-chm-reader/id1243909868|iChm}}
|Discontinued
|-
|ChmPlus
|iOS, iPadOS, macOS, visionOS
|{{iTunes|app/chmplus-pro-chm-reader/id441521818|ChmPlus}}
|
|-
|Chmox
|macOS
|{{URL|http://chmox.sourceforge.net}}
{{SourceForge|chmox|Chmox}}
|
|-
|Clearview
|macOS
|{{iTunes|app/clearview/id557090104|Clearview}}
|
|-
|DisplayCHM
|Linux
|{{URL|https://linux-apps.com/p/998057}}
|
|-
|KOReader
|Android, Linux
|{{URL|https://koreader.rocks/}}
{{GitHub|koreader|url=koreader/koreader}}
|
|}
<!-- ------------------------------------------- Assorted dead links -------------------------------------
* [http://code.google.com/p/chmsee CHMsee]
* [[FBReader]]
 
* [https://sites.google.com/site/readchm/ ReadCHM] {{Webarchive|url=https://web.archive.org/web/20140323184506/https://sites.google.com/site/readchm/ |date=2014-03-23 }}
====Qt====
* [[Okular]] (requires KDE 4)
* [http://www.kchmviewer.net/ kchmviewer] (does not require KDE)
* {{sourceforge|kchm|KCHM}} (requires KDE 3)
* [http://code.google.com/p/chmcreator chmcreator]
 
* [https://play.google.com/store/apps/details?id=com.kingreader.framework&feature=search_result KingReader]{{dead link|date=June 2017 |bot=InternetArchiveBot |fix-attempted=yes }}
====Other====
* [[xCHM]]
* {{sourceforge|archmage|arCHMage}}
* DisplayCHM<ref>[http://kde-apps.org/content/show.php/Displaychm?content=72664 Displaychm], KDE Service Menu</ref>
* [https://addons.mozilla.org/en-US/firefox/addon/3235 CHM Reader Firefox addon]
* [[Free Pascal]] [http://wiki.freepascal.org/chm CHM package]
 
* [https://web.archive.org/web/20140919063747/https://play.google.com/store/apps/details?id=org.hystudio.android.chm Chm Reader]
====Mac OS X====
* [http://www.flyingegg.info/onlinestore/mhz.php MHz]
* [http://chmox.sourceforge.net/ CHMox]
* [http://www.robinlu.com/blog/ichm iChm]
* [http://code.google.com/p/archmock/ ArCHMock]
 
* [https://play.google.com/store/apps/details?id=com.chaozh.iReader&feature=search_result iReader]
====iPhone / iPod touch====
* [https://sites.google.com/site/readchm/ ReadCHM]
* [http://lazyapps.com/chmate/ CHMate]
* [http://www.robinlu.com/blog/ichm iChm]
 
* [http://code.google.com/p/archmock/ ArCHMock] (Discontinued)
====iPad====
* [https://sites.google.com/site/readchm/ ReadCHM]
* [http://lazyapps.com/chmate/ CHMate]
 
* (NOT A READER) [http://www.enolsoft.com/chm-to-epub-for-mac.html CHM to EPUB] {{Webarchive|url=https://web.archive.org/web/20190329171517/https://www.enolsoft.com/chm-to-epub-for-mac.html |date=2019-03-29 }} (Discontinued)
====Windows====
-->
* [[FBReader]]
 
==Creators==
==Writing on other platforms==
====Other====
* [[Free Pascal]] CHM package [http://wiki.freepascal.org/chm]
 
Microsoft's HTML Help Workshop generates CHM files by instructions stored in a HTML Help project file, which bears a <code>.HHP</code> [[file name extension]] and is a specialized form of [[INI file]].<ref>{{cite web |last=Wise |first=Paul |last2=Wing |first2=Jed |title=Unofficial (Preliminary) HTML Help Specification INI formats|url=http://chmspec.nongnu.org/latest/INI.html#HHP |year=2005 |accessdate=1 February 2018 }}</ref>
==Extracting to HTML==
{{Howto|date=September 2009}}
 
[[Lazarus (IDE)|Lazarus]] and [[Free Pascal]] provide a [[doxygen]]-like tool for CHM generation and a separate [[command-line]] compiler called <code>chmcmd</code>.
On Windows, a CHM file can be extracted to plain HTML with the command:
hh.exe -decompile ''extracted'' ''filename.chm'' <!-- Windows 7 64bit get error file could not be opened -->
This will decompress all files embedded in <code>''filename.chm''</code> to folder <code>''extracted''</code>.
 
==Other utilities==
You can also use HTML Help Workshop to decompile CHM files. <!-- Can PowerCHM do this? -->{{Citation needed|date=September 2010}}
 
The official viewer in Microsoft Windows (<code>hh.exe</code>) can decompile a CHM file. So can Microsoft HTML Help Workshop and [[7-Zip]]. [[Calibre (software)|Calibre]] and [https://github.com/dottedmag/arCHMage arCHMage] can convert CHM into another format.
[[7-Zip]] will open .chm files as archives allowing access to all content.
 
On Windows, as a hack, select the topmost Topic, right-click and select Print. On the popup dialog, select "Print this heading and all subtopics.", click OK. Before selecting a printer, look in %HOMEPATH%\Local Settings\Temp for a file named ~hh*.htm. This is the concatenated HTML. The image reference will refer back to the .chm file at the time of the "print".
 
On Linux systems which use [[Advanced Packaging Tool|apt]] as a packaging tool, a CHM file is extracted to plain HTML with extract_chmLib (first command is for a [[Debian]] based OS):
$ sudo apt-get install libchm-bin
$ extract_chmLib tero.chm tero/
 
==Other documentation file formats==
Although documentation ''can'' be maintained entirely in a vendor-specific presentation format such as CHM, it is more often the case that documentation will need to be published in several different presentation formats at once: CHM, [[WinHelp]], [[HTML]] pages, Java Help, [[PDF]], and so on.
 
As it can be expensive and prone to error to maintain multiple document formats separately, authoring documentation in a vendor-neutral authoring tool is often recommended. Tools from which several different presentation formats can be generated (such as [[Darwin Information Typing Architecture|DITA]] or [[DocBook]]) are often used so that all of the various presentation files produced (CHM or otherwise) are generated from the same sources – this allows the information to remain consistent across different versions of the documentation.
 
A more modern alternate to CHM is [[MHTML]].
 
==See also==
* [[{{Wikibookspar|Windows Programming|Compiled HTML Help]]}}
* [[WinHelp]]
* [[Microsoft Help 2]]
* [[KDE WAR (file format)]]
* [[Comparison of documentation generators]]
 
==References==
{{Reflist|2}}
 
==External links==
* [http://msdn2.microsoft.com/en-us/library/bb267846.aspx HTML Help Web Page on MSDN]{{dead link|date=February 2025}}
* [http://msdn2.microsoft.com/en-us/library/bb165722(VS.80).aspx Microsoft Help 2 Reference]{{Dead link|date=February 2025}}} (part of Visual Studio SDK for VS7.1 and VS8.0)
* [https://web.archive.org/web/20060718005033/http://www.helpware.net/htmlhelp/hh_info.htm History of HTML Help]
* [http://www.nongnu.org/chmspec/latest/index.html Unofficial (Preliminary) HTML Help Specification] (the linked ITSF specification has been moved to [http://www.russotto.net/chm/chmformat.html the Russotto.net ___domain])
 
{{Microsoft Windows components}}
{{Internet Explorer}}
 
{{DEFAULTSORT:Microsoft Compiled Html Help}}
[[Category:Internet Explorer]]
[[Category:Technical communication]]
[[Category:OnlineComputer helpfile formats]]
 
[[de:CHM (Dateiformat)]]
[[es:Microsoft Compiled HTML Help]]
[[fr:Microsoft Compressed HTML]]
[[it:Microsoft Compressed HTML Help]]
[[ja:Microsoft Compiled HTML Help]]
[[pl:HTML Help]]
[[pt:CHM]]
[[ru:HTMLHelp]]
[[sr:CHM]]
[[uk:Compiled HTML]]
[[vi:CHM (định dạng tập tin)]]
[[zh:Microsoft已編譯的HTML Help]]