84

I am trying to open a .chm file.

I downloaded the source, extracted it, and double clicked on Waffle.chm and clicked "Open" but no matter what element in the chm file I click, I get the message:

Navigation to the webpage was canceled.  
What you can try: 
Retype the address.  

enter image description here

What's going on here?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335

10 Answers10

170

Summary

Microsoft Security Updates 896358 & 840315 block display of CHM file contents when opened from a network drive (or a UNC path). This is Windows' attempt to stop attack vectors for viruses/malware from infecting your computer and has blocked out the .chm file that draw data over the "InfoTech" protocol, which this chm file uses.

Microsoft's summary of the problem: http://support.microsoft.com/kb/896054

Solutions

  1. If you are using Windows Server 2008, Windows 7, windows has created a quick fix. Right click the chm file, and you will get the "yourfile.chm Properties" dialog box, at the bottom, a button called "Unblock" appears. Click Unblock and press OK, and try to open the chm file again, it works correctly. This option is not available for earlier versions of Windows before WindowsXP (SP3).

  2. Solve the problem by moving your chm file OFF the network drive. You may be unaware you are using a network drive, double check now: Right click your .chm file, click properties and look at the "location" field. If it starts with two backslashes like this: \\epicserver\blah\, then you are using a networked drive. So to fix it, Copy the chm file, and paste it into a local drive, like C:\ or E:. Then try to reopen the chm file, windows does not freak out.

  3. Last resort, if you can't copy/move the file off the networked drive. If you must open it where it sits, and you are using a lesser version of windows like XP, Vista, ME or other, you will have to manually tell Windows not to freak out over this .chm file. HHReg (HTML Help Registration Utility) Utility Automates this Task. Basically you download the HHReg utility, load your .chm file, press OK, and it will create the necessary registry keys to tell Windows not to block it. For more info: http://www.winhelponline.com/blog/fix-cannot-view-chm-files-network-xp-2003-vista/

Windows 8 or 10? --> Upgrade to Windows XP.

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
  • 3
    I don't see the "Unblock" button either on WinXP SP3 or WinVista Home Premium – GetFree Apr 20 '13 at 02:14
  • Solution 1 is not in Windows 8, is there any easy win8 way? – countunique Jul 12 '13 at 15:53
  • 2
    None of the proposed solutions match the 4 possible solutions given my the referenced KB article. Setting 'MaxAllowedZone' to '1' fixed the problem for me – abstrask Apr 03 '14 at 14:30
  • UNBLOCK does not help, you have to open copy the file to a local drive and open it from the (non-network) local drive. – Erdinc Ay Dec 07 '15 at 00:37
  • 1
    This trouble affects chm downloaded from Internet too. The unblock button/checkbox may not be there right after downloading. In my experience, it requires to first open the chm from local file system, see it wrecked, close it, then only go to file properties for unlocking it. – Frédéric Oct 15 '17 at 15:29
44

"unblocking" the file fixes the problem. Screenshot:

enter image description here

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
colemik
  • 1,417
  • 2
  • 20
  • 24
  • I have forgotten as I did not use this trick for a long time.Thanks for remind me again. – kta Jan 14 '14 at 05:23
  • Moving from network location to local location is not enough - you need to unblock like in this screenshot. Thanks @trismarck – leinad13 Feb 07 '14 at 14:42
  • This worked! Thanks. I would have never figured out on my own. – NilsB Sep 07 '14 at 09:10
  • couldn't find such option with win-7. instead of opening a n/w file, I copied to my local machine and it works. – tsenapathy Jun 29 '15 at 16:09
11

In addition to Eric Leschinski's answer, and because this is stackoverflow, a programmatical solution:

Windows uses hidden file forks to mark content as "downloaded". Truncating these unblocks the file. The name of the stream used for CHM's is "Zone.Identifier". One can access streams by appending :streamname when opening the file. (keep backups the first time, in case your RTL messes that up!)

In Delphi it would look like this:

var f : file;
begin
 writeln('unblocking ',s);
 assignfile(f,'some.chm:Zone.Identifier');
 rewrite(f,1);
 truncate(f);
 closefile(f);
end;

