2

In my code I am trying to open a helpfile (.chm) from the local network using the following code

private void helpToolStripMenuItem_Click(object sender, EventArgs e)
{
    Help.ShowHelp(this, @"\\server\Helpfiles\HelpFiles.chm");
}

If I wanted to open this .chm outside of my application I needed to add a key to my registry first because of security reasons.

I thought that this would also work for my application, however it still say's cancelled.

How can I open this .chm file and it's content?

Justin
  • 84,773
  • 49
  • 224
  • 367
Drabe
  • 45
  • 4
  • Can you give us a bit more detail on the registry key that you added and what exactly happens when you call `ShowHelp`? – Justin Aug 31 '12 at 14:30
  • Which version of the .NET framework are you using? Now I'm trying to Google for this, but I'm sure I saw an interview with a member of the .NET security team that mentioned opening CHM files on a network drive is now supported in .NET 4.0 default config, since so many people had asked about this scenario. Gutted I can't find references to this, but I'm 100% convinced I did watch this ages ago. – Jason Evans Aug 31 '12 at 14:30
  • This is the registry key I added 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] "UrlAllowList"="\\\\server\\helpfiles;file://\\\\server\\helpfiles" . And I think we use .NET 3.2 but I am not sure – Drabe Aug 31 '12 at 14:34
  • Did you add it to Wow6432Node as well for 32 bit processes? And did you restart your machine after making registry changes? – David Heffernan Aug 31 '12 at 14:39
  • No I did not. I have added it there as well and now it works – Drabe Aug 31 '12 at 14:55

1 Answers1

2

You need to alter one of the security settings on the machine. I use the following .reg file to effect the modification:

Windows Registry Editor Version 5.00

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

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

Read all about it here: http://support.microsoft.com/kb/896358

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Thanks for this. I had similiar problem and adding registry key also into `WOW6432Node` helped me! – Sk1X1 Jan 24 '18 at 12:42