Opening a CHM file produces: "navigation to the webpage was canceled"
Asked Answered
C

10

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?

Cheekpiece answered 11/7, 2012 at 18:0 Comment(0)
C
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.

Cheekpiece answered 11/7, 2012 at 18:7 Comment(5)
I don't see the "Unblock" button either on WinXP SP3 or WinVista Home PremiumMiele
Solution 1 is not in Windows 8, is there any easy win8 way?Ironmaster
None of the proposed solutions match the 4 possible solutions given my the referenced KB article. Setting 'MaxAllowedZone' to '1' fixed the problem for meAutotype
UNBLOCK does not help, you have to open copy the file to a local drive and open it from the (non-network) local drive.Bainter
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.Clitoris
S
44

"unblocking" the file fixes the problem. Screenshot:

enter image description here

Sorption answered 30/4, 2013 at 8:34 Comment(4)
I have forgotten as I did not use this trick for a long time.Thanks for remind me again.Folkway
Moving from network location to local location is not enough - you need to unblock like in this screenshot. Thanks @trismarckMctyre
This worked! Thanks. I would have never figured out on my own.Disappointed
couldn't find such option with win-7. instead of opening a n/w file, I copied to my local machine and it works.Longmire
C
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.

Como answered 15/7, 2012 at 10:19 Comment(2)
Very interesting answer. Where do i find more information about this hidden file fork thing?Assisi
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 MSIEComo
E
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.

Emilioemily answered 2/2, 2014 at 13:35 Comment(2)
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. :)Melisamelisande
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.Fluorosis
M
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

Miele answered 20/4, 2013 at 2:11 Comment(0)
S
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.

Salley answered 19/11, 2012 at 14:18 Comment(1)
Voww... that works for me... ( file right-click, properties didn't show 'unblock' button. Whereas this works fine )Longmire
L
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.

Longmire answered 2/1, 2015 at 11:56 Comment(0)
C
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) ; }
Conditional answered 6/10, 2014 at 14:11 Comment(0)
S
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.

Scutch answered 26/5, 2016 at 16:31 Comment(1)
No problem, I'm glad someone benefited. Best!Scutch
B
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.

Boschvark answered 27/1, 2021 at 20:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.