I'm told that on non forked filesystems (like FAT32) there are hidden files, but I haven't gotten to the bottom of that yet.

P.s. Delphi's DeleteFile() should also recognize forks.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
  • Very interesting answer. Where do i find more information about this hidden file fork thing? – ViRuSTriNiTy Apr 11 '15 at 00:54
  • MSDN. E.g. sb made a remark that deletefile works also, and I looked at the relevant call in MSDN and exactly how the function behaves is documented. The specific Zone.Identifier bit I got of the internet. It also works for e.g. blocked dled EXEs if you have high security settings for MSIE – Marco van de Voort Apr 11 '15 at 12:36
11

Win 8 x64:

just move it to another folder or rename your folder (in my case: my folder was "c#"). avoid to use symbol on folder name. name it with letter.

done.

Hammond22
  • 341
  • 2
  • 6
  • This works also. My .chm file was in this folder C:\C#\Samples then I moved it to C:\temp and boom! It works! Thanks for this. :) – klaydze May 02 '14 at 04:15
  • Excellent! I am a Windows 10 user: had to remove the "#" both from the file name and the folder name from an old c# chm help file. – Marcelo Bergweiler Jun 08 '19 at 09:56
6

The definitive solution is to allow the InfoTech protocol to work in the intranet zone.

Add the following value to the registry and the problem should be solved:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000001

More info here: http://support.microsoft.com/kb/896054

GetFree
  • 40,278
  • 18
  • 77
  • 104
4

Go to Start

Type regsvr32 hhctrl.ocx

You should get a success message like:

" DllRegisterServer in hhctrl.ocx succeeded "

Now try to open your CHM file again.

Stephan
  • 41,764
  • 65
  • 238
  • 329
LoveToCode
  • 41
  • 2
  • 1
    Voww... that works for me... ( file right-click, properties didn't show 'unblock' button. Whereas this works fine ) – tsenapathy Jan 02 '15 at 11:54
3

other way is to use different third party software. This link shows more third party software to view chm files...

I tried with SumatraPDF and it work fine.

tsenapathy
  • 5,646
  • 3
  • 26
  • 26
2

I fixed this programmatically in my software, using C++ Builder.

Before I assign the CHM help file, Application->HelpFile = HelpFileName, I check to see if it contains the "Zone.Identifier" stream, and when it does, I simply remove it.

String ZIStream(HelpFileName + ":Zone.Identifier") ;

if (FileExists(ZIStream))
    { DeleteFile(ZIStream) ; }
Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
Peter
  • 1,334
  • 12
  • 28
1

There are apparently different levels of authentication. Most articles I read tell you to set the MaxAllowedZone to '1' which means that local machine zone and intranet zone are allowed but '4' allows access for 'all' zones.

For more info, read this article: https://support.microsoft.com/en-us/kb/892675

This is how my registry looks (I wasn't sure it would work with the wild cards but it seems to work for me):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000004

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"UrlAllowList"="\\\\<network_path_root>;\\\\<network_path_root>\*;\\ies-inc.local;http://www.*;http://*;https://www.*;https://*;"

As an additional note, weirdly the "UrlAllowList" key was required to make this work on another PC but not my test one. It's probably not required at all but when I added it, it fixed the problem. The user may have not closed the original file or something like that. So just a consideration. I suggest try the least and test it, then add if needed. Once you confirm, you can deploy if needed. Good Luck!

Edit: P.S. Another method that worked was mapping the path to the network locally by using mklink /d (symbolic linking in Windows 7 or newer) but mapping a network drive letter (Z: for testing) did not work. Just food for thought and I did not have to 'Unblock' any files. Also the accepted 'Solution' did not resolve the issue for me.

jacktrader
  • 588
  • 5
  • 10
0

Moving to local folder is the quickest solution, nothing else worked for me esp because I was not admin on my system (can't edit registery etc), which is a typical case in a work environment.

Create a folder in C:\help drive, lets call it help and copy the files there and open.

Do not copy to mydocuments or anywhere else, those locations are usually on network drive in office setup and will not work.

Dharman
  • 30,962
  • 25
  • 85
  • 135
TheTechGuy
  • 16,560
  • 16
  • 115
  • 136