Trouble opening chm file

HM5 served us well, now its time has come and it has been replaced... If you have HM5 questions, please post them here.

Moderators: Alexander Halser, Tim Green

Post Reply
Swede
Posts: 123
Joined: Mon Apr 19, 2010 11:01 am

Trouble opening chm file

Unread post by Swede »

Hi,
I suddenly have problems opening a chm file from a H&M Project. It's been published dozens of times before without any trouble (hundreds maybe) using the same name, "AnalytixTrunkEN.chm". Now however, I get an error message saying (translated, it's in Swedish on my computer):

"Unable to open file
mk:@MSITStore:C\Users\[local search path]\AnalytixTrunkEN.chm"

If I rename the file "AnalytixTrunkENG.chm" when I publish it, i.e. changing "EN" to "ENG", it opens just fine. I've tried rebooting the computer as well as deleting the target folder and replacing it with a new one. The problem remains though; if I keep the original name "AnalytixTrunkEN.chm" it won't open.

Any suggestions on how to solve this?

Thanks!

/M

Late addition: Just noticed that the un-openable file "AnalytixTrunkEN.chm" is 68668 kB, twice the normal file size. "AnalytixTrunkENG.chm", which opens nicely, is 34404 kB. The only thing that differs when I publish them though is the name.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Trouble opening chm file

Unread post by Tim Green »

There are a couple of possible causes for CHM failures of this kind. The most common is a graphics file that the (very ancient and creaky) Microsoft CHM compiler cannot handle correctly. This happens most frequently with BMP files that were saved with a graphics program that uses a non-standard encoding for BMP like run length encoding (RLE).

To test this, temporarily make Help & Manual unable to find the graphics in your project:

1) Make a copy of your project in a new folder with Save As in the File menu.

2) In the Project Explorer on the left, go down to Configuration > Common Properties > Project Search Path and delete ALL the entries there. Now the graphics are invisible and can no longer be found.

3) Recompile the CHM from the copy. If it works, you know that the culprit is one of your graphics.

To find out which one, create a new graphics folder inside the project folder you created above, add a Project Search Path reference for it and then add your graphics files to it successively, in small batches and recompile the CHM. When it fails, you've found the culprit.

Other possible causes:

Illegal and Special Characters:

If this doesn't fix it another frequent cause for problems like this is illegal characters in the path to the CHM file, the CHM file name or topic IDs in your project. Microsoft has not updated the CHM help system since it was introduced with Windows 98. It is highly allergic to special characters in file names and paths to CHM files. Spaces in folder names are OK, but there should be no spaces in the name of the CHM file itself. Accented characters and non-alphanumeric characters like # or the ' apostrophe in paths, filenames or topic IDs can cause serious errors.

Both the name of your project and the IDs of all the topics in your project (which you can check in the Topic Options tab) should avoid spaces, accented characters and all non-alphanumeric characters. The best policy is to use only A..Z, a..z, 0..9 and the _ underscore character in all file names and topic IDs.

Damaged CHM Compiler:

For reasons that are still unknown, the Microsoft CHM compiler can occasionally spontaneously become damaged or lose its configuration settings. The only solution for this is to uninstall and reinstall the MS HTML Help Workshop compiler package, which you can download with this link:

http://download.ec-software.com/htmlhelp.exe

First uninstall HTML Help Workshop in the Windows Control Panel. Then restart Windows and reinstall with the installer from the link above.

Important Note: During the installation you will get a misleading message telling you that you "already have a newer version of HTML Help". Ignore this. This only refers to the components for displaying HTML Help, which the package would like to install as well. Since it dates from 1998, all Windows versions now have newer versions of these components so they are not needed. This has nothing to do with the compiler, which is always installed. ;-)

Open Help & Manual and check in View > Program Options > Compilers (HM5 and later) or Tools > Customize > Compilers (HM4 and earlier) that the path to the hhc.exe CHM compiler program is correct.

If you continue to have problems please mail me the project at support AT ec-software.com (replace the AT with @) and we will check it here.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Swede
Posts: 123
Joined: Mon Apr 19, 2010 11:01 am

Re: Trouble opening chm file

Unread post by Swede »

I have tried the suggested solutions but the problem remains. However, I have identified six png images that seem to cause this. If I remove them from the project, the file "AnalytixTrunkEN.chm" ends up with the normal size, 34000 kB, and opens fine; adding any of the six images causes the chm file size to balloon to 68000 kB and the file won't open. I haven't been able to figure out what's wrong with the images though. As before, if I change the name of the chm file to "AnalytixTrunkENG.chm" the problem disappears. The H&M project is version managed in Subversion and older revisions also work fine.
At the moment, this is not a major issue but I would like to figure out the cause, just in case. We have used the same setup with H&M and Subversion for years without problems. I'm currently using H&M version 5.6.0. build 1360.
How do you suggest I proceed?
Thanks again!
/M
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Trouble opening chm file

Unread post by Tim Green »

I have tried the suggested solutions but the problem remains.
Actually, you have found the solution: It is caused by those PNG files, for whatever reason. Try opening them in a current graphics program and re-saving them. You may then find that they work OK. Also make sure that they don't have invalid names: Only use a..z, A..Z, 0..9 and the _ underscore character in the file names. No spaces, no accented characters, no non-alphanumeric characters or special characters of any kind. This also applies to project file names and the names of any files used in your projects.

If you continue to have problems please contact support AT ec-software.com (replace the AT with @) by email so that we can arrange to get a demo project from you for testing.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Swede
Posts: 123
Joined: Mon Apr 19, 2010 11:01 am

Re: Trouble opening chm file

Unread post by Swede »

OK, I have sorted out the malfunctioning H&M-project but I haven't been able to figure out technical background for the glitches. In case somebody else runs into the same problem, here's what I did:
As mentioned earlier in this thread, I identified six PNG images that caused the whole thing. All six where saved as PNG files from BMP files but apparently some sort of BMP-residue stuck around. To get rid of these leftovers I created new PNG images by doing screen dumps, rather than using potentially unreliable BMP files and saving them as PNG files. I also renamed them in case Microsoft's "very ancient and creaky" CHM compiler wouldn't get along with the old names.
Now, everything works fine (unless I put a hex on the whole thing by posting this).
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Trouble opening chm file

Unread post by Tim Green »

Hi Swede,
Swede wrote:OK, I have sorted out the malfunctioning H&M-project but I haven't been able to figure out technical background for the glitches.
The problem is Microsoft's ancient CHM system, which hasn't really been updated since it was originally released with Windows 98, which makes it over sixteen years old. It is highly allergic to all sorts of strange things and nobody really knows why -- probably even nobody at Microsoft. It is quite possible that the reason CHM hasn't been updated is that there is no longer anyone around who understands the code (the original team has long since been disbanded) and the people at Microsoft prefer not to touch it at all because of this... 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply