The relative paths to parent directories either in the *.hhc file or in the html code of the help page .htm does not work in compiled .chm help file.
In this example, file1.htm is in the same directory as the *.hcc file, whereas file2.htm is in other directory that needs to be accessed via parent directory. The HELP Workshop IDE creates following *.hhc:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1">
<!-- Sitemap 1.0 -->
</HEAD><BODY>
<OBJECT type="text/site properties">
<param name="ImageType" value="Folder">
</OBJECT>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Introduction">
<param name="Local" value="file1.htm">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Topic">
<param name="Local" value="..\common\file2.htm">
</OBJECT>
</UL>
</BODY></HTML>
The content of the file 1 begins with something like this:
<html>
<head>
<title>Documentation</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0" />
<link rel="stylesheet" type="text/css" href="..\common\webformat.css" />
<script language="JavaScript" type="text/javascript" src="..\common\WindowControl.java">
</script>
</head>
<body>
<table cols=2>
<tr>
<td align="left" valign="bottom"><h2>Overview</h2></td>
<td align="right"><img src="..\common\images\klein.gif" alt="Logo"></td>
</tr>
</table>
In the compiled *.chm file the stylesheet is not applied, javascript does not work and images are not displayed. The file2 from the table of content is not accessible as well.
Decompressing the *.chm file with 7zip it is can be seen that the compiler placed all files on the same level, but it left the relative paths in *.htm files and *.hhc files unchanged. That is why they are not accessible:
Help folder hierarchy in the help project:
Help
|-common
| |-file2.htm
| |-webformat.css
| |-WindowControl.java
| |-images
| |-klein.gif
|-private
|-file1.htm
And in the decompressed *.chm file hierarchy:
Help
|-file1.htm
|-file2.htm
|-webformat.css
|-WindowControl.java
|-klein.gif
Specifying alternative paths to all relative paths by javascript is a very unclean solution. Moreover, it does not solve the problem of the links in the *.hhc file.
Any ideas